xref: /trunk/main/sw/source/ui/fmtui/tmpdlg.cxx (revision efeef26f81c84063fb0a91bde3856d4a51172d90)
1*efeef26fSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*efeef26fSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*efeef26fSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*efeef26fSAndrew Rist  * distributed with this work for additional information
6*efeef26fSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*efeef26fSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*efeef26fSAndrew Rist  * "License"); you may not use this file except in compliance
9*efeef26fSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*efeef26fSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*efeef26fSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*efeef26fSAndrew Rist  * software distributed under the License is distributed on an
15*efeef26fSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*efeef26fSAndrew Rist  * KIND, either express or implied.  See the License for the
17*efeef26fSAndrew Rist  * specific language governing permissions and limitations
18*efeef26fSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*efeef26fSAndrew Rist  *************************************************************/
21*efeef26fSAndrew Rist 
22*efeef26fSAndrew 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 
106cdf0e10cSrcweir SwTemplateDlg::SwTemplateDlg(Window*            pParent,
107cdf0e10cSrcweir                              SfxStyleSheetBase& rBase,
108cdf0e10cSrcweir                              sal_uInt16             nRegion,
109cdf0e10cSrcweir                              sal_Bool               bColumn,
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 );
202cdf0e10cSrcweir             DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
203cdf0e10cSrcweir             DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!");
204cdf0e10cSrcweir             AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );
205cdf0e10cSrcweir             DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!");
206cdf0e10cSrcweir             DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!");
207cdf0e10cSrcweir             AddTabPage(TP_BORDER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) );
208cdf0e10cSrcweir 
209cdf0e10cSrcweir             AddTabPage( TP_CONDCOLL,    SwCondCollPage::Create,
210cdf0e10cSrcweir                                         SwCondCollPage::GetRanges );
211cdf0e10cSrcweir             if( (!bNewStyle && RES_CONDTXTFMTCOLL != ((SwDocStyleSheet&)rBase).GetCollection()->Which())
212cdf0e10cSrcweir             || nHtmlMode & HTMLMODE_ON )
213cdf0e10cSrcweir                 RemoveTabPage(TP_CONDCOLL);
214cdf0e10cSrcweir 
215cdf0e10cSrcweir             SvtCJKOptions aCJKOptions;
216cdf0e10cSrcweir             if(nHtmlMode & HTMLMODE_ON)
217cdf0e10cSrcweir             {
218cdf0e10cSrcweir                 SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
219cdf0e10cSrcweir                 if (!pHtmlOpt->IsPrintLayoutExtension())
220cdf0e10cSrcweir                     RemoveTabPage(TP_PARA_EXT);
221cdf0e10cSrcweir                 RemoveTabPage(TP_PARA_ASIAN);
222cdf0e10cSrcweir                 RemoveTabPage(TP_TABULATOR);
223cdf0e10cSrcweir                 RemoveTabPage(TP_NUMPARA);
224cdf0e10cSrcweir                 RemoveTabPage(TP_CHAR_TWOLN);
225cdf0e10cSrcweir                 if(!(nHtmlMode & HTMLMODE_FULL_STYLES))
226cdf0e10cSrcweir                 {
227cdf0e10cSrcweir                     RemoveTabPage(TP_BACKGROUND);
228cdf0e10cSrcweir                     RemoveTabPage(TP_DROPCAPS);
229cdf0e10cSrcweir                 }
230cdf0e10cSrcweir                 if(!(nHtmlMode & HTMLMODE_PARA_BORDER))
231cdf0e10cSrcweir                     RemoveTabPage(TP_BORDER);
232cdf0e10cSrcweir             }
233cdf0e10cSrcweir             else
234cdf0e10cSrcweir             {
235cdf0e10cSrcweir                 if(!aCJKOptions.IsAsianTypographyEnabled())
236cdf0e10cSrcweir                     RemoveTabPage(TP_PARA_ASIAN);
237cdf0e10cSrcweir                 if(!aCJKOptions.IsDoubleLinesEnabled())
238cdf0e10cSrcweir                     RemoveTabPage(TP_CHAR_TWOLN);
239cdf0e10cSrcweir             }
240cdf0e10cSrcweir         }
241cdf0e10cSrcweir         break;
242cdf0e10cSrcweir         // Rahmenvorlagen
243cdf0e10cSrcweir         case SFX_STYLE_FAMILY_FRAME:
244cdf0e10cSrcweir         {
245cdf0e10cSrcweir             AddTabPage(TP_FRM_STD,      SwFrmPage::Create,
246cdf0e10cSrcweir                                         SwFrmPage::GetRanges );
247cdf0e10cSrcweir             AddTabPage(TP_FRM_ADD,      SwFrmAddPage::Create,
248cdf0e10cSrcweir                                         SwFrmAddPage::GetRanges );
249cdf0e10cSrcweir             AddTabPage(TP_FRM_WRAP,     SwWrapTabPage::Create,
250cdf0e10cSrcweir                                         SwWrapTabPage::GetRanges );
251cdf0e10cSrcweir             DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
252cdf0e10cSrcweir             DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!");
253cdf0e10cSrcweir             AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );
254cdf0e10cSrcweir             DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!");
255cdf0e10cSrcweir             DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!");
256cdf0e10cSrcweir             AddTabPage(TP_BORDER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) );
257cdf0e10cSrcweir 
258cdf0e10cSrcweir             AddTabPage(TP_COLUMN,       SwColumnPage::Create,
259cdf0e10cSrcweir                                         SwColumnPage::GetRanges );
260cdf0e10cSrcweir 
261cdf0e10cSrcweir             AddTabPage( TP_MACRO_ASSIGN, pFact->GetTabPageCreatorFunc(RID_SVXPAGE_MACROASSIGN), 0);
262cdf0e10cSrcweir 
263cdf0e10cSrcweir             // Auskommentiert wegen Bug #45776 (per default keine Breite&Groesse in Rahmenvorlagen)
264cdf0e10cSrcweir /*          SwFmtFrmSize aSize( (const SwFmtFrmSize&)rBase.
265cdf0e10cSrcweir                                             GetItemSet().Get(RES_FRM_SIZE));
266cdf0e10cSrcweir             if( !aSize.GetWidth() )
267cdf0e10cSrcweir             {
268cdf0e10cSrcweir                 aSize.SetWidth( DFLT_WIDTH );
269cdf0e10cSrcweir                 aSize.SetHeight( DFLT_HEIGHT );
270cdf0e10cSrcweir                 rBase.GetItemSet().Put( aSize );
271cdf0e10cSrcweir             }*/
272cdf0e10cSrcweir         break;
273cdf0e10cSrcweir         }
274cdf0e10cSrcweir         // Seitenvorlagen
275cdf0e10cSrcweir         case SFX_STYLE_FAMILY_PAGE:
276cdf0e10cSrcweir         {
277cdf0e10cSrcweir             DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
278cdf0e10cSrcweir             DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!");
279cdf0e10cSrcweir             AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );
280cdf0e10cSrcweir             AddTabPage(TP_HEADER_PAGE,      String(SW_RES(STR_PAGE_HEADER)),
281cdf0e10cSrcweir                                             SvxHeaderPage::Create,
282cdf0e10cSrcweir                                             SvxHeaderPage::GetRanges );
283cdf0e10cSrcweir             AddTabPage(TP_FOOTER_PAGE,      String(SW_RES(STR_PAGE_FOOTER)),
284cdf0e10cSrcweir                                             SvxFooterPage::Create,
285cdf0e10cSrcweir                                             SvxFooterPage::GetRanges );
286cdf0e10cSrcweir             if(bColumn)
287cdf0e10cSrcweir                 SetCurPageId(TP_COLUMN);
288cdf0e10cSrcweir 
289cdf0e10cSrcweir             DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_PAGE ), "GetTabPageCreatorFunc fail!");
290cdf0e10cSrcweir             DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_PAGE ), "GetTabPageRangesFunc fail!");
291cdf0e10cSrcweir             AddTabPage(TP_PAGE_STD,         String(SW_RES(STR_PAGE_STD)),
292cdf0e10cSrcweir                                             pFact->GetTabPageCreatorFunc( RID_SVXPAGE_PAGE ),
293cdf0e10cSrcweir                                             pFact->GetTabPageRangesFunc( RID_SVXPAGE_PAGE ),
294cdf0e10cSrcweir                                             sal_False,
295cdf0e10cSrcweir                                             1 ); // nach der Verwalten-Page
296cdf0e10cSrcweir             if(!pActShell || 0 == ::GetHtmlMode(pWrtShell->GetView().GetDocShell()))
297cdf0e10cSrcweir             {
298cdf0e10cSrcweir                 DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!");
299cdf0e10cSrcweir                 DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!");
300cdf0e10cSrcweir                 AddTabPage(TP_BORDER,           String(SW_RES(STR_PAGE_BORDER)),
301cdf0e10cSrcweir                                 pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) );
302cdf0e10cSrcweir                 AddTabPage(TP_COLUMN,           String(SW_RES(STR_PAGE_COLUMN)),
303cdf0e10cSrcweir                                                 SwColumnPage::Create,
304cdf0e10cSrcweir                                                 SwColumnPage::GetRanges );
305cdf0e10cSrcweir                 AddTabPage(TP_FOOTNOTE_PAGE,    String(SW_RES(STR_PAGE_FOOTNOTE)),
306cdf0e10cSrcweir                                                 SwFootNotePage::Create,
307cdf0e10cSrcweir                                                 SwFootNotePage::GetRanges );
308cdf0e10cSrcweir                 AddTabPage(TP_TEXTGRID_PAGE,    String(SW_RES(STR_PAGE_TEXTGRID)),
309cdf0e10cSrcweir                                                 SwTextGridPage::Create,
310cdf0e10cSrcweir                                                 SwTextGridPage::GetRanges );
311cdf0e10cSrcweir                 SvtCJKOptions aCJKOptions;
312cdf0e10cSrcweir                 if(!aCJKOptions.IsAsianTypographyEnabled())
313cdf0e10cSrcweir                     RemoveTabPage(TP_TEXTGRID_PAGE);
314cdf0e10cSrcweir             }
315cdf0e10cSrcweir 
316cdf0e10cSrcweir 
317cdf0e10cSrcweir         }
318cdf0e10cSrcweir         break;
319cdf0e10cSrcweir         // Numerierungsvorlagen
320cdf0e10cSrcweir         case SFX_STYLE_FAMILY_PSEUDO:
321cdf0e10cSrcweir         {
322cdf0e10cSrcweir             AddTabPage( RID_SVXPAGE_PICK_SINGLE_NUM );
323cdf0e10cSrcweir             AddTabPage( RID_SVXPAGE_PICK_BULLET );
324cdf0e10cSrcweir             AddTabPage( RID_SVXPAGE_PICK_NUM );
325cdf0e10cSrcweir             AddTabPage( RID_SVXPAGE_PICK_BMP);
326cdf0e10cSrcweir             AddTabPage( RID_SVXPAGE_NUM_OPTIONS );
327cdf0e10cSrcweir             AddTabPage( RID_SVXPAGE_NUM_POSITION );
328cdf0e10cSrcweir 
329cdf0e10cSrcweir 
330cdf0e10cSrcweir /*          const SfxPoolItem* pItem;
331cdf0e10cSrcweir             if(SFX_ITEM_SET == rBase.GetItemSet().GetItemState(
332cdf0e10cSrcweir                 FN_PARAM_ACT_NUMBER, sal_False, &pItem ))
333cdf0e10cSrcweir             {
334cdf0e10cSrcweir //              pActNum = (ActNumberFormat*)((const SwPtrItem*)pItem)->GetValue();
335cdf0e10cSrcweir             }
336cdf0e10cSrcweir */
337cdf0e10cSrcweir         }
338cdf0e10cSrcweir         break;
339cdf0e10cSrcweir 
340cdf0e10cSrcweir         default:
341cdf0e10cSrcweir             ASSERT(!this, "Falsche Familie");
342cdf0e10cSrcweir 
343cdf0e10cSrcweir     }
344cdf0e10cSrcweir }
345cdf0e10cSrcweir 
346cdf0e10cSrcweir /*--------------------------------------------------------------------
347cdf0e10cSrcweir     Beschreibung:
348cdf0e10cSrcweir  --------------------------------------------------------------------*/
349cdf0e10cSrcweir 
350cdf0e10cSrcweir SwTemplateDlg::~SwTemplateDlg()
351cdf0e10cSrcweir {
352cdf0e10cSrcweir }
353cdf0e10cSrcweir 
354cdf0e10cSrcweir /*--------------------------------------------------------------------
355cdf0e10cSrcweir     Beschreibung:
356cdf0e10cSrcweir  --------------------------------------------------------------------*/
357cdf0e10cSrcweir 
358cdf0e10cSrcweir short SwTemplateDlg::Ok()
359cdf0e10cSrcweir {
360cdf0e10cSrcweir     short nRet = SfxTabDialog::Ok();
361cdf0e10cSrcweir     if( RET_OK == nRet )
362cdf0e10cSrcweir     {
363cdf0e10cSrcweir         const SfxPoolItem *pOutItem, *pExItem;
364cdf0e10cSrcweir         if( SFX_ITEM_SET == pExampleSet->GetItemState(
365cdf0e10cSrcweir             SID_ATTR_NUMBERING_RULE, sal_False, &pExItem ) &&
366cdf0e10cSrcweir             ( !GetOutputItemSet() ||
367cdf0e10cSrcweir             SFX_ITEM_SET != GetOutputItemSet()->GetItemState(
368cdf0e10cSrcweir             SID_ATTR_NUMBERING_RULE, sal_False, &pOutItem ) ||
369cdf0e10cSrcweir             *pExItem != *pOutItem ))
370cdf0e10cSrcweir         {
371cdf0e10cSrcweir             if( GetOutputItemSet() )
372cdf0e10cSrcweir                 ((SfxItemSet*)GetOutputItemSet())->Put( *pExItem );
373cdf0e10cSrcweir             else
374cdf0e10cSrcweir                 nRet = RET_CANCEL;
375cdf0e10cSrcweir         }
376cdf0e10cSrcweir     }
377cdf0e10cSrcweir     else
378cdf0e10cSrcweir         //JP 09.01.98 Bug #46446#:
379cdf0e10cSrcweir         // das ist der Ok - Handler also muss auf OK defaultet werden!
380cdf0e10cSrcweir         nRet = RET_OK;
381cdf0e10cSrcweir     return nRet;
382cdf0e10cSrcweir }
383cdf0e10cSrcweir 
384cdf0e10cSrcweir /*--------------------------------------------------------------------
385cdf0e10cSrcweir     Beschreibung:
386cdf0e10cSrcweir  --------------------------------------------------------------------*/
387cdf0e10cSrcweir 
388cdf0e10cSrcweir const SfxItemSet* SwTemplateDlg::GetRefreshedSet()
389cdf0e10cSrcweir {
390cdf0e10cSrcweir     SfxItemSet* pInSet = GetInputSetImpl();
391cdf0e10cSrcweir     pInSet->ClearItem();
392cdf0e10cSrcweir     pInSet->SetParent( &GetStyleSheet().GetItemSet() );
393cdf0e10cSrcweir     return pInSet;
394cdf0e10cSrcweir }
395cdf0e10cSrcweir 
396cdf0e10cSrcweir /*--------------------------------------------------------------------
397cdf0e10cSrcweir     Beschreibung:
398cdf0e10cSrcweir  --------------------------------------------------------------------*/
399cdf0e10cSrcweir 
400cdf0e10cSrcweir void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
401cdf0e10cSrcweir {
402cdf0e10cSrcweir     //Namen der Vorlagen und Metric setzen
403cdf0e10cSrcweir     String sNumCharFmt, sBulletCharFmt;
404cdf0e10cSrcweir     SwStyleNameMapper::FillUIName( RES_POOLCHR_NUM_LEVEL, sNumCharFmt);
405cdf0e10cSrcweir     SwStyleNameMapper::FillUIName( RES_POOLCHR_BUL_LEVEL, sBulletCharFmt);
406cdf0e10cSrcweir     SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
407cdf0e10cSrcweir 
408cdf0e10cSrcweir     switch( nId )
409cdf0e10cSrcweir     {
410cdf0e10cSrcweir         case TP_CHAR_STD:
411cdf0e10cSrcweir             {
412cdf0e10cSrcweir                 ASSERT(::GetActiveView(), "keine View aktiv");
413cdf0e10cSrcweir 
414cdf0e10cSrcweir                 SvxFontListItem aFontListItem( *( (SvxFontListItem*)::GetActiveView()->
415cdf0e10cSrcweir                     GetDocShell()->GetItem( SID_ATTR_CHAR_FONTLIST ) ) );
416cdf0e10cSrcweir 
417cdf0e10cSrcweir                 aSet.Put (SvxFontListItem( aFontListItem.GetFontList(), SID_ATTR_CHAR_FONTLIST));
418cdf0e10cSrcweir                 sal_uInt32 nFlags = 0;
419cdf0e10cSrcweir                 if(rPage.GetItemSet().GetParent() && 0 == (nHtmlMode & HTMLMODE_ON ))
420cdf0e10cSrcweir                     nFlags = SVX_RELATIVE_MODE;
421cdf0e10cSrcweir                 if( SFX_STYLE_FAMILY_CHAR == nType )
422cdf0e10cSrcweir                     nFlags = nFlags|SVX_PREVIEW_CHARACTER;
423cdf0e10cSrcweir                 aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, nFlags));
424cdf0e10cSrcweir                 rPage.PageCreated(aSet);
425cdf0e10cSrcweir             }
426cdf0e10cSrcweir             break;
427cdf0e10cSrcweir 
428cdf0e10cSrcweir         case TP_CHAR_EXT:
429cdf0e10cSrcweir             {
430cdf0e10cSrcweir             sal_uInt32 nFlags = SVX_ENABLE_FLASH;
431cdf0e10cSrcweir             if( SFX_STYLE_FAMILY_CHAR == nType )
432cdf0e10cSrcweir                 nFlags = nFlags|SVX_PREVIEW_CHARACTER;
433cdf0e10cSrcweir             aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, nFlags));
434cdf0e10cSrcweir             rPage.PageCreated(aSet);
435cdf0e10cSrcweir             }
436cdf0e10cSrcweir             break;
437cdf0e10cSrcweir 
438cdf0e10cSrcweir         case TP_CHAR_POS:
439cdf0e10cSrcweir             if( SFX_STYLE_FAMILY_CHAR == nType )
440cdf0e10cSrcweir             {
441cdf0e10cSrcweir                 aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, SVX_PREVIEW_CHARACTER));
442cdf0e10cSrcweir                 rPage.PageCreated(aSet);
443cdf0e10cSrcweir             }
444cdf0e10cSrcweir         break;
445cdf0e10cSrcweir 
446cdf0e10cSrcweir         case TP_CHAR_TWOLN:
447cdf0e10cSrcweir             if( SFX_STYLE_FAMILY_CHAR == nType )
448cdf0e10cSrcweir             {
449cdf0e10cSrcweir                 aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, SVX_PREVIEW_CHARACTER));
450cdf0e10cSrcweir                 rPage.PageCreated(aSet);
451cdf0e10cSrcweir             }
452cdf0e10cSrcweir         break;
453cdf0e10cSrcweir 
454cdf0e10cSrcweir         case TP_PARA_STD:
455cdf0e10cSrcweir             {
456cdf0e10cSrcweir                 if( rPage.GetItemSet().GetParent() )
457cdf0e10cSrcweir                 {
458cdf0e10cSrcweir                     aSet.Put(SfxUInt32Item(SID_SVXSTDPARAGRAPHTABPAGE_ABSLINEDIST,MM50/10));
459cdf0e10cSrcweir                     aSet.Put(SfxUInt32Item(SID_SVXSTDPARAGRAPHTABPAGE_FLAGSET,0x000F));
460cdf0e10cSrcweir                     rPage.PageCreated(aSet);
461cdf0e10cSrcweir                 }
462cdf0e10cSrcweir 
463cdf0e10cSrcweir             }
464cdf0e10cSrcweir             break;
465cdf0e10cSrcweir         case TP_NUMPARA:
466cdf0e10cSrcweir             {
467cdf0e10cSrcweir                 //-->#outlinelevel added by zhaojianwei
468cdf0e10cSrcweir                 //  handle if the current paragraph style is assigned to a list level of outline style,
469cdf0e10cSrcweir                 SwTxtFmtColl* pTmpColl = pWrtShell->FindTxtFmtCollByName( GetStyleSheet().GetName() );
470cdf0e10cSrcweir                 if( pTmpColl && pTmpColl->IsAssignedToListLevelOfOutlineStyle() )
471cdf0e10cSrcweir                 {
472cdf0e10cSrcweir                     ((SwParagraphNumTabPage&)rPage).DisableOutline() ;
473cdf0e10cSrcweir                     ((SwParagraphNumTabPage&)rPage).DisableNumbering();
474cdf0e10cSrcweir                 }//<-end
475cdf0e10cSrcweir                 ListBox & rBox = ((SwParagraphNumTabPage&)rPage).GetStyleBox();
476cdf0e10cSrcweir                 SfxStyleSheetBasePool* pPool = pWrtShell->GetView().GetDocShell()->GetStyleSheetPool();
477cdf0e10cSrcweir                 pPool->SetSearchMask(SFX_STYLE_FAMILY_PSEUDO, SFXSTYLEBIT_ALL);
478cdf0e10cSrcweir                 const SfxStyleSheetBase* pBase = pPool->First();
479cdf0e10cSrcweir                 SvStringsSortDtor aNames;
480cdf0e10cSrcweir                 while(pBase)
481cdf0e10cSrcweir                 {
482cdf0e10cSrcweir                     aNames.Insert(new String(pBase->GetName()));
483cdf0e10cSrcweir                     pBase = pPool->Next();
484cdf0e10cSrcweir                 }
485cdf0e10cSrcweir                 for(sal_uInt16 i = 0; i < aNames.Count(); i++)
486cdf0e10cSrcweir                     rBox.InsertEntry(*aNames.GetObject(i));
487cdf0e10cSrcweir         }
488cdf0e10cSrcweir         break;
489cdf0e10cSrcweir         case TP_PARA_ALIGN:
490cdf0e10cSrcweir             {
491cdf0e10cSrcweir                 aSet.Put(SfxBoolItem(SID_SVXPARAALIGNTABPAGE_ENABLEJUSTIFYEXT,sal_True));
492cdf0e10cSrcweir                 rPage.PageCreated(aSet);
493cdf0e10cSrcweir             }
494cdf0e10cSrcweir             break;
495cdf0e10cSrcweir 
496cdf0e10cSrcweir         case TP_FRM_STD:
497cdf0e10cSrcweir             ((SwFrmPage&)rPage).SetNewFrame( sal_True );
498cdf0e10cSrcweir             ((SwFrmPage&)rPage).SetFormatUsed( sal_True );
499cdf0e10cSrcweir             break;
500cdf0e10cSrcweir 
501cdf0e10cSrcweir         case TP_FRM_ADD:
502cdf0e10cSrcweir             ((SwFrmAddPage&)rPage).SetFormatUsed(sal_True);
503cdf0e10cSrcweir             ((SwFrmAddPage&)rPage).SetNewFrame(sal_True);
504cdf0e10cSrcweir             break;
505cdf0e10cSrcweir 
506cdf0e10cSrcweir         case TP_FRM_WRAP:
507cdf0e10cSrcweir             ((SwWrapTabPage&)rPage).SetFormatUsed( sal_True, sal_False );
508cdf0e10cSrcweir             break;
509cdf0e10cSrcweir 
510cdf0e10cSrcweir         case TP_COLUMN:
511cdf0e10cSrcweir             if( nType == SFX_STYLE_FAMILY_FRAME )
512cdf0e10cSrcweir                 ((SwColumnPage&)rPage).SetFrmMode(sal_True);
513cdf0e10cSrcweir             ((SwColumnPage&)rPage).SetFormatUsed( sal_True );
514cdf0e10cSrcweir             break;
515cdf0e10cSrcweir 
516cdf0e10cSrcweir         case TP_BACKGROUND:
517cdf0e10cSrcweir         {
518cdf0e10cSrcweir             sal_Int32 nFlagType = 0;
519cdf0e10cSrcweir             if( SFX_STYLE_FAMILY_PARA == nType )
520cdf0e10cSrcweir                 nFlagType |= SVX_SHOW_PARACTL;
521cdf0e10cSrcweir             if( SFX_STYLE_FAMILY_CHAR != nType )
522cdf0e10cSrcweir                 nFlagType |= SVX_SHOW_SELECTOR;
523cdf0e10cSrcweir             if( SFX_STYLE_FAMILY_FRAME == nType )
524cdf0e10cSrcweir                 nFlagType |= SVX_ENABLE_TRANSPARENCY;
525cdf0e10cSrcweir             aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, nFlagType));
526cdf0e10cSrcweir             rPage.PageCreated(aSet);
527cdf0e10cSrcweir         }
528cdf0e10cSrcweir         break;
529cdf0e10cSrcweir         case TP_CONDCOLL:
530cdf0e10cSrcweir             ((SwCondCollPage&)rPage).SetCollection(
531cdf0e10cSrcweir                 ((SwDocStyleSheet&)GetStyleSheet()).GetCollection(), bNewStyle );
532cdf0e10cSrcweir             break;
533cdf0e10cSrcweir 
534cdf0e10cSrcweir         case TP_PAGE_STD:
535cdf0e10cSrcweir             if(0 == (nHtmlMode & HTMLMODE_ON ))
536cdf0e10cSrcweir             {
537cdf0e10cSrcweir                 List aList;
538cdf0e10cSrcweir                 String* pNew = new String;
539cdf0e10cSrcweir                 SwStyleNameMapper::FillUIName( RES_POOLCOLL_TEXT, *pNew );
540cdf0e10cSrcweir                 aList.Insert( pNew, (sal_uLong)0 );
541cdf0e10cSrcweir                 if( pWrtShell )
542cdf0e10cSrcweir                 {
543cdf0e10cSrcweir                     SfxStyleSheetBasePool* pStyleSheetPool = pWrtShell->
544cdf0e10cSrcweir                                 GetView().GetDocShell()->GetStyleSheetPool();
545cdf0e10cSrcweir                     pStyleSheetPool->SetSearchMask(SFX_STYLE_FAMILY_PARA);
546cdf0e10cSrcweir                     SfxStyleSheetBase *pFirstStyle = pStyleSheetPool->First();
547cdf0e10cSrcweir                     while(pFirstStyle)
548cdf0e10cSrcweir                     {
549cdf0e10cSrcweir                         aList.Insert( new String(pFirstStyle->GetName()),
550cdf0e10cSrcweir                                         aList.Count());
551cdf0e10cSrcweir                         pFirstStyle = pStyleSheetPool->Next();
552cdf0e10cSrcweir                     }
553cdf0e10cSrcweir                 }
554cdf0e10cSrcweir                 aSet.Put (SfxStringListItem(SID_COLLECT_LIST, &aList));
555cdf0e10cSrcweir                 rPage.PageCreated(aSet);
556cdf0e10cSrcweir                 for( sal_uInt16 i = (sal_uInt16)aList.Count(); i; --i )
557cdf0e10cSrcweir                     delete (String*)aList.Remove(i);
558cdf0e10cSrcweir             }
559cdf0e10cSrcweir             break;
560cdf0e10cSrcweir 
561cdf0e10cSrcweir         case TP_MACRO_ASSIGN:
562cdf0e10cSrcweir         {
563cdf0e10cSrcweir             SfxAllItemSet aNewSet(*aSet.GetPool());
564cdf0e10cSrcweir             aNewSet.Put( SwMacroAssignDlg::AddEvents(MACASSGN_ALLFRM) );
565cdf0e10cSrcweir             if ( pWrtShell )
566cdf0e10cSrcweir                 rPage.SetFrame( pWrtShell->GetView().GetViewFrame()->GetFrame().GetFrameInterface() );
567cdf0e10cSrcweir             rPage.PageCreated(aNewSet);
568cdf0e10cSrcweir             break;
569cdf0e10cSrcweir         }
570cdf0e10cSrcweir 
571cdf0e10cSrcweir         case RID_SVXPAGE_PICK_NUM:
572cdf0e10cSrcweir             {
573cdf0e10cSrcweir                 aSet.Put (SfxStringItem(SID_NUM_CHAR_FMT,sNumCharFmt));
574cdf0e10cSrcweir                 aSet.Put (SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt));
575cdf0e10cSrcweir                 rPage.PageCreated(aSet);
576cdf0e10cSrcweir             }
577cdf0e10cSrcweir         break;
578cdf0e10cSrcweir         case RID_SVXPAGE_NUM_OPTIONS:
579cdf0e10cSrcweir         {
580cdf0e10cSrcweir 
581cdf0e10cSrcweir             aSet.Put (SfxStringItem(SID_NUM_CHAR_FMT,sNumCharFmt));
582cdf0e10cSrcweir             aSet.Put (SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt));
583cdf0e10cSrcweir             // Zeichenvorlagen sammeln
584cdf0e10cSrcweir             ListBox rCharFmtLB(this);
585cdf0e10cSrcweir             rCharFmtLB.Clear();
586cdf0e10cSrcweir             rCharFmtLB.InsertEntry( ViewShell::GetShellRes()->aStrNone );
587cdf0e10cSrcweir             SwDocShell* pDocShell = ::GetActiveWrtShell()->GetView().GetDocShell();
588cdf0e10cSrcweir             ::FillCharStyleListBox(rCharFmtLB,  pDocShell);
589cdf0e10cSrcweir             List aList;
590cdf0e10cSrcweir             for(sal_uInt16 j = 0; j < rCharFmtLB.GetEntryCount(); j++)
591cdf0e10cSrcweir             {
592cdf0e10cSrcweir 
593cdf0e10cSrcweir                  aList.Insert( new XubString(rCharFmtLB.GetEntry(j)), LIST_APPEND );
594cdf0e10cSrcweir             }
595cdf0e10cSrcweir             aSet.Put( SfxStringListItem( SID_CHAR_FMT_LIST_BOX,&aList ) ) ;
596cdf0e10cSrcweir             FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebDocShell, pDocShell));
597cdf0e10cSrcweir             aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM, static_cast< sal_uInt16 >(eMetric)));
598cdf0e10cSrcweir             rPage.PageCreated(aSet);
599cdf0e10cSrcweir             for( sal_uInt16 i = (sal_uInt16)aList.Count(); i; --i )
600cdf0e10cSrcweir                     delete (XubString*)aList.Remove(i);
601cdf0e10cSrcweir             aList.Clear();
602cdf0e10cSrcweir         }
603cdf0e10cSrcweir         break;
604cdf0e10cSrcweir         case RID_SVXPAGE_NUM_POSITION:
605cdf0e10cSrcweir         {
606cdf0e10cSrcweir             SwDocShell* pDocShell = ::GetActiveWrtShell()->GetView().GetDocShell();
607cdf0e10cSrcweir             FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebDocShell, pDocShell));
608cdf0e10cSrcweir 
609cdf0e10cSrcweir             aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM, static_cast< sal_uInt16 >(eMetric)));
610cdf0e10cSrcweir             rPage.PageCreated(aSet);
611cdf0e10cSrcweir         }
612cdf0e10cSrcweir         break;
613cdf0e10cSrcweir         case  RID_SVXPAGE_PICK_BULLET :
614cdf0e10cSrcweir             {
615cdf0e10cSrcweir                 aSet.Put (SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt));
616cdf0e10cSrcweir                 rPage.PageCreated(aSet);
617cdf0e10cSrcweir             }
618cdf0e10cSrcweir         break;
619cdf0e10cSrcweir         case  TP_HEADER_PAGE:
620cdf0e10cSrcweir             if(0 == (nHtmlMode & HTMLMODE_ON ))
621cdf0e10cSrcweir                 ((SvxHeaderPage&)rPage).EnableDynamicSpacing();
622cdf0e10cSrcweir         break;
623cdf0e10cSrcweir         case  TP_FOOTER_PAGE:
624cdf0e10cSrcweir             if(0 == (nHtmlMode & HTMLMODE_ON ))
625cdf0e10cSrcweir                 ((SvxFooterPage&)rPage).EnableDynamicSpacing();
626cdf0e10cSrcweir         break;
627cdf0e10cSrcweir         case TP_BORDER :
628cdf0e10cSrcweir             if( SFX_STYLE_FAMILY_PARA == nType )
629cdf0e10cSrcweir             {
630cdf0e10cSrcweir                 aSet.Put (SfxUInt16Item(SID_SWMODE_TYPE,SW_BORDER_MODE_PARA));
631cdf0e10cSrcweir             }
632cdf0e10cSrcweir             else if( SFX_STYLE_FAMILY_FRAME == nType )
633cdf0e10cSrcweir             {
634cdf0e10cSrcweir                 aSet.Put (SfxUInt16Item(SID_SWMODE_TYPE,SW_BORDER_MODE_FRAME));
635cdf0e10cSrcweir             }
636cdf0e10cSrcweir             rPage.PageCreated(aSet);
637cdf0e10cSrcweir 
638cdf0e10cSrcweir         break;
639cdf0e10cSrcweir     }
640cdf0e10cSrcweir }
641cdf0e10cSrcweir 
642cdf0e10cSrcweir 
643cdf0e10cSrcweir 
644