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
10efeef26fSAndrew Rist *
11efeef26fSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12efeef26fSAndrew Rist *
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.
19efeef26fSAndrew Rist *
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
292ff0525f2SOliver-Rainer Wittmann AddTabPage(TP_HEADER_PAGE, String(SW_RES(STR_PAGE_HEADER)),
293ff0525f2SOliver-Rainer Wittmann SvxHeaderPage::Create,
294ff0525f2SOliver-Rainer Wittmann SvxHeaderPage::GetRanges );
295ff0525f2SOliver-Rainer Wittmann AddTabPage(TP_FOOTER_PAGE, String(SW_RES(STR_PAGE_FOOTER)),
296ff0525f2SOliver-Rainer Wittmann SvxFooterPage::Create,
297ff0525f2SOliver-Rainer Wittmann SvxFooterPage::GetRanges );
298ff0525f2SOliver-Rainer Wittmann if ( nSlot == FN_FORMAT_PAGE_COLUMN_DLG )
299ff0525f2SOliver-Rainer Wittmann {
300ff0525f2SOliver-Rainer Wittmann 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!");
309ff0525f2SOliver-Rainer Wittmann AddTabPage(TP_PAGE_STD, String(SW_RES(STR_PAGE_STD)),
310cdf0e10cSrcweir pFact->GetTabPageCreatorFunc( RID_SVXPAGE_PAGE ),
311cdf0e10cSrcweir pFact->GetTabPageRangesFunc( RID_SVXPAGE_PAGE ),
312ff0525f2SOliver-Rainer Wittmann sal_False,
313ff0525f2SOliver-Rainer Wittmann 1 ); // nach der Verwalten-Page
314ff0525f2SOliver-Rainer Wittmann if(!pActShell || 0 == ::GetHtmlMode(pWrtShell->GetView().GetDocShell()))
315ff0525f2SOliver-Rainer Wittmann {
316cdf0e10cSrcweir DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!");
317cdf0e10cSrcweir DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!");
318ff0525f2SOliver-Rainer Wittmann AddTabPage(TP_BORDER, String(SW_RES(STR_PAGE_BORDER)),
319ff0525f2SOliver-Rainer Wittmann pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) );
320ff0525f2SOliver-Rainer Wittmann AddTabPage(TP_COLUMN, String(SW_RES(STR_PAGE_COLUMN)),
321ff0525f2SOliver-Rainer Wittmann SwColumnPage::Create,
322ff0525f2SOliver-Rainer Wittmann SwColumnPage::GetRanges );
323ff0525f2SOliver-Rainer Wittmann AddTabPage(TP_FOOTNOTE_PAGE, String(SW_RES(STR_PAGE_FOOTNOTE)),
324ff0525f2SOliver-Rainer Wittmann SwFootNotePage::Create,
325ff0525f2SOliver-Rainer Wittmann 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
335ff0525f2SOliver-Rainer Wittmann }
336ff0525f2SOliver-Rainer Wittmann break;
337ff0525f2SOliver-Rainer Wittmann // 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)41856b35d86SArmin Le Grand void SwTemplateDlg::PageCreated(sal_uInt16 nId,SfxTabPage &rPage)
419cdf0e10cSrcweir {
42056b35d86SArmin Le Grand //Namen der Vorlagen und Metric setzen
42156b35d86SArmin Le Grand String sNumCharFmt,sBulletCharFmt;
42256b35d86SArmin Le Grand SwStyleNameMapper::FillUIName(RES_POOLCHR_NUM_LEVEL,sNumCharFmt);
42356b35d86SArmin Le Grand SwStyleNameMapper::FillUIName(RES_POOLCHR_BUL_LEVEL,sBulletCharFmt);
424cdf0e10cSrcweir SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
425cdf0e10cSrcweir
42656b35d86SArmin Le Grand switch(nId)
42756b35d86SArmin Le Grand {
42856b35d86SArmin Le Grand case TP_CHAR_STD:
42956b35d86SArmin Le Grand {
43056b35d86SArmin Le Grand ASSERT(::GetActiveView(),"keine View aktiv");
43156b35d86SArmin Le Grand
43256b35d86SArmin Le Grand SvxFontListItem aFontListItem(*((SvxFontListItem*)::GetActiveView()->
43356b35d86SArmin Le Grand GetDocShell()->GetItem(SID_ATTR_CHAR_FONTLIST)));
43456b35d86SArmin Le Grand
43556b35d86SArmin Le Grand aSet.Put(SvxFontListItem(aFontListItem.GetFontList(),SID_ATTR_CHAR_FONTLIST));
43656b35d86SArmin Le Grand sal_uInt32 nFlags = 0;
43756b35d86SArmin Le Grand if(rPage.GetItemSet().GetParent() && 0 == (nHtmlMode & HTMLMODE_ON))
43856b35d86SArmin Le Grand nFlags = SVX_RELATIVE_MODE;
43956b35d86SArmin Le Grand if(SFX_STYLE_FAMILY_CHAR == nType)
44056b35d86SArmin Le Grand nFlags = nFlags | SVX_PREVIEW_CHARACTER;
44156b35d86SArmin Le Grand aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,nFlags));
44256b35d86SArmin Le Grand rPage.PageCreated(aSet);
44356b35d86SArmin Le Grand break;
44456b35d86SArmin Le Grand }
445cdf0e10cSrcweir
44656b35d86SArmin Le Grand case TP_CHAR_EXT:
44756b35d86SArmin Le Grand {
44856b35d86SArmin Le Grand sal_uInt32 nFlags = SVX_ENABLE_FLASH;
44956b35d86SArmin Le Grand if(SFX_STYLE_FAMILY_CHAR == nType)
45056b35d86SArmin Le Grand nFlags = nFlags | SVX_PREVIEW_CHARACTER;
45156b35d86SArmin Le Grand aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,nFlags));
45256b35d86SArmin Le Grand rPage.PageCreated(aSet);
45356b35d86SArmin Le Grand break;
45456b35d86SArmin Le Grand }
455cdf0e10cSrcweir
456cdf0e10cSrcweir case TP_CHAR_POS:
45756b35d86SArmin Le Grand {
45856b35d86SArmin Le Grand if(SFX_STYLE_FAMILY_CHAR == nType)
45956b35d86SArmin Le Grand {
46056b35d86SArmin Le Grand aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,SVX_PREVIEW_CHARACTER));
46156b35d86SArmin Le Grand rPage.PageCreated(aSet);
46256b35d86SArmin Le Grand }
46356b35d86SArmin Le Grand break;
46456b35d86SArmin Le Grand }
465cdf0e10cSrcweir
466cdf0e10cSrcweir case TP_CHAR_TWOLN:
46756b35d86SArmin Le Grand {
46856b35d86SArmin Le Grand if(SFX_STYLE_FAMILY_CHAR == nType)
46956b35d86SArmin Le Grand {
47056b35d86SArmin Le Grand aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,SVX_PREVIEW_CHARACTER));
47156b35d86SArmin Le Grand rPage.PageCreated(aSet);
47256b35d86SArmin Le Grand }
47356b35d86SArmin Le Grand break;
47456b35d86SArmin Le Grand }
475cdf0e10cSrcweir
476cdf0e10cSrcweir case TP_PARA_STD:
47756b35d86SArmin Le Grand {
47856b35d86SArmin Le Grand if(rPage.GetItemSet().GetParent())
47956b35d86SArmin Le Grand {
48056b35d86SArmin Le Grand aSet.Put(SfxUInt32Item(SID_SVXSTDPARAGRAPHTABPAGE_ABSLINEDIST,MM50 / 10));
48156b35d86SArmin Le Grand aSet.Put(SfxUInt32Item(SID_SVXSTDPARAGRAPHTABPAGE_FLAGSET,0x000F));
482cdf0e10cSrcweir rPage.PageCreated(aSet);
48356b35d86SArmin Le Grand }
484cdf0e10cSrcweir
48556b35d86SArmin Le Grand break;
48656b35d86SArmin Le Grand }
487cdf0e10cSrcweir
48856b35d86SArmin Le Grand case TP_NUMPARA:
48956b35d86SArmin Le Grand {
49056b35d86SArmin Le Grand //-->#outlinelevel added by zhaojianwei
49156b35d86SArmin Le Grand // handle if the current paragraph style is assigned to a list level of outline style,
49256b35d86SArmin Le Grand SwTxtFmtColl* pTmpColl = pWrtShell->FindTxtFmtCollByName(GetStyleSheet().GetName());
49356b35d86SArmin Le Grand if(pTmpColl && pTmpColl->IsAssignedToListLevelOfOutlineStyle())
49456b35d86SArmin Le Grand {
49556b35d86SArmin Le Grand ((SwParagraphNumTabPage&)rPage).DisableOutline();
49656b35d86SArmin Le Grand ((SwParagraphNumTabPage&)rPage).DisableNumbering();
49756b35d86SArmin Le Grand }//<-end
49856b35d86SArmin Le Grand ListBox & rBox = ((SwParagraphNumTabPage&)rPage).GetStyleBox();
49956b35d86SArmin Le Grand SfxStyleSheetBasePool* pPool = pWrtShell->GetView().GetDocShell()->GetStyleSheetPool();
50056b35d86SArmin Le Grand pPool->SetSearchMask(SFX_STYLE_FAMILY_PSEUDO,SFXSTYLEBIT_ALL);
50156b35d86SArmin Le Grand const SfxStyleSheetBase* pBase = pPool->First();
50256b35d86SArmin Le Grand SvStringsSortDtor aNames;
50356b35d86SArmin Le Grand while(pBase)
50456b35d86SArmin Le Grand {
50556b35d86SArmin Le Grand aNames.Insert(new String(pBase->GetName()));
50656b35d86SArmin Le Grand pBase = pPool->Next();
50756b35d86SArmin Le Grand }
50856b35d86SArmin Le Grand for(sal_uInt16 i = 0; i < aNames.Count(); i++)
50956b35d86SArmin Le Grand rBox.InsertEntry(*aNames.GetObject(i));
51056b35d86SArmin Le Grand break;
51156b35d86SArmin Le Grand }
512cdf0e10cSrcweir
51356b35d86SArmin Le Grand case TP_PARA_ALIGN:
51456b35d86SArmin Le Grand {
51556b35d86SArmin Le Grand aSet.Put(SfxBoolItem(SID_SVXPARAALIGNTABPAGE_ENABLEJUSTIFYEXT,sal_True));
51656b35d86SArmin Le Grand rPage.PageCreated(aSet);
51756b35d86SArmin Le Grand break;
51856b35d86SArmin Le Grand }
519cdf0e10cSrcweir
52056b35d86SArmin Le Grand case TP_FRM_STD:
52156b35d86SArmin Le Grand {
52256b35d86SArmin Le Grand ((SwFrmPage&)rPage).SetNewFrame(sal_True);
52356b35d86SArmin Le Grand ((SwFrmPage&)rPage).SetFormatUsed(sal_True);
52456b35d86SArmin Le Grand break;
52556b35d86SArmin Le Grand }
52656b35d86SArmin Le Grand
52756b35d86SArmin Le Grand case TP_FRM_ADD:
52856b35d86SArmin Le Grand {
52956b35d86SArmin Le Grand ((SwFrmAddPage&)rPage).SetFormatUsed(sal_True);
53056b35d86SArmin Le Grand ((SwFrmAddPage&)rPage).SetNewFrame(sal_True);
53156b35d86SArmin Le Grand break;
53256b35d86SArmin Le Grand }
53356b35d86SArmin Le Grand
53456b35d86SArmin Le Grand case TP_FRM_WRAP:
53556b35d86SArmin Le Grand {
53656b35d86SArmin Le Grand ((SwWrapTabPage&)rPage).SetFormatUsed(sal_True,sal_False);
53756b35d86SArmin Le Grand break;
53856b35d86SArmin Le Grand }
53956b35d86SArmin Le Grand
54056b35d86SArmin Le Grand case TP_COLUMN:
54156b35d86SArmin Le Grand {
54256b35d86SArmin Le Grand if(nType == SFX_STYLE_FAMILY_FRAME)
54356b35d86SArmin Le Grand ((SwColumnPage&)rPage).SetFrmMode(sal_True);
54456b35d86SArmin Le Grand ((SwColumnPage&)rPage).SetFormatUsed(sal_True);
54556b35d86SArmin Le Grand 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)
55056b35d86SArmin Le Grand case TP_BACKGROUND:
551cdf0e10cSrcweir {
552cdf0e10cSrcweir sal_Int32 nFlagType = 0;
55356b35d86SArmin Le Grand if(SFX_STYLE_FAMILY_PARA == nType)
554cdf0e10cSrcweir nFlagType |= SVX_SHOW_PARACTL;
55556b35d86SArmin Le Grand if(SFX_STYLE_FAMILY_CHAR != nType)
556cdf0e10cSrcweir nFlagType |= SVX_SHOW_SELECTOR;
55756b35d86SArmin Le Grand if(SFX_STYLE_FAMILY_FRAME == nType)
558cdf0e10cSrcweir nFlagType |= SVX_ENABLE_TRANSPARENCY;
55956b35d86SArmin Le Grand aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,nFlagType));
560cdf0e10cSrcweir rPage.PageCreated(aSet);
56156b35d86SArmin Le Grand break;
562cdf0e10cSrcweir }
563cdf0e10cSrcweir
56456b35d86SArmin Le Grand case TP_CONDCOLL:
56556b35d86SArmin Le Grand {
56656b35d86SArmin Le Grand ((SwCondCollPage&)rPage).SetCollection(
56756b35d86SArmin Le Grand ((SwDocStyleSheet&)GetStyleSheet()).GetCollection(),bNewStyle);
56856b35d86SArmin Le Grand break;
56956b35d86SArmin Le Grand }
57056b35d86SArmin Le Grand
57156b35d86SArmin Le Grand case TP_PAGE_STD:
57256b35d86SArmin Le Grand {
57356b35d86SArmin Le Grand if(0 == (nHtmlMode & HTMLMODE_ON))
57456b35d86SArmin Le Grand {
57556b35d86SArmin Le Grand List aList;
57656b35d86SArmin Le Grand String* pNew = new String;
57756b35d86SArmin Le Grand SwStyleNameMapper::FillUIName(RES_POOLCOLL_TEXT,*pNew);
57856b35d86SArmin Le Grand aList.Insert(pNew,(sal_uLong)0);
57956b35d86SArmin Le Grand
58056b35d86SArmin Le Grand if(pWrtShell)
58156b35d86SArmin Le Grand {
58256b35d86SArmin Le Grand SfxStyleSheetBasePool* pStyleSheetPool = pWrtShell->GetView().GetDocShell()->GetStyleSheetPool();
58356b35d86SArmin Le Grand pStyleSheetPool->SetSearchMask(SFX_STYLE_FAMILY_PARA);
584cdf0e10cSrcweir SfxStyleSheetBase *pFirstStyle = pStyleSheetPool->First();
58556b35d86SArmin Le Grand
586cdf0e10cSrcweir while(pFirstStyle)
58756b35d86SArmin Le Grand {
58856b35d86SArmin Le Grand aList.Insert(new String(pFirstStyle->GetName()), aList.Count());
589cdf0e10cSrcweir pFirstStyle = pStyleSheetPool->Next();
59056b35d86SArmin Le Grand }
59156b35d86SArmin Le Grand }
59256b35d86SArmin Le Grand
59356b35d86SArmin Le Grand //UUUU set DrawingLayer FillStyles active
59456b35d86SArmin Le Grand aSet.Put(SfxBoolItem(SID_DRAWINGLAYER_FILLSTYLES, true));
59556b35d86SArmin Le Grand aSet.Put(SfxStringListItem(SID_COLLECT_LIST, &aList));
596cdf0e10cSrcweir rPage.PageCreated(aSet);
597cdf0e10cSrcweir
59856b35d86SArmin Le Grand for(sal_uInt16 i = (sal_uInt16)aList.Count(); i; --i)
59956b35d86SArmin Le Grand {
60056b35d86SArmin Le Grand delete (String*)aList.Remove(i);
60156b35d86SArmin Le Grand }
60256b35d86SArmin Le Grand }
603cdf0e10cSrcweir
60456b35d86SArmin Le Grand break;
60556b35d86SArmin Le Grand }
60656b35d86SArmin Le Grand
60756b35d86SArmin Le Grand case TP_MACRO_ASSIGN:
60856b35d86SArmin Le Grand {
60956b35d86SArmin Le Grand SfxAllItemSet aNewSet(*aSet.GetPool());
61056b35d86SArmin Le Grand aNewSet.Put(SwMacroAssignDlg::AddEvents(MACASSGN_ALLFRM));
61156b35d86SArmin Le Grand if(pWrtShell)
61256b35d86SArmin Le Grand rPage.SetFrame(pWrtShell->GetView().GetViewFrame()->GetFrame().GetFrameInterface());
61356b35d86SArmin Le Grand rPage.PageCreated(aNewSet);
61456b35d86SArmin Le Grand break;
61556b35d86SArmin Le Grand }
61656b35d86SArmin Le Grand
61756b35d86SArmin Le Grand case RID_SVXPAGE_PICK_NUM:
61856b35d86SArmin Le Grand {
619cdf0e10cSrcweir aSet.Put (SfxStringItem(SID_NUM_CHAR_FMT,sNumCharFmt));
620cdf0e10cSrcweir aSet.Put (SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt));
621cdf0e10cSrcweir rPage.PageCreated(aSet);
62256b35d86SArmin Le Grand break;
62356b35d86SArmin Le Grand }
624cdf0e10cSrcweir
62556b35d86SArmin Le Grand case RID_SVXPAGE_NUM_OPTIONS:
62656b35d86SArmin Le Grand {
62756b35d86SArmin Le Grand aSet.Put(SfxStringItem(SID_NUM_CHAR_FMT,sNumCharFmt));
62856b35d86SArmin Le Grand aSet.Put(SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt));
62956b35d86SArmin Le Grand // Zeichenvorlagen sammeln
630cdf0e10cSrcweir ListBox rCharFmtLB(this);
63156b35d86SArmin Le Grand rCharFmtLB.Clear();
63256b35d86SArmin Le Grand rCharFmtLB.InsertEntry(ViewShell::GetShellRes()->aStrNone);
63356b35d86SArmin Le Grand SwDocShell* pDocShell = ::GetActiveWrtShell()->GetView().GetDocShell();
63456b35d86SArmin Le Grand ::FillCharStyleListBox(rCharFmtLB,pDocShell);
63556b35d86SArmin Le Grand List aList;
636cdf0e10cSrcweir for(sal_uInt16 j = 0; j < rCharFmtLB.GetEntryCount(); j++)
63756b35d86SArmin Le Grand {
638cdf0e10cSrcweir
63956b35d86SArmin Le Grand aList.Insert(new XubString(rCharFmtLB.GetEntry(j)),LIST_APPEND);
64056b35d86SArmin Le Grand }
64156b35d86SArmin Le Grand aSet.Put(SfxStringListItem(SID_CHAR_FMT_LIST_BOX,&aList));
64256b35d86SArmin Le Grand FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebDocShell,pDocShell));
64356b35d86SArmin Le Grand aSet.Put(SfxAllEnumItem(SID_METRIC_ITEM,static_cast<sal_uInt16>(eMetric)));
644cdf0e10cSrcweir rPage.PageCreated(aSet);
64556b35d86SArmin Le Grand for(sal_uInt16 i = (sal_uInt16)aList.Count(); i; --i)
64656b35d86SArmin Le Grand delete (XubString*)aList.Remove(i);
64756b35d86SArmin Le Grand aList.Clear();
64856b35d86SArmin Le Grand break;
64956b35d86SArmin Le Grand }
65056b35d86SArmin Le Grand
65156b35d86SArmin Le Grand case RID_SVXPAGE_NUM_POSITION:
65256b35d86SArmin Le Grand {
65356b35d86SArmin Le Grand SwDocShell* pDocShell = ::GetActiveWrtShell()->GetView().GetDocShell();
65456b35d86SArmin Le Grand FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebDocShell,pDocShell));
655cdf0e10cSrcweir
65656b35d86SArmin Le Grand aSet.Put(SfxAllEnumItem(SID_METRIC_ITEM,static_cast<sal_uInt16>(eMetric)));
657cdf0e10cSrcweir rPage.PageCreated(aSet);
65856b35d86SArmin Le Grand break;
65956b35d86SArmin Le Grand }
66056b35d86SArmin Le Grand
66156b35d86SArmin Le Grand case RID_SVXPAGE_PICK_BULLET:
66256b35d86SArmin Le Grand {
66356b35d86SArmin Le Grand aSet.Put(SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt));
66456b35d86SArmin Le Grand rPage.PageCreated(aSet);
66556b35d86SArmin Le Grand break;
66656b35d86SArmin Le Grand }
66756b35d86SArmin Le Grand
668cdf0e10cSrcweir case TP_HEADER_PAGE:
66956b35d86SArmin Le Grand {
67056b35d86SArmin Le Grand 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
67956b35d86SArmin Le Grand break;
68056b35d86SArmin Le Grand }
68156b35d86SArmin Le Grand
682cdf0e10cSrcweir case TP_FOOTER_PAGE:
68356b35d86SArmin Le Grand {
68456b35d86SArmin Le Grand if(0 == (nHtmlMode & HTMLMODE_ON))
68556b35d86SArmin Le Grand {
68656b35d86SArmin Le Grand static_cast< SvxFooterPage& >(rPage).EnableDynamicSpacing();
68756b35d86SArmin Le Grand }
688cdf0e10cSrcweir
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
69356b35d86SArmin Le Grand break;
69456b35d86SArmin Le Grand }
69556b35d86SArmin Le Grand
69656b35d86SArmin Le Grand case TP_BORDER:
69756b35d86SArmin Le Grand {
69856b35d86SArmin Le Grand if(SFX_STYLE_FAMILY_PARA == nType)
69956b35d86SArmin Le Grand {
70056b35d86SArmin Le Grand aSet.Put(SfxUInt16Item(SID_SWMODE_TYPE,SW_BORDER_MODE_PARA));
70156b35d86SArmin Le Grand }
70256b35d86SArmin Le Grand else if(SFX_STYLE_FAMILY_FRAME == nType)
70356b35d86SArmin Le Grand {
70456b35d86SArmin Le Grand aSet.Put(SfxUInt16Item(SID_SWMODE_TYPE,SW_BORDER_MODE_FRAME));
70556b35d86SArmin Le Grand }
70656b35d86SArmin Le Grand rPage.PageCreated(aSet);
70756b35d86SArmin Le Grand 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);
72456b35d86SArmin Le Grand break;
72564b14621SArmin Le Grand }
72664b14621SArmin Le Grand
72764b14621SArmin Le Grand case RID_SVXPAGE_TRANSPARENCE:
72864b14621SArmin Le Grand {
72964b14621SArmin Le Grand rPage.PageCreated(GetStyleSheet().GetItemSet());
73056b35d86SArmin Le Grand break;
73164b14621SArmin Le Grand }
732cdf0e10cSrcweir }
733cdf0e10cSrcweir }
734cdf0e10cSrcweir
735b164f441SArmin Le Grand // eof
736