xref: /trunk/main/sw/source/ui/fmtui/tmpdlg.cxx (revision cf6516809c57e1bb0a940545cca99cdad54d4ce2)
1efeef26fSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3efeef26fSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4efeef26fSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5efeef26fSAndrew Rist  * distributed with this work for additional information
6efeef26fSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7efeef26fSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8efeef26fSAndrew Rist  * "License"); you may not use this file except in compliance
9efeef26fSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11efeef26fSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13efeef26fSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14efeef26fSAndrew Rist  * software distributed under the License is distributed on an
15efeef26fSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16efeef26fSAndrew Rist  * KIND, either express or implied.  See the License for the
17efeef26fSAndrew Rist  * specific language governing permissions and limitations
18efeef26fSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20efeef26fSAndrew Rist  *************************************************************/
21efeef26fSAndrew Rist 
22efeef26fSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_sw.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #ifdef SW_DLLIMPLEMENTATION
28cdf0e10cSrcweir #undef SW_DLLIMPLEMENTATION
29cdf0e10cSrcweir #endif
30cdf0e10cSrcweir 
31cdf0e10cSrcweir 
32cdf0e10cSrcweir #include <hintids.hxx>
33cdf0e10cSrcweir 
34cdf0e10cSrcweir #ifndef _SVSTDARR_STRINGSSORTDTOR
35cdf0e10cSrcweir #define _SVSTDARR_STRINGSSORTDTOR
36cdf0e10cSrcweir #include <svl/svstdarr.hxx>
37cdf0e10cSrcweir #endif
38cdf0e10cSrcweir #include <vcl/msgbox.hxx>
39cdf0e10cSrcweir #include <sfx2/viewfrm.hxx>
40cdf0e10cSrcweir #include <svx/hdft.hxx>
41cdf0e10cSrcweir #include <editeng/flstitem.hxx>
42cdf0e10cSrcweir #include <svx/htmlmode.hxx>
43cdf0e10cSrcweir #include <svtools/htmlcfg.hxx>
44cdf0e10cSrcweir #include <svl/cjkoptions.hxx>
45cdf0e10cSrcweir #include <numpara.hxx>
46cdf0e10cSrcweir #include <fmtclds.hxx>
47cdf0e10cSrcweir #include <swtypes.hxx>
48cdf0e10cSrcweir #include <swmodule.hxx>
49cdf0e10cSrcweir #include <errhdl.hxx>       // fuer Create-Methoden
50cdf0e10cSrcweir #include <wrtsh.hxx>
51cdf0e10cSrcweir #ifndef _VIEW_HXX
52cdf0e10cSrcweir #include <view.hxx>
53cdf0e10cSrcweir #endif
54cdf0e10cSrcweir #include <wdocsh.hxx>
55cdf0e10cSrcweir #include <viewopt.hxx>
56cdf0e10cSrcweir #include <pgfnote.hxx>
57cdf0e10cSrcweir #ifndef _PGFGRID_HXX
58cdf0e10cSrcweir #include <pggrid.hxx>
59cdf0e10cSrcweir #endif
60cdf0e10cSrcweir #ifndef _TMPDLG_HXX
61cdf0e10cSrcweir #include <tmpdlg.hxx>       // der Dialog
62cdf0e10cSrcweir #endif
63cdf0e10cSrcweir #include <column.hxx>       // Spalten
64cdf0e10cSrcweir #include <drpcps.hxx>       // Initialen
65cdf0e10cSrcweir #include <frmpage.hxx>      // Rahmen
66cdf0e10cSrcweir #include <wrap.hxx>         // Rahmen
67cdf0e10cSrcweir #include <frmmgr.hxx>       // Rahmen
68cdf0e10cSrcweir #include <ccoll.hxx>        // CondColl
69cdf0e10cSrcweir #include <swuiccoll.hxx>
70cdf0e10cSrcweir #include <docstyle.hxx>     //
71cdf0e10cSrcweir #include <fmtcol.hxx>       //
72cdf0e10cSrcweir #include <macassgn.hxx>     //
73cdf0e10cSrcweir #include <poolfmt.hxx>
74cdf0e10cSrcweir #include <uitool.hxx>
75cdf0e10cSrcweir #include <shellres.hxx>
76cdf0e10cSrcweir 
77cdf0e10cSrcweir #ifndef _CMDID_H
78cdf0e10cSrcweir #include <cmdid.h>
79cdf0e10cSrcweir #endif
80cdf0e10cSrcweir #ifndef _HELPID_H
81cdf0e10cSrcweir #include <helpid.h>
82cdf0e10cSrcweir #endif
83cdf0e10cSrcweir #ifndef _GLOBALS_HRC
84cdf0e10cSrcweir #include <globals.hrc>
85cdf0e10cSrcweir #endif
86cdf0e10cSrcweir #ifndef _FMTUI_HRC
87cdf0e10cSrcweir #include <fmtui.hrc>
88cdf0e10cSrcweir #endif
89cdf0e10cSrcweir #include <SwStyleNameMapper.hxx>
90cdf0e10cSrcweir #include <svx/svxids.hrc>
91cdf0e10cSrcweir #include <svl/stritem.hxx>
92cdf0e10cSrcweir #include <svl/aeitem.hxx>
93cdf0e10cSrcweir #include <svl/slstitm.hxx>
94cdf0e10cSrcweir #include <svl/eitem.hxx>
95cdf0e10cSrcweir #include <svl/intitem.hxx>
96cdf0e10cSrcweir #include <svx/svxdlg.hxx>
97cdf0e10cSrcweir #include <svx/dialogs.hrc>
98cdf0e10cSrcweir #include <svx/flagsdef.hxx>
99cdf0e10cSrcweir 
100cdf0e10cSrcweir extern SW_DLLPUBLIC SwWrtShell* GetActiveWrtShell();
101cdf0e10cSrcweir 
102cdf0e10cSrcweir /*--------------------------------------------------------------------
103cdf0e10cSrcweir     Beschreibung:   Der Traeger des Dialoges
104cdf0e10cSrcweir  --------------------------------------------------------------------*/
105cdf0e10cSrcweir 
SwTemplateDlg(Window * pParent,SfxStyleSheetBase & rBase,sal_uInt16 nRegion,const sal_uInt16 nSlot,SwWrtShell * pActShell,sal_Bool bNew)106cdf0e10cSrcweir SwTemplateDlg::SwTemplateDlg(Window*            pParent,
107cdf0e10cSrcweir                              SfxStyleSheetBase& rBase,
108cdf0e10cSrcweir                              sal_uInt16             nRegion,
109ff0525f2SOliver-Rainer Wittmann                              const sal_uInt16 nSlot,
110cdf0e10cSrcweir                              SwWrtShell*        pActShell,
111cdf0e10cSrcweir                              sal_Bool               bNew ) :
112cdf0e10cSrcweir     SfxStyleDialog( pParent,
113cdf0e10cSrcweir                     SW_RES(DLG_TEMPLATE_BASE + nRegion),
114cdf0e10cSrcweir                     rBase,
115cdf0e10cSrcweir                     sal_False,
116cdf0e10cSrcweir                     0 ),
117cdf0e10cSrcweir     nType( nRegion ),
118cdf0e10cSrcweir     pWrtShell(pActShell),
119cdf0e10cSrcweir     bNewStyle(bNew)
120cdf0e10cSrcweir {
121cdf0e10cSrcweir     FreeResource();
122cdf0e10cSrcweir 
123cdf0e10cSrcweir     nHtmlMode = ::GetHtmlMode(pWrtShell->GetView().GetDocShell());
124cdf0e10cSrcweir     SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
125cdf0e10cSrcweir     DBG_ASSERT(pFact, "Dialogdiet fail!");
126cdf0e10cSrcweir     // TabPages zusammenfieseln
127cdf0e10cSrcweir     switch( nRegion )
128cdf0e10cSrcweir     {
129cdf0e10cSrcweir         // Zeichenvorlagen
130cdf0e10cSrcweir         case SFX_STYLE_FAMILY_CHAR:
131cdf0e10cSrcweir         {
132cdf0e10cSrcweir             DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), "GetTabPageCreatorFunc fail!");
133cdf0e10cSrcweir             DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_NAME ) , "GetTabPageRangesFunc fail!");
134cdf0e10cSrcweir             AddTabPage(TP_CHAR_STD, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_NAME ) );
135cdf0e10cSrcweir 
136cdf0e10cSrcweir             DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), "GetTabPageCreatorFunc fail!");
137cdf0e10cSrcweir             DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_EFFECTS ) , "GetTabPageRangesFunc fail!");
138cdf0e10cSrcweir             AddTabPage(TP_CHAR_EXT, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_EFFECTS ) );
139cdf0e10cSrcweir 
140cdf0e10cSrcweir             DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), "GetTabPageCreatorFunc fail!");
141cdf0e10cSrcweir             DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_POSITION ) , "GetTabPageRangesFunc fail!");
142cdf0e10cSrcweir             AddTabPage(TP_CHAR_POS, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_POSITION ) );
143cdf0e10cSrcweir 
144cdf0e10cSrcweir             DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_TWOLINES ), "GetTabPageCreatorFunc fail!");
145cdf0e10cSrcweir             DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_TWOLINES ) , "GetTabPageRangesFunc fail!");
146cdf0e10cSrcweir             AddTabPage(TP_CHAR_TWOLN, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_TWOLINES ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_TWOLINES ) );
147cdf0e10cSrcweir 
148cdf0e10cSrcweir             DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
149cdf0e10cSrcweir             DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) , "GetTabPageRangesFunc fail!");
150cdf0e10cSrcweir             AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );
151cdf0e10cSrcweir 
152cdf0e10cSrcweir             SvtCJKOptions aCJKOptions;
153cdf0e10cSrcweir             if(nHtmlMode & HTMLMODE_ON || !aCJKOptions.IsDoubleLinesEnabled())
154cdf0e10cSrcweir                 RemoveTabPage(TP_CHAR_TWOLN);
155cdf0e10cSrcweir         }
156cdf0e10cSrcweir         break;
157cdf0e10cSrcweir         // Absatzvorlagen
158cdf0e10cSrcweir         case SFX_STYLE_FAMILY_PARA:
159cdf0e10cSrcweir         {
160cdf0e10cSrcweir                 DBG_ASSERT(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_STD_PARAGRAPH), "GetTabPageCreatorFunc fail!");
161cdf0e10cSrcweir                 DBG_ASSERT(pFact->GetTabPageRangesFunc(RID_SVXPAGE_STD_PARAGRAPH), "GetTabPageRangesFunc fail!");
162cdf0e10cSrcweir                 AddTabPage( TP_PARA_STD,    pFact->GetTabPageCreatorFunc(RID_SVXPAGE_STD_PARAGRAPH),        pFact->GetTabPageRangesFunc(RID_SVXPAGE_STD_PARAGRAPH) );
163cdf0e10cSrcweir 
164cdf0e10cSrcweir                 DBG_ASSERT(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), "GetTabPageCreatorFunc fail!");
165cdf0e10cSrcweir                 DBG_ASSERT(pFact->GetTabPageRangesFunc(RID_SVXPAGE_ALIGN_PARAGRAPH), "GetTabPageRangesFunc fail!");
166cdf0e10cSrcweir                 AddTabPage( TP_PARA_ALIGN,  pFact->GetTabPageCreatorFunc(RID_SVXPAGE_ALIGN_PARAGRAPH),      pFact->GetTabPageRangesFunc(RID_SVXPAGE_ALIGN_PARAGRAPH) );
167cdf0e10cSrcweir 
168cdf0e10cSrcweir                 DBG_ASSERT(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_EXT_PARAGRAPH), "GetTabPageCreatorFunc fail!");
169cdf0e10cSrcweir                 DBG_ASSERT(pFact->GetTabPageRangesFunc(RID_SVXPAGE_EXT_PARAGRAPH), "GetTabPageRangesFunc fail!");
170cdf0e10cSrcweir                 AddTabPage( TP_PARA_EXT,    pFact->GetTabPageCreatorFunc(RID_SVXPAGE_EXT_PARAGRAPH),        pFact->GetTabPageRangesFunc(RID_SVXPAGE_EXT_PARAGRAPH) );
171cdf0e10cSrcweir 
172cdf0e10cSrcweir                 DBG_ASSERT(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN), "GetTabPageCreatorFunc fail!");
173cdf0e10cSrcweir                 DBG_ASSERT(pFact->GetTabPageRangesFunc(RID_SVXPAGE_PARA_ASIAN), "GetTabPageRangesFunc fail!");
174cdf0e10cSrcweir                 AddTabPage( TP_PARA_ASIAN,  pFact->GetTabPageCreatorFunc(RID_SVXPAGE_PARA_ASIAN),       pFact->GetTabPageRangesFunc(RID_SVXPAGE_PARA_ASIAN) );
175cdf0e10cSrcweir 
176cdf0e10cSrcweir                 DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), "GetTabPageCreatorFunc fail!");
177cdf0e10cSrcweir                 DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_NAME ), "GetTabPageRangesFunc fail!");
178cdf0e10cSrcweir                 AddTabPage(TP_CHAR_STD, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_NAME ) );
179cdf0e10cSrcweir 
180cdf0e10cSrcweir                 DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), "GetTabPageCreatorFunc fail!");
181cdf0e10cSrcweir                 DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_EFFECTS ), "GetTabPageRangesFunc fail!");
182cdf0e10cSrcweir                 AddTabPage(TP_CHAR_EXT, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_EFFECTS ) );
183cdf0e10cSrcweir 
184cdf0e10cSrcweir                 DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), "GetTabPageCreatorFunc fail!");
185cdf0e10cSrcweir                 DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_POSITION ) , "GetTabPageRangesFunc fail!");
186cdf0e10cSrcweir                 AddTabPage(TP_CHAR_POS, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_POSITION ) );
187cdf0e10cSrcweir 
188cdf0e10cSrcweir                 DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_TWOLINES ), "GetTabPageCreatorFunc fail!");
189cdf0e10cSrcweir                 DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_TWOLINES ) , "GetTabPageRangesFunc fail!");
190cdf0e10cSrcweir                 AddTabPage(TP_CHAR_TWOLN, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_TWOLINES ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_CHAR_TWOLINES ) );
191cdf0e10cSrcweir 
192cdf0e10cSrcweir 
193cdf0e10cSrcweir             DBG_ASSERT(pFact->GetTabPageCreatorFunc(RID_SVXPAGE_TABULATOR), "GetTabPageCreatorFunc fail!");
194cdf0e10cSrcweir             DBG_ASSERT(pFact->GetTabPageRangesFunc(RID_SVXPAGE_TABULATOR), "GetTabPageRangesFunc fail!");
195cdf0e10cSrcweir             AddTabPage( TP_TABULATOR,   pFact->GetTabPageCreatorFunc(RID_SVXPAGE_TABULATOR),        pFact->GetTabPageRangesFunc(RID_SVXPAGE_TABULATOR) );
196cdf0e10cSrcweir 
197cdf0e10cSrcweir 
198cdf0e10cSrcweir             AddTabPage(TP_NUMPARA,   SwParagraphNumTabPage::Create,
199cdf0e10cSrcweir                                     SwParagraphNumTabPage::GetRanges);
200cdf0e10cSrcweir             AddTabPage(TP_DROPCAPS,     SwDropCapsPage::Create,
201cdf0e10cSrcweir                                         SwDropCapsPage::GetRanges );
20256b35d86SArmin Le Grand             //UUUU remove?
20356b35d86SArmin Le Grand             //DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
20456b35d86SArmin Le Grand             //DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!");
20556b35d86SArmin Le Grand             //AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );
20656b35d86SArmin Le Grand 
20756b35d86SArmin Le Grand             //UUUU add Area and Transparence TabPages
20856b35d86SArmin Le Grand             AddTabPage(RID_SVXPAGE_AREA);
20956b35d86SArmin Le Grand             AddTabPage(RID_SVXPAGE_TRANSPARENCE);
21056b35d86SArmin Le Grand 
211cdf0e10cSrcweir             DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!");
212cdf0e10cSrcweir             DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!");
213cdf0e10cSrcweir             AddTabPage(TP_BORDER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) );
214cdf0e10cSrcweir 
215cdf0e10cSrcweir             AddTabPage( TP_CONDCOLL,    SwCondCollPage::Create,
216cdf0e10cSrcweir                                         SwCondCollPage::GetRanges );
217cdf0e10cSrcweir             if( (!bNewStyle && RES_CONDTXTFMTCOLL != ((SwDocStyleSheet&)rBase).GetCollection()->Which())
218cdf0e10cSrcweir             || nHtmlMode & HTMLMODE_ON )
219cdf0e10cSrcweir                 RemoveTabPage(TP_CONDCOLL);
220cdf0e10cSrcweir 
221cdf0e10cSrcweir             SvtCJKOptions aCJKOptions;
222cdf0e10cSrcweir             if(nHtmlMode & HTMLMODE_ON)
223cdf0e10cSrcweir             {
224cdf0e10cSrcweir                 SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
225cdf0e10cSrcweir                 if (!pHtmlOpt->IsPrintLayoutExtension())
226cdf0e10cSrcweir                     RemoveTabPage(TP_PARA_EXT);
227cdf0e10cSrcweir                 RemoveTabPage(TP_PARA_ASIAN);
228cdf0e10cSrcweir                 RemoveTabPage(TP_TABULATOR);
229cdf0e10cSrcweir                 RemoveTabPage(TP_NUMPARA);
230cdf0e10cSrcweir                 RemoveTabPage(TP_CHAR_TWOLN);
231cdf0e10cSrcweir                 if(!(nHtmlMode & HTMLMODE_FULL_STYLES))
232cdf0e10cSrcweir                 {
233cdf0e10cSrcweir                     RemoveTabPage(TP_BACKGROUND);
234cdf0e10cSrcweir                     RemoveTabPage(TP_DROPCAPS);
235cdf0e10cSrcweir                 }
236cdf0e10cSrcweir                 if(!(nHtmlMode & HTMLMODE_PARA_BORDER))
237cdf0e10cSrcweir                     RemoveTabPage(TP_BORDER);
238cdf0e10cSrcweir             }
239cdf0e10cSrcweir             else
240cdf0e10cSrcweir             {
241cdf0e10cSrcweir                 if(!aCJKOptions.IsAsianTypographyEnabled())
242cdf0e10cSrcweir                     RemoveTabPage(TP_PARA_ASIAN);
243cdf0e10cSrcweir                 if(!aCJKOptions.IsDoubleLinesEnabled())
244cdf0e10cSrcweir                     RemoveTabPage(TP_CHAR_TWOLN);
245cdf0e10cSrcweir             }
246cdf0e10cSrcweir         }
247cdf0e10cSrcweir         break;
248cdf0e10cSrcweir         // Rahmenvorlagen
249cdf0e10cSrcweir         case SFX_STYLE_FAMILY_FRAME:
250cdf0e10cSrcweir         {
251cdf0e10cSrcweir             AddTabPage(TP_FRM_STD,      SwFrmPage::Create,
252cdf0e10cSrcweir                                         SwFrmPage::GetRanges );
253cdf0e10cSrcweir             AddTabPage(TP_FRM_ADD,      SwFrmAddPage::Create,
254cdf0e10cSrcweir                                         SwFrmAddPage::GetRanges );
255cdf0e10cSrcweir             AddTabPage(TP_FRM_WRAP,     SwWrapTabPage::Create,
256cdf0e10cSrcweir                                         SwWrapTabPage::GetRanges );
25756b35d86SArmin Le Grand 
25856b35d86SArmin Le Grand             //UUUU remove?
25956b35d86SArmin Le Grand             //DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
26056b35d86SArmin Le Grand             //DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!");
26164b14621SArmin Le Grand 
26264b14621SArmin Le Grand             //UUUU remove?
26364b14621SArmin Le Grand             //AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );
26464b14621SArmin Le Grand 
26564b14621SArmin Le Grand             //UUUU add Area and Transparence TabPages
26664b14621SArmin Le Grand             AddTabPage(RID_SVXPAGE_AREA);
26764b14621SArmin Le Grand             AddTabPage(RID_SVXPAGE_TRANSPARENCE);
26864b14621SArmin Le Grand 
269cdf0e10cSrcweir             DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!");
270cdf0e10cSrcweir             DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!");
271cdf0e10cSrcweir             AddTabPage(TP_BORDER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) );
272cdf0e10cSrcweir 
273cdf0e10cSrcweir             AddTabPage(TP_COLUMN,       SwColumnPage::Create,
274cdf0e10cSrcweir                                         SwColumnPage::GetRanges );
275cdf0e10cSrcweir 
276cdf0e10cSrcweir             AddTabPage( TP_MACRO_ASSIGN, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_MACROASSIGN), 0);
277cdf0e10cSrcweir 
278cdf0e10cSrcweir         break;
279cdf0e10cSrcweir         }
280cdf0e10cSrcweir         // Seitenvorlagen
281cdf0e10cSrcweir         case SFX_STYLE_FAMILY_PAGE:
282cdf0e10cSrcweir         {
28356b35d86SArmin Le Grand             //UUUU remove?
28456b35d86SArmin Le Grand             //DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
28556b35d86SArmin Le Grand             //DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!");
28656b35d86SArmin Le Grand             //AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );
28756b35d86SArmin Le Grand 
28856b35d86SArmin Le Grand             //UUUU add Area and Transparence TabPages
28956b35d86SArmin Le Grand             AddTabPage(RID_SVXPAGE_AREA);
29056b35d86SArmin Le Grand             AddTabPage(RID_SVXPAGE_TRANSPARENCE);
29156b35d86SArmin Le Grand 
292cdf0e10cSrcweir             AddTabPage(TP_HEADER_PAGE,      String(SW_RES(STR_PAGE_HEADER)),
293cdf0e10cSrcweir                                             SvxHeaderPage::Create,
294cdf0e10cSrcweir                                             SvxHeaderPage::GetRanges );
295cdf0e10cSrcweir             AddTabPage(TP_FOOTER_PAGE,      String(SW_RES(STR_PAGE_FOOTER)),
296cdf0e10cSrcweir                                             SvxFooterPage::Create,
297cdf0e10cSrcweir                                             SvxFooterPage::GetRanges );
298ff0525f2SOliver-Rainer Wittmann             if ( nSlot == FN_FORMAT_PAGE_COLUMN_DLG )
299ff0525f2SOliver-Rainer Wittmann             {
300cdf0e10cSrcweir                 SetCurPageId(TP_COLUMN);
301ff0525f2SOliver-Rainer Wittmann             }
302ff0525f2SOliver-Rainer Wittmann             else if ( nSlot == FN_FORMAT_PAGE_SETTING_DLG )
303ff0525f2SOliver-Rainer Wittmann             {
304ff0525f2SOliver-Rainer Wittmann                 SetCurPageId(TP_PAGE_STD);
305ff0525f2SOliver-Rainer Wittmann             }
306cdf0e10cSrcweir 
307cdf0e10cSrcweir             DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_PAGE ), "GetTabPageCreatorFunc fail!");
308cdf0e10cSrcweir             DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_PAGE ), "GetTabPageRangesFunc fail!");
309cdf0e10cSrcweir             AddTabPage(TP_PAGE_STD,         String(SW_RES(STR_PAGE_STD)),
310cdf0e10cSrcweir                                             pFact->GetTabPageCreatorFunc( RID_SVXPAGE_PAGE ),
311cdf0e10cSrcweir                                             pFact->GetTabPageRangesFunc( RID_SVXPAGE_PAGE ),
312cdf0e10cSrcweir                                             sal_False,
313cdf0e10cSrcweir                                             1 ); // nach der Verwalten-Page
314cdf0e10cSrcweir             if(!pActShell || 0 == ::GetHtmlMode(pWrtShell->GetView().GetDocShell()))
315cdf0e10cSrcweir             {
316cdf0e10cSrcweir                 DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!");
317cdf0e10cSrcweir                 DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!");
318cdf0e10cSrcweir                 AddTabPage(TP_BORDER,           String(SW_RES(STR_PAGE_BORDER)),
319cdf0e10cSrcweir                                 pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) );
320cdf0e10cSrcweir                 AddTabPage(TP_COLUMN,           String(SW_RES(STR_PAGE_COLUMN)),
321cdf0e10cSrcweir                                                 SwColumnPage::Create,
322cdf0e10cSrcweir                                                 SwColumnPage::GetRanges );
323cdf0e10cSrcweir                 AddTabPage(TP_FOOTNOTE_PAGE,    String(SW_RES(STR_PAGE_FOOTNOTE)),
324cdf0e10cSrcweir                                                 SwFootNotePage::Create,
325cdf0e10cSrcweir                                                 SwFootNotePage::GetRanges );
326cdf0e10cSrcweir                 AddTabPage(TP_TEXTGRID_PAGE,    String(SW_RES(STR_PAGE_TEXTGRID)),
327cdf0e10cSrcweir                                                 SwTextGridPage::Create,
328cdf0e10cSrcweir                                                 SwTextGridPage::GetRanges );
329cdf0e10cSrcweir                 SvtCJKOptions aCJKOptions;
330cdf0e10cSrcweir                 if(!aCJKOptions.IsAsianTypographyEnabled())
331cdf0e10cSrcweir                     RemoveTabPage(TP_TEXTGRID_PAGE);
332cdf0e10cSrcweir             }
333cdf0e10cSrcweir 
334cdf0e10cSrcweir 
335cdf0e10cSrcweir         }
336cdf0e10cSrcweir         break;
337cdf0e10cSrcweir         // Numerierungsvorlagen
338cdf0e10cSrcweir         case SFX_STYLE_FAMILY_PSEUDO:
339cdf0e10cSrcweir         {
340cdf0e10cSrcweir             AddTabPage( RID_SVXPAGE_PICK_SINGLE_NUM );
341cdf0e10cSrcweir             AddTabPage( RID_SVXPAGE_PICK_BULLET );
342cdf0e10cSrcweir             AddTabPage( RID_SVXPAGE_PICK_NUM );
343cdf0e10cSrcweir             AddTabPage( RID_SVXPAGE_PICK_BMP);
344cdf0e10cSrcweir             AddTabPage( RID_SVXPAGE_NUM_OPTIONS );
345cdf0e10cSrcweir             AddTabPage( RID_SVXPAGE_NUM_POSITION );
346cdf0e10cSrcweir 
347cdf0e10cSrcweir 
348cdf0e10cSrcweir /*          const SfxPoolItem* pItem;
349cdf0e10cSrcweir             if(SFX_ITEM_SET == rBase.GetItemSet().GetItemState(
350cdf0e10cSrcweir                 FN_PARAM_ACT_NUMBER, sal_False, &pItem ))
351cdf0e10cSrcweir             {
352cdf0e10cSrcweir //              pActNum = (ActNumberFormat*)((const SwPtrItem*)pItem)->GetValue();
353cdf0e10cSrcweir             }
354cdf0e10cSrcweir */
355cdf0e10cSrcweir         }
356cdf0e10cSrcweir         break;
357cdf0e10cSrcweir 
358cdf0e10cSrcweir         default:
359*870262e3SDon Lewis             ASSERT(sal_False, "Wrong family");
360cdf0e10cSrcweir 
361cdf0e10cSrcweir     }
362cdf0e10cSrcweir }
363cdf0e10cSrcweir 
364cdf0e10cSrcweir /*--------------------------------------------------------------------
365cdf0e10cSrcweir     Beschreibung:
366cdf0e10cSrcweir  --------------------------------------------------------------------*/
367cdf0e10cSrcweir 
~SwTemplateDlg()368cdf0e10cSrcweir SwTemplateDlg::~SwTemplateDlg()
369cdf0e10cSrcweir {
370cdf0e10cSrcweir }
371cdf0e10cSrcweir 
372cdf0e10cSrcweir /*--------------------------------------------------------------------
373cdf0e10cSrcweir     Beschreibung:
374cdf0e10cSrcweir  --------------------------------------------------------------------*/
375cdf0e10cSrcweir 
Ok()376cdf0e10cSrcweir short SwTemplateDlg::Ok()
377cdf0e10cSrcweir {
378cdf0e10cSrcweir     short nRet = SfxTabDialog::Ok();
379cdf0e10cSrcweir     if( RET_OK == nRet )
380cdf0e10cSrcweir     {
381cdf0e10cSrcweir         const SfxPoolItem *pOutItem, *pExItem;
382cdf0e10cSrcweir         if( SFX_ITEM_SET == pExampleSet->GetItemState(
383cdf0e10cSrcweir             SID_ATTR_NUMBERING_RULE, sal_False, &pExItem ) &&
384cdf0e10cSrcweir             ( !GetOutputItemSet() ||
385cdf0e10cSrcweir             SFX_ITEM_SET != GetOutputItemSet()->GetItemState(
386cdf0e10cSrcweir             SID_ATTR_NUMBERING_RULE, sal_False, &pOutItem ) ||
387cdf0e10cSrcweir             *pExItem != *pOutItem ))
388cdf0e10cSrcweir         {
389cdf0e10cSrcweir             if( GetOutputItemSet() )
390cdf0e10cSrcweir                 ((SfxItemSet*)GetOutputItemSet())->Put( *pExItem );
391cdf0e10cSrcweir             else
392cdf0e10cSrcweir                 nRet = RET_CANCEL;
393cdf0e10cSrcweir         }
394cdf0e10cSrcweir     }
395cdf0e10cSrcweir     else
396cdf0e10cSrcweir         //JP 09.01.98 Bug #46446#:
397cdf0e10cSrcweir         // das ist der Ok - Handler also muss auf OK defaultet werden!
398cdf0e10cSrcweir         nRet = RET_OK;
399cdf0e10cSrcweir     return nRet;
400cdf0e10cSrcweir }
401cdf0e10cSrcweir 
402cdf0e10cSrcweir /*--------------------------------------------------------------------
403cdf0e10cSrcweir     Beschreibung:
404cdf0e10cSrcweir  --------------------------------------------------------------------*/
405cdf0e10cSrcweir 
GetRefreshedSet()406cdf0e10cSrcweir const SfxItemSet* SwTemplateDlg::GetRefreshedSet()
407cdf0e10cSrcweir {
408cdf0e10cSrcweir     SfxItemSet* pInSet = GetInputSetImpl();
409cdf0e10cSrcweir     pInSet->ClearItem();
410cdf0e10cSrcweir     pInSet->SetParent( &GetStyleSheet().GetItemSet() );
411cdf0e10cSrcweir     return pInSet;
412cdf0e10cSrcweir }
413cdf0e10cSrcweir 
414cdf0e10cSrcweir /*--------------------------------------------------------------------
415cdf0e10cSrcweir     Beschreibung:
416cdf0e10cSrcweir  --------------------------------------------------------------------*/
417cdf0e10cSrcweir 
PageCreated(sal_uInt16 nId,SfxTabPage & rPage)418cdf0e10cSrcweir void SwTemplateDlg::PageCreated(sal_uInt16 nId,SfxTabPage &rPage)
419cdf0e10cSrcweir {
420cdf0e10cSrcweir     //Namen der Vorlagen und Metric setzen
421cdf0e10cSrcweir     String sNumCharFmt,sBulletCharFmt;
422cdf0e10cSrcweir     SwStyleNameMapper::FillUIName(RES_POOLCHR_NUM_LEVEL,sNumCharFmt);
423cdf0e10cSrcweir     SwStyleNameMapper::FillUIName(RES_POOLCHR_BUL_LEVEL,sBulletCharFmt);
424cdf0e10cSrcweir     SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
425cdf0e10cSrcweir 
426cdf0e10cSrcweir     switch(nId)
427cdf0e10cSrcweir     {
428cdf0e10cSrcweir         case TP_CHAR_STD:
429cdf0e10cSrcweir         {
430cdf0e10cSrcweir             ASSERT(::GetActiveView(),"keine View aktiv");
431cdf0e10cSrcweir 
432cdf0e10cSrcweir             SvxFontListItem aFontListItem(*((SvxFontListItem*)::GetActiveView()->
433cdf0e10cSrcweir                 GetDocShell()->GetItem(SID_ATTR_CHAR_FONTLIST)));
434cdf0e10cSrcweir 
435cdf0e10cSrcweir             aSet.Put(SvxFontListItem(aFontListItem.GetFontList(),SID_ATTR_CHAR_FONTLIST));
436cdf0e10cSrcweir             sal_uInt32 nFlags = 0;
437cdf0e10cSrcweir             if(rPage.GetItemSet().GetParent() && 0 == (nHtmlMode & HTMLMODE_ON))
438cdf0e10cSrcweir                 nFlags = SVX_RELATIVE_MODE;
439cdf0e10cSrcweir             if(SFX_STYLE_FAMILY_CHAR == nType)
440cdf0e10cSrcweir                 nFlags = nFlags | SVX_PREVIEW_CHARACTER;
441cdf0e10cSrcweir             aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,nFlags));
442cdf0e10cSrcweir             rPage.PageCreated(aSet);
443cdf0e10cSrcweir             break;
44456b35d86SArmin Le Grand         }
445cdf0e10cSrcweir 
446cdf0e10cSrcweir         case TP_CHAR_EXT:
447cdf0e10cSrcweir         {
448cdf0e10cSrcweir             sal_uInt32 nFlags = SVX_ENABLE_FLASH;
449cdf0e10cSrcweir             if(SFX_STYLE_FAMILY_CHAR == nType)
450cdf0e10cSrcweir                 nFlags = nFlags | SVX_PREVIEW_CHARACTER;
451cdf0e10cSrcweir             aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,nFlags));
452cdf0e10cSrcweir             rPage.PageCreated(aSet);
453cdf0e10cSrcweir             break;
45456b35d86SArmin Le Grand         }
455cdf0e10cSrcweir 
456cdf0e10cSrcweir         case TP_CHAR_POS:
45756b35d86SArmin Le Grand         {
458cdf0e10cSrcweir             if(SFX_STYLE_FAMILY_CHAR == nType)
459cdf0e10cSrcweir             {
460cdf0e10cSrcweir                 aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,SVX_PREVIEW_CHARACTER));
461cdf0e10cSrcweir                 rPage.PageCreated(aSet);
462cdf0e10cSrcweir             }
463cdf0e10cSrcweir             break;
46456b35d86SArmin Le Grand         }
465cdf0e10cSrcweir 
466cdf0e10cSrcweir         case TP_CHAR_TWOLN:
46756b35d86SArmin Le Grand         {
468cdf0e10cSrcweir             if(SFX_STYLE_FAMILY_CHAR == nType)
469cdf0e10cSrcweir             {
470cdf0e10cSrcweir                 aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,SVX_PREVIEW_CHARACTER));
471cdf0e10cSrcweir                 rPage.PageCreated(aSet);
472cdf0e10cSrcweir             }
473cdf0e10cSrcweir             break;
47456b35d86SArmin Le Grand         }
475cdf0e10cSrcweir 
476cdf0e10cSrcweir         case TP_PARA_STD:
477cdf0e10cSrcweir         {
478cdf0e10cSrcweir             if(rPage.GetItemSet().GetParent())
479cdf0e10cSrcweir             {
480cdf0e10cSrcweir                 aSet.Put(SfxUInt32Item(SID_SVXSTDPARAGRAPHTABPAGE_ABSLINEDIST,MM50 / 10));
481cdf0e10cSrcweir                 aSet.Put(SfxUInt32Item(SID_SVXSTDPARAGRAPHTABPAGE_FLAGSET,0x000F));
482cdf0e10cSrcweir                 rPage.PageCreated(aSet);
483cdf0e10cSrcweir             }
484cdf0e10cSrcweir 
485cdf0e10cSrcweir             break;
48656b35d86SArmin Le Grand         }
48756b35d86SArmin Le Grand 
488cdf0e10cSrcweir         case TP_NUMPARA:
489cdf0e10cSrcweir         {
490cdf0e10cSrcweir             //-->#outlinelevel added by zhaojianwei
491cdf0e10cSrcweir             //  handle if the current paragraph style is assigned to a list level of outline style,
492cdf0e10cSrcweir             SwTxtFmtColl* pTmpColl = pWrtShell->FindTxtFmtCollByName(GetStyleSheet().GetName());
493cdf0e10cSrcweir             if(pTmpColl && pTmpColl->IsAssignedToListLevelOfOutlineStyle())
494cdf0e10cSrcweir             {
495cdf0e10cSrcweir                 ((SwParagraphNumTabPage&)rPage).DisableOutline();
496cdf0e10cSrcweir                 ((SwParagraphNumTabPage&)rPage).DisableNumbering();
497cdf0e10cSrcweir             }//<-end
498cdf0e10cSrcweir             ListBox & rBox = ((SwParagraphNumTabPage&)rPage).GetStyleBox();
499cdf0e10cSrcweir             SfxStyleSheetBasePool* pPool = pWrtShell->GetView().GetDocShell()->GetStyleSheetPool();
500cdf0e10cSrcweir             pPool->SetSearchMask(SFX_STYLE_FAMILY_PSEUDO,SFXSTYLEBIT_ALL);
501cdf0e10cSrcweir             const SfxStyleSheetBase* pBase = pPool->First();
502cdf0e10cSrcweir             SvStringsSortDtor aNames;
503cdf0e10cSrcweir             while(pBase)
504cdf0e10cSrcweir             {
505cdf0e10cSrcweir                 aNames.Insert(new String(pBase->GetName()));
506cdf0e10cSrcweir                 pBase = pPool->Next();
507cdf0e10cSrcweir             }
508cdf0e10cSrcweir             for(sal_uInt16 i = 0; i < aNames.Count(); i++)
509cdf0e10cSrcweir                 rBox.InsertEntry(*aNames.GetObject(i));
510cdf0e10cSrcweir             break;
51156b35d86SArmin Le Grand         }
51256b35d86SArmin Le Grand 
513cdf0e10cSrcweir         case TP_PARA_ALIGN:
514cdf0e10cSrcweir         {
515cdf0e10cSrcweir             aSet.Put(SfxBoolItem(SID_SVXPARAALIGNTABPAGE_ENABLEJUSTIFYEXT,sal_True));
516cdf0e10cSrcweir             rPage.PageCreated(aSet);
517cdf0e10cSrcweir             break;
51856b35d86SArmin Le Grand         }
519cdf0e10cSrcweir 
520cdf0e10cSrcweir         case TP_FRM_STD:
52156b35d86SArmin Le Grand         {
522cdf0e10cSrcweir             ((SwFrmPage&)rPage).SetNewFrame(sal_True);
523cdf0e10cSrcweir             ((SwFrmPage&)rPage).SetFormatUsed(sal_True);
524cdf0e10cSrcweir             break;
52556b35d86SArmin Le Grand         }
526cdf0e10cSrcweir 
527cdf0e10cSrcweir         case TP_FRM_ADD:
52856b35d86SArmin Le Grand         {
529cdf0e10cSrcweir             ((SwFrmAddPage&)rPage).SetFormatUsed(sal_True);
530cdf0e10cSrcweir             ((SwFrmAddPage&)rPage).SetNewFrame(sal_True);
531cdf0e10cSrcweir             break;
53256b35d86SArmin Le Grand         }
533cdf0e10cSrcweir 
534cdf0e10cSrcweir         case TP_FRM_WRAP:
53556b35d86SArmin Le Grand         {
536cdf0e10cSrcweir             ((SwWrapTabPage&)rPage).SetFormatUsed(sal_True,sal_False);
537cdf0e10cSrcweir             break;
53856b35d86SArmin Le Grand         }
539cdf0e10cSrcweir 
540cdf0e10cSrcweir         case TP_COLUMN:
54156b35d86SArmin Le Grand         {
542cdf0e10cSrcweir             if(nType == SFX_STYLE_FAMILY_FRAME)
543cdf0e10cSrcweir                 ((SwColumnPage&)rPage).SetFrmMode(sal_True);
544cdf0e10cSrcweir             ((SwColumnPage&)rPage).SetFormatUsed(sal_True);
545cdf0e10cSrcweir             break;
54656b35d86SArmin Le Grand         }
547cdf0e10cSrcweir 
54864b14621SArmin Le Grand         //UUUU do not remove; many other style dialog combinations still use the SfxTabPage
54964b14621SArmin Le Grand         // for the SvxBrushItem (see RID_SVXPAGE_BACKGROUND)
550cdf0e10cSrcweir         case TP_BACKGROUND:
551cdf0e10cSrcweir         {
552cdf0e10cSrcweir             sal_Int32 nFlagType = 0;
553cdf0e10cSrcweir             if(SFX_STYLE_FAMILY_PARA == nType)
554cdf0e10cSrcweir                 nFlagType |= SVX_SHOW_PARACTL;
555cdf0e10cSrcweir             if(SFX_STYLE_FAMILY_CHAR != nType)
556cdf0e10cSrcweir                 nFlagType |= SVX_SHOW_SELECTOR;
557cdf0e10cSrcweir             if(SFX_STYLE_FAMILY_FRAME == nType)
558cdf0e10cSrcweir                 nFlagType |= SVX_ENABLE_TRANSPARENCY;
559cdf0e10cSrcweir             aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,nFlagType));
560cdf0e10cSrcweir             rPage.PageCreated(aSet);
561cdf0e10cSrcweir             break;
56256b35d86SArmin Le Grand         }
56356b35d86SArmin Le Grand 
564cdf0e10cSrcweir         case TP_CONDCOLL:
56556b35d86SArmin Le Grand         {
566cdf0e10cSrcweir             ((SwCondCollPage&)rPage).SetCollection(
567cdf0e10cSrcweir                 ((SwDocStyleSheet&)GetStyleSheet()).GetCollection(),bNewStyle);
568cdf0e10cSrcweir             break;
56956b35d86SArmin Le Grand         }
570cdf0e10cSrcweir 
571cdf0e10cSrcweir         case TP_PAGE_STD:
57256b35d86SArmin Le Grand         {
573cdf0e10cSrcweir             if(0 == (nHtmlMode & HTMLMODE_ON))
574cdf0e10cSrcweir             {
575cdf0e10cSrcweir                 List aList;
576cdf0e10cSrcweir                 String* pNew = new String;
577cdf0e10cSrcweir                 SwStyleNameMapper::FillUIName(RES_POOLCOLL_TEXT,*pNew);
578cdf0e10cSrcweir                 aList.Insert(pNew,(sal_uLong)0);
57956b35d86SArmin Le Grand 
580cdf0e10cSrcweir                 if(pWrtShell)
581cdf0e10cSrcweir                 {
58256b35d86SArmin Le Grand                     SfxStyleSheetBasePool* pStyleSheetPool = pWrtShell->GetView().GetDocShell()->GetStyleSheetPool();
583cdf0e10cSrcweir                     pStyleSheetPool->SetSearchMask(SFX_STYLE_FAMILY_PARA);
584cdf0e10cSrcweir                     SfxStyleSheetBase *pFirstStyle = pStyleSheetPool->First();
58556b35d86SArmin Le Grand 
586cdf0e10cSrcweir                     while(pFirstStyle)
587cdf0e10cSrcweir                     {
58856b35d86SArmin Le Grand                         aList.Insert(new String(pFirstStyle->GetName()), aList.Count());
589cdf0e10cSrcweir                         pFirstStyle = pStyleSheetPool->Next();
590cdf0e10cSrcweir                     }
591cdf0e10cSrcweir                 }
59256b35d86SArmin Le Grand 
59356b35d86SArmin Le Grand                 //UUUU set DrawingLayer FillStyles active
59456b35d86SArmin Le Grand                 aSet.Put(SfxBoolItem(SID_DRAWINGLAYER_FILLSTYLES, true));
595cdf0e10cSrcweir                 aSet.Put(SfxStringListItem(SID_COLLECT_LIST, &aList));
596cdf0e10cSrcweir                 rPage.PageCreated(aSet);
59756b35d86SArmin Le Grand 
598cdf0e10cSrcweir                 for(sal_uInt16 i = (sal_uInt16)aList.Count(); i; --i)
59956b35d86SArmin Le Grand                 {
600cdf0e10cSrcweir                     delete (String*)aList.Remove(i);
601cdf0e10cSrcweir                 }
60256b35d86SArmin Le Grand             }
60356b35d86SArmin Le Grand 
604cdf0e10cSrcweir             break;
60556b35d86SArmin Le Grand         }
606cdf0e10cSrcweir 
607cdf0e10cSrcweir         case TP_MACRO_ASSIGN:
608cdf0e10cSrcweir         {
609cdf0e10cSrcweir             SfxAllItemSet aNewSet(*aSet.GetPool());
610cdf0e10cSrcweir             aNewSet.Put(SwMacroAssignDlg::AddEvents(MACASSGN_ALLFRM));
611cdf0e10cSrcweir             if(pWrtShell)
612cdf0e10cSrcweir                 rPage.SetFrame(pWrtShell->GetView().GetViewFrame()->GetFrame().GetFrameInterface());
613cdf0e10cSrcweir             rPage.PageCreated(aNewSet);
614cdf0e10cSrcweir             break;
615cdf0e10cSrcweir         }
616cdf0e10cSrcweir 
617cdf0e10cSrcweir         case RID_SVXPAGE_PICK_NUM:
618cdf0e10cSrcweir         {
619cdf0e10cSrcweir                 aSet.Put (SfxStringItem(SID_NUM_CHAR_FMT,sNumCharFmt));
620cdf0e10cSrcweir                 aSet.Put (SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt));
621cdf0e10cSrcweir                 rPage.PageCreated(aSet);
622cdf0e10cSrcweir             break;
62356b35d86SArmin Le Grand         }
62456b35d86SArmin Le Grand 
625cdf0e10cSrcweir         case RID_SVXPAGE_NUM_OPTIONS:
626cdf0e10cSrcweir         {
627cdf0e10cSrcweir             aSet.Put(SfxStringItem(SID_NUM_CHAR_FMT,sNumCharFmt));
628cdf0e10cSrcweir             aSet.Put(SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt));
629cdf0e10cSrcweir             // Zeichenvorlagen sammeln
630cdf0e10cSrcweir             ListBox rCharFmtLB(this);
631cdf0e10cSrcweir             rCharFmtLB.Clear();
632cdf0e10cSrcweir             rCharFmtLB.InsertEntry(ViewShell::GetShellRes()->aStrNone);
633cdf0e10cSrcweir             SwDocShell* pDocShell = ::GetActiveWrtShell()->GetView().GetDocShell();
634cdf0e10cSrcweir             ::FillCharStyleListBox(rCharFmtLB,pDocShell);
635cdf0e10cSrcweir             List aList;
636cdf0e10cSrcweir             for(sal_uInt16 j = 0; j < rCharFmtLB.GetEntryCount(); j++)
637cdf0e10cSrcweir             {
638cdf0e10cSrcweir 
639cdf0e10cSrcweir                 aList.Insert(new XubString(rCharFmtLB.GetEntry(j)),LIST_APPEND);
640cdf0e10cSrcweir             }
641cdf0e10cSrcweir             aSet.Put(SfxStringListItem(SID_CHAR_FMT_LIST_BOX,&aList));
642cdf0e10cSrcweir             FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebDocShell,pDocShell));
643cdf0e10cSrcweir             aSet.Put(SfxAllEnumItem(SID_METRIC_ITEM,static_cast<sal_uInt16>(eMetric)));
644cdf0e10cSrcweir             rPage.PageCreated(aSet);
645cdf0e10cSrcweir             for(sal_uInt16 i = (sal_uInt16)aList.Count(); i; --i)
646cdf0e10cSrcweir                 delete (XubString*)aList.Remove(i);
647cdf0e10cSrcweir             aList.Clear();
648cdf0e10cSrcweir             break;
64956b35d86SArmin Le Grand         }
65056b35d86SArmin Le Grand 
651cdf0e10cSrcweir         case RID_SVXPAGE_NUM_POSITION:
652cdf0e10cSrcweir         {
653cdf0e10cSrcweir             SwDocShell* pDocShell = ::GetActiveWrtShell()->GetView().GetDocShell();
654cdf0e10cSrcweir             FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebDocShell,pDocShell));
655cdf0e10cSrcweir 
656cdf0e10cSrcweir             aSet.Put(SfxAllEnumItem(SID_METRIC_ITEM,static_cast<sal_uInt16>(eMetric)));
657cdf0e10cSrcweir             rPage.PageCreated(aSet);
658cdf0e10cSrcweir             break;
65956b35d86SArmin Le Grand         }
66056b35d86SArmin Le Grand 
661cdf0e10cSrcweir         case  RID_SVXPAGE_PICK_BULLET:
662cdf0e10cSrcweir         {
663cdf0e10cSrcweir             aSet.Put(SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt));
664cdf0e10cSrcweir             rPage.PageCreated(aSet);
66556b35d86SArmin Le Grand             break;
666cdf0e10cSrcweir         }
66756b35d86SArmin Le Grand 
668cdf0e10cSrcweir         case  TP_HEADER_PAGE:
66956b35d86SArmin Le Grand         {
670cdf0e10cSrcweir             if(0 == (nHtmlMode & HTMLMODE_ON))
67156b35d86SArmin Le Grand             {
67256b35d86SArmin Le Grand                 static_cast< SvxHeaderPage& >(rPage).EnableDynamicSpacing();
67356b35d86SArmin Le Grand             }
67456b35d86SArmin Le Grand 
67556b35d86SArmin Le Grand             //UUUU set DrawingLayer FillStyles active
67656b35d86SArmin Le Grand             aSet.Put(SfxBoolItem(SID_DRAWINGLAYER_FILLSTYLES, true));
67756b35d86SArmin Le Grand             rPage.PageCreated(aSet);
67856b35d86SArmin Le Grand 
679cdf0e10cSrcweir             break;
68056b35d86SArmin Le Grand         }
68156b35d86SArmin Le Grand 
682cdf0e10cSrcweir         case  TP_FOOTER_PAGE:
68356b35d86SArmin Le Grand         {
684cdf0e10cSrcweir             if(0 == (nHtmlMode & HTMLMODE_ON))
68556b35d86SArmin Le Grand             {
68656b35d86SArmin Le Grand                 static_cast< SvxFooterPage& >(rPage).EnableDynamicSpacing();
68756b35d86SArmin Le Grand             }
68856b35d86SArmin Le Grand 
68956b35d86SArmin Le Grand             //UUUU set DrawingLayer FillStyles active
69056b35d86SArmin Le Grand             aSet.Put(SfxBoolItem(SID_DRAWINGLAYER_FILLSTYLES, true));
69156b35d86SArmin Le Grand             rPage.PageCreated(aSet);
69256b35d86SArmin Le Grand 
693cdf0e10cSrcweir             break;
69456b35d86SArmin Le Grand         }
69556b35d86SArmin Le Grand 
696cdf0e10cSrcweir         case TP_BORDER:
69756b35d86SArmin Le Grand         {
698cdf0e10cSrcweir             if(SFX_STYLE_FAMILY_PARA == nType)
699cdf0e10cSrcweir             {
700cdf0e10cSrcweir                 aSet.Put(SfxUInt16Item(SID_SWMODE_TYPE,SW_BORDER_MODE_PARA));
701cdf0e10cSrcweir             }
702cdf0e10cSrcweir             else if(SFX_STYLE_FAMILY_FRAME == nType)
703cdf0e10cSrcweir             {
704cdf0e10cSrcweir                 aSet.Put(SfxUInt16Item(SID_SWMODE_TYPE,SW_BORDER_MODE_FRAME));
705cdf0e10cSrcweir             }
706cdf0e10cSrcweir             rPage.PageCreated(aSet);
707cdf0e10cSrcweir             break;
70856b35d86SArmin Le Grand         }
70964b14621SArmin Le Grand 
71064b14621SArmin Le Grand         //UUUU inits for Area and Transparency TabPages
711b164f441SArmin Le Grand         // The selection attribute lists (XPropertyList derivates, e.g. XColorList for
71264b14621SArmin Le Grand         // the color table) need to be added as items (e.g. SvxColorTableItem) to make
713b164f441SArmin Le Grand         // these pages find the needed attributes for fill style suggestions.
714b164f441SArmin Le Grand         // These are added in SwDocStyleSheet::GetItemSet() for the SFX_STYLE_FAMILY_PARA on
715b164f441SArmin Le Grand         // demand, but could also be directly added from the DrawModel.
71664b14621SArmin Le Grand         case RID_SVXPAGE_AREA:
71764b14621SArmin Le Grand         {
71856b35d86SArmin Le Grand             aSet.Put(GetStyleSheet().GetItemSet());
719b164f441SArmin Le Grand 
720b164f441SArmin Le Grand             // add flag for direct graphic content selection
72156b35d86SArmin Le Grand             aSet.Put(SfxBoolItem(SID_OFFER_IMPORT, true));
722b164f441SArmin Le Grand 
72356b35d86SArmin Le Grand             rPage.PageCreated(aSet);
72464b14621SArmin Le Grand             break;
72556b35d86SArmin Le Grand         }
72664b14621SArmin Le Grand 
72764b14621SArmin Le Grand         case RID_SVXPAGE_TRANSPARENCE:
72864b14621SArmin Le Grand         {
72964b14621SArmin Le Grand             rPage.PageCreated(GetStyleSheet().GetItemSet());
73064b14621SArmin Le Grand             break;
731cdf0e10cSrcweir         }
732cdf0e10cSrcweir     }
73356b35d86SArmin Le Grand }
734cdf0e10cSrcweir 
735b164f441SArmin Le Grand // eof
736