xref: /trunk/main/sw/source/ui/app/appopt.cxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_sw.hxx"
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #define _SVSTDARR_STRINGSDTOR
32*cdf0e10cSrcweir #include <svl/svstdarr.hxx>
33*cdf0e10cSrcweir 
34*cdf0e10cSrcweir #include <com/sun/star/i18n/ScriptType.hpp>
35*cdf0e10cSrcweir 
36*cdf0e10cSrcweir #include <hintids.hxx>
37*cdf0e10cSrcweir #include <cmdid.h>          // Funktion-Ids
38*cdf0e10cSrcweir #include <vcl/msgbox.hxx>
39*cdf0e10cSrcweir #include <svl/eitem.hxx>
40*cdf0e10cSrcweir #include <sfx2/request.hxx>
41*cdf0e10cSrcweir #include <sfx2/app.hxx>
42*cdf0e10cSrcweir #include <sfx2/printer.hxx>
43*cdf0e10cSrcweir #include <svx/htmlmode.hxx>
44*cdf0e10cSrcweir #include <sfx2/bindings.hxx>
45*cdf0e10cSrcweir #include <editeng/brshitem.hxx>
46*cdf0e10cSrcweir #include <editeng/tstpitem.hxx>
47*cdf0e10cSrcweir #include <svx/optgrid.hxx>
48*cdf0e10cSrcweir #include <svx/svxdlg.hxx>
49*cdf0e10cSrcweir #include <svx/dialogs.hrc>
50*cdf0e10cSrcweir #include <i18npool/mslangid.hxx>
51*cdf0e10cSrcweir #include <fontcfg.hxx>
52*cdf0e10cSrcweir #include <optload.hxx>
53*cdf0e10cSrcweir #include <optcomp.hxx>
54*cdf0e10cSrcweir #include <edtwin.hxx>
55*cdf0e10cSrcweir #include <swmodule.hxx>
56*cdf0e10cSrcweir #include <view.hxx>
57*cdf0e10cSrcweir #include <doc.hxx>
58*cdf0e10cSrcweir #include <wrtsh.hxx>
59*cdf0e10cSrcweir #include <IDocumentDeviceAccess.hxx>
60*cdf0e10cSrcweir #include <uitool.hxx>
61*cdf0e10cSrcweir #include <initui.hxx>                   // fuer ::GetGlossaries()
62*cdf0e10cSrcweir #include <fldbas.hxx>      //fuer UpdateFields
63*cdf0e10cSrcweir #include <wview.hxx>
64*cdf0e10cSrcweir #include <cfgitems.hxx>
65*cdf0e10cSrcweir #include <prtopt.hxx>
66*cdf0e10cSrcweir #include <pview.hxx>
67*cdf0e10cSrcweir #include <usrpref.hxx>
68*cdf0e10cSrcweir #include <modcfg.hxx>
69*cdf0e10cSrcweir #include <glosdoc.hxx>
70*cdf0e10cSrcweir #include <uiitems.hxx>
71*cdf0e10cSrcweir #include <editeng/langitem.hxx>
72*cdf0e10cSrcweir #include <unotools/lingucfg.hxx>
73*cdf0e10cSrcweir #include <editeng/unolingu.hxx>
74*cdf0e10cSrcweir #include <globals.hrc>
75*cdf0e10cSrcweir #include <globals.h>        // globale Konstanten z.B.
76*cdf0e10cSrcweir #include <svl/slstitm.hxx>
77*cdf0e10cSrcweir #include "swabstdlg.hxx"
78*cdf0e10cSrcweir #include <swwrtshitem.hxx>
79*cdf0e10cSrcweir 
80*cdf0e10cSrcweir #include <unomid.h>
81*cdf0e10cSrcweir 
82*cdf0e10cSrcweir using namespace ::com::sun::star::uno;
83*cdf0e10cSrcweir using namespace ::com::sun::star::lang;
84*cdf0e10cSrcweir 
85*cdf0e10cSrcweir /* -----------------12.02.99 12:28-------------------
86*cdf0e10cSrcweir  *
87*cdf0e10cSrcweir  * --------------------------------------------------*/
88*cdf0e10cSrcweir 
89*cdf0e10cSrcweir SfxItemSet*  SwModule::CreateItemSet( sal_uInt16 nId )
90*cdf0e10cSrcweir {
91*cdf0e10cSrcweir     sal_Bool bTextDialog = (nId == SID_SW_EDITOPTIONS) ? sal_True : sal_False;
92*cdf0e10cSrcweir 
93*cdf0e10cSrcweir     // hier werden die Optionen fuer die Web- und den Textdialog zusmmengesetzt
94*cdf0e10cSrcweir         SwViewOption aViewOpt = *GetUsrPref(!bTextDialog);
95*cdf0e10cSrcweir         SwMasterUsrPref* pPref = bTextDialog ? pUsrPref : pWebUsrPref;
96*cdf0e10cSrcweir         //kein MakeUsrPref, da hier nur die Optionen von Textdoks genommen werden duerfen
97*cdf0e10cSrcweir         SwView* pAppView = GetView();
98*cdf0e10cSrcweir         if(pAppView && pAppView->GetViewFrame() != SfxViewFrame::Current())
99*cdf0e10cSrcweir             pAppView = 0;
100*cdf0e10cSrcweir         if(pAppView)
101*cdf0e10cSrcweir         {
102*cdf0e10cSrcweir         // wenn Text dann nicht WebView und umgekehrt
103*cdf0e10cSrcweir             sal_Bool bWebView = 0 != PTR_CAST(SwWebView, pAppView);
104*cdf0e10cSrcweir             if( (bWebView &&  !bTextDialog) ||(!bWebView &&  bTextDialog))
105*cdf0e10cSrcweir             {
106*cdf0e10cSrcweir                 aViewOpt = *pAppView->GetWrtShell().GetViewOptions();
107*cdf0e10cSrcweir             }
108*cdf0e10cSrcweir             else
109*cdf0e10cSrcweir                 pAppView = 0; // mit View kann hier nichts gewonnen werden
110*cdf0e10cSrcweir         }
111*cdf0e10cSrcweir 
112*cdf0e10cSrcweir     /********************************************************************/
113*cdf0e10cSrcweir     /*                                                                  */
114*cdf0e10cSrcweir     /* Optionen/Bearbeiten                                              */
115*cdf0e10cSrcweir     /*                                                                  */
116*cdf0e10cSrcweir     /********************************************************************/
117*cdf0e10cSrcweir     SfxItemSet* pRet = new SfxItemSet (GetPool(),   FN_PARAM_DOCDISP,       FN_PARAM_ELEM,
118*cdf0e10cSrcweir                                     SID_PRINTPREVIEW,       SID_PRINTPREVIEW,
119*cdf0e10cSrcweir                                     SID_ATTR_GRID_OPTIONS,  SID_ATTR_GRID_OPTIONS,
120*cdf0e10cSrcweir                                     FN_PARAM_PRINTER,       FN_PARAM_STDFONTS,
121*cdf0e10cSrcweir                                     FN_PARAM_WRTSHELL,      FN_PARAM_WRTSHELL,
122*cdf0e10cSrcweir                                     FN_PARAM_ADDPRINTER,    FN_PARAM_ADDPRINTER,
123*cdf0e10cSrcweir                                     SID_ATTR_METRIC,        SID_ATTR_METRIC,
124*cdf0e10cSrcweir                                     SID_ATTR_DEFTABSTOP,    SID_ATTR_DEFTABSTOP,
125*cdf0e10cSrcweir                                     RES_BACKGROUND,         RES_BACKGROUND,
126*cdf0e10cSrcweir                                     SID_HTML_MODE,          SID_HTML_MODE,
127*cdf0e10cSrcweir                                     FN_PARAM_SHADOWCURSOR,  FN_PARAM_SHADOWCURSOR,
128*cdf0e10cSrcweir                                     FN_PARAM_CRSR_IN_PROTECTED, FN_PARAM_CRSR_IN_PROTECTED,
129*cdf0e10cSrcweir                                     FN_HSCROLL_METRIC,      FN_VSCROLL_METRIC,
130*cdf0e10cSrcweir                                     SID_ATTR_LANGUAGE,      SID_ATTR_LANGUAGE,
131*cdf0e10cSrcweir                                     SID_ATTR_CHAR_CJK_LANGUAGE,   SID_ATTR_CHAR_CJK_LANGUAGE,
132*cdf0e10cSrcweir                                     SID_ATTR_CHAR_CTL_LANGUAGE, SID_ATTR_CHAR_CTL_LANGUAGE,
133*cdf0e10cSrcweir #ifdef DBG_UTIL
134*cdf0e10cSrcweir                                     FN_PARAM_SWTEST,        FN_PARAM_SWTEST,
135*cdf0e10cSrcweir #endif
136*cdf0e10cSrcweir                                     0);
137*cdf0e10cSrcweir 
138*cdf0e10cSrcweir     pRet->Put( SwDocDisplayItem( aViewOpt, FN_PARAM_DOCDISP) );
139*cdf0e10cSrcweir     pRet->Put( SwElemItem( aViewOpt, FN_PARAM_ELEM) );
140*cdf0e10cSrcweir     if( bTextDialog )
141*cdf0e10cSrcweir     {
142*cdf0e10cSrcweir         pRet->Put( SwShadowCursorItem( aViewOpt, FN_PARAM_SHADOWCURSOR ));
143*cdf0e10cSrcweir         pRet->Put( SfxBoolItem(FN_PARAM_CRSR_IN_PROTECTED, aViewOpt.IsCursorInProtectedArea()));
144*cdf0e10cSrcweir     }
145*cdf0e10cSrcweir 
146*cdf0e10cSrcweir     if( pAppView )
147*cdf0e10cSrcweir     {
148*cdf0e10cSrcweir         SwWrtShell& rWrtShell = pAppView->GetWrtShell();
149*cdf0e10cSrcweir 
150*cdf0e10cSrcweir         SfxPrinter* pPrt = rWrtShell.getIDocumentDeviceAccess()->getPrinter( false );
151*cdf0e10cSrcweir         if( pPrt )
152*cdf0e10cSrcweir             pRet->Put(SwPtrItem(FN_PARAM_PRINTER, pPrt));
153*cdf0e10cSrcweir         pRet->Put(SwPtrItem(FN_PARAM_WRTSHELL, &rWrtShell));
154*cdf0e10cSrcweir 
155*cdf0e10cSrcweir         pRet->Put((const SvxLanguageItem&)
156*cdf0e10cSrcweir             rWrtShell.GetDefault(RES_CHRATR_LANGUAGE), SID_ATTR_LANGUAGE);
157*cdf0e10cSrcweir 
158*cdf0e10cSrcweir         pRet->Put((const SvxLanguageItem&)
159*cdf0e10cSrcweir             rWrtShell.GetDefault(RES_CHRATR_CJK_LANGUAGE), SID_ATTR_CHAR_CJK_LANGUAGE);
160*cdf0e10cSrcweir 
161*cdf0e10cSrcweir         pRet->Put((const SvxLanguageItem&)
162*cdf0e10cSrcweir             rWrtShell.GetDefault(RES_CHRATR_CTL_LANGUAGE), SID_ATTR_CHAR_CTL_LANGUAGE);
163*cdf0e10cSrcweir     }
164*cdf0e10cSrcweir     else
165*cdf0e10cSrcweir     {
166*cdf0e10cSrcweir /*      Der Drucker wird jetzt von der TabPage erzeugt und auch geloescht
167*cdf0e10cSrcweir  *      SfxItemSet* pSet = new SfxItemSet( SFX_APP()->GetPool(),
168*cdf0e10cSrcweir                     SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
169*cdf0e10cSrcweir                     SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC,
170*cdf0e10cSrcweir                     0 );
171*cdf0e10cSrcweir 
172*cdf0e10cSrcweir         pPrt = new SfxPrinter(pSet);
173*cdf0e10cSrcweir         pRet->Put(SwPtrItem(FN_PARAM_PRINTER, pPrt));*/
174*cdf0e10cSrcweir 
175*cdf0e10cSrcweir         SvtLinguConfig aLinguCfg;
176*cdf0e10cSrcweir         Locale aLocale;
177*cdf0e10cSrcweir         LanguageType nLang;
178*cdf0e10cSrcweir 
179*cdf0e10cSrcweir         using namespace ::com::sun::star::i18n::ScriptType;
180*cdf0e10cSrcweir 
181*cdf0e10cSrcweir         Any aLang = aLinguCfg.GetProperty(C2U("DefaultLocale"));
182*cdf0e10cSrcweir         aLang >>= aLocale;
183*cdf0e10cSrcweir         nLang = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage(aLocale), LATIN);
184*cdf0e10cSrcweir         pRet->Put(SvxLanguageItem(nLang, SID_ATTR_LANGUAGE));
185*cdf0e10cSrcweir 
186*cdf0e10cSrcweir         aLang = aLinguCfg.GetProperty(C2U("DefaultLocale_CJK"));
187*cdf0e10cSrcweir         aLang >>= aLocale;
188*cdf0e10cSrcweir         nLang = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage(aLocale), ASIAN);
189*cdf0e10cSrcweir         pRet->Put(SvxLanguageItem(nLang, SID_ATTR_CHAR_CJK_LANGUAGE));
190*cdf0e10cSrcweir 
191*cdf0e10cSrcweir         aLang = aLinguCfg.GetProperty(C2U("DefaultLocale_CTL"));
192*cdf0e10cSrcweir         aLang >>= aLocale;
193*cdf0e10cSrcweir         nLang = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage(aLocale), COMPLEX);
194*cdf0e10cSrcweir         pRet->Put(SvxLanguageItem(nLang, SID_ATTR_CHAR_CTL_LANGUAGE));
195*cdf0e10cSrcweir     }
196*cdf0e10cSrcweir     if(bTextDialog)
197*cdf0e10cSrcweir         pRet->Put(SwPtrItem(FN_PARAM_STDFONTS, GetStdFontConfig()));
198*cdf0e10cSrcweir     if( PTR_CAST( SwPagePreView, SfxViewShell::Current())!=0)
199*cdf0e10cSrcweir     {
200*cdf0e10cSrcweir         SfxBoolItem aBool(SfxBoolItem(SID_PRINTPREVIEW, sal_True));
201*cdf0e10cSrcweir         pRet->Put(aBool);
202*cdf0e10cSrcweir     }
203*cdf0e10cSrcweir 
204*cdf0e10cSrcweir     FieldUnit eUnit = pPref->GetHScrollMetric();
205*cdf0e10cSrcweir     if(pAppView)
206*cdf0e10cSrcweir         pAppView->GetHLinealMetric(eUnit);
207*cdf0e10cSrcweir     pRet->Put(SfxUInt16Item( FN_HSCROLL_METRIC, static_cast< sal_uInt16 >(eUnit)));
208*cdf0e10cSrcweir 
209*cdf0e10cSrcweir     eUnit = pPref->GetVScrollMetric();
210*cdf0e10cSrcweir     if(pAppView)
211*cdf0e10cSrcweir         pAppView->GetVLinealMetric(eUnit);
212*cdf0e10cSrcweir     pRet->Put(SfxUInt16Item( FN_VSCROLL_METRIC, static_cast< sal_uInt16 >(eUnit) ));
213*cdf0e10cSrcweir     pRet->Put(SfxUInt16Item( SID_ATTR_METRIC, static_cast< sal_uInt16 >(pPref->GetMetric()) ));
214*cdf0e10cSrcweir     if(bTextDialog)
215*cdf0e10cSrcweir     {
216*cdf0e10cSrcweir         if(pAppView)
217*cdf0e10cSrcweir         {
218*cdf0e10cSrcweir             const SvxTabStopItem& rDefTabs =
219*cdf0e10cSrcweir                     (const SvxTabStopItem&)pAppView->GetWrtShell().
220*cdf0e10cSrcweir                                         GetDefault(RES_PARATR_TABSTOP);
221*cdf0e10cSrcweir                 pRet->Put( SfxUInt16Item( SID_ATTR_DEFTABSTOP, (sal_uInt16)::GetTabDist(rDefTabs)));
222*cdf0e10cSrcweir         }
223*cdf0e10cSrcweir         else
224*cdf0e10cSrcweir             pRet->Put(SfxUInt16Item( SID_ATTR_DEFTABSTOP, (sal_uInt16)pPref->GetDefTab()));
225*cdf0e10cSrcweir     }
226*cdf0e10cSrcweir 
227*cdf0e10cSrcweir     /*-----------------01.02.97 11.13-------------------
228*cdf0e10cSrcweir     Optionen fuer GridTabPage
229*cdf0e10cSrcweir     --------------------------------------------------*/
230*cdf0e10cSrcweir 
231*cdf0e10cSrcweir     SvxGridItem aGridItem( SID_ATTR_GRID_OPTIONS);
232*cdf0e10cSrcweir 
233*cdf0e10cSrcweir     aGridItem.SetUseGridSnap( aViewOpt.IsSnap());
234*cdf0e10cSrcweir     aGridItem.SetSynchronize( aViewOpt.IsSynchronize());
235*cdf0e10cSrcweir     aGridItem.SetGridVisible( aViewOpt.IsGridVisible());
236*cdf0e10cSrcweir 
237*cdf0e10cSrcweir     const Size& rSnapSize = aViewOpt.GetSnapSize();
238*cdf0e10cSrcweir     aGridItem.SetFldDrawX( (sal_uInt16) (rSnapSize.Width() ));
239*cdf0e10cSrcweir     aGridItem.SetFldDrawY( (sal_uInt16) (rSnapSize.Height()));
240*cdf0e10cSrcweir 
241*cdf0e10cSrcweir     aGridItem.SetFldDivisionX( aViewOpt.GetDivisionX());
242*cdf0e10cSrcweir     aGridItem.SetFldDivisionY( aViewOpt.GetDivisionY());
243*cdf0e10cSrcweir 
244*cdf0e10cSrcweir     pRet->Put(aGridItem);
245*cdf0e10cSrcweir 
246*cdf0e10cSrcweir     /*-----------------01.02.97 13.02-------------------
247*cdf0e10cSrcweir         Optionen fuer PrintTabPage
248*cdf0e10cSrcweir     --------------------------------------------------*/
249*cdf0e10cSrcweir     const SwPrintData* pOpt = pAppView ?
250*cdf0e10cSrcweir                         &pAppView->GetWrtShell().getIDocumentDeviceAccess()->getPrintData() :
251*cdf0e10cSrcweir                         0;
252*cdf0e10cSrcweir 
253*cdf0e10cSrcweir     if(!pOpt)
254*cdf0e10cSrcweir         pOpt = GetPrtOptions(!bTextDialog);
255*cdf0e10cSrcweir 
256*cdf0e10cSrcweir     SwAddPrinterItem aAddPrinterItem (FN_PARAM_ADDPRINTER, *pOpt );
257*cdf0e10cSrcweir     pRet->Put(aAddPrinterItem);
258*cdf0e10cSrcweir 
259*cdf0e10cSrcweir     /*-----------------01.02.97 13.12-------------------
260*cdf0e10cSrcweir         Optionen fuer Web-Hintergrund
261*cdf0e10cSrcweir     --------------------------------------------------*/
262*cdf0e10cSrcweir     if(!bTextDialog)
263*cdf0e10cSrcweir     {
264*cdf0e10cSrcweir         pRet->Put(SvxBrushItem(aViewOpt.GetRetoucheColor(), RES_BACKGROUND));
265*cdf0e10cSrcweir     }
266*cdf0e10cSrcweir 
267*cdf0e10cSrcweir #ifdef DBG_UTIL
268*cdf0e10cSrcweir     /*-----------------01.02.97 13.02-------------------
269*cdf0e10cSrcweir         Test-Optionen
270*cdf0e10cSrcweir     --------------------------------------------------*/
271*cdf0e10cSrcweir         SwTestItem aTestItem(FN_PARAM_SWTEST);
272*cdf0e10cSrcweir         aTestItem.bTest1 = aViewOpt.IsTest1();
273*cdf0e10cSrcweir         aTestItem.bTest2 = aViewOpt.IsTest2();
274*cdf0e10cSrcweir         aTestItem.bTest3 = aViewOpt.IsTest3();
275*cdf0e10cSrcweir         aTestItem.bTest4 =  aViewOpt.IsTest4();
276*cdf0e10cSrcweir         aTestItem.bTest5 = aViewOpt.IsTest5();
277*cdf0e10cSrcweir         aTestItem.bTest6 = aViewOpt.IsTest6();
278*cdf0e10cSrcweir         aTestItem.bTest7 = aViewOpt.IsTest7();
279*cdf0e10cSrcweir         aTestItem.bTest8 = aViewOpt.IsTest8();
280*cdf0e10cSrcweir         aTestItem.bTest9 = SwViewOption::IsTest9();
281*cdf0e10cSrcweir         aTestItem.bTest10 = aViewOpt.IsTest10();
282*cdf0e10cSrcweir         pRet->Put(aTestItem);
283*cdf0e10cSrcweir #endif
284*cdf0e10cSrcweir     /*-----------------01.02.97 13.04-------------------
285*cdf0e10cSrcweir 
286*cdf0e10cSrcweir     --------------------------------------------------*/
287*cdf0e10cSrcweir     if(!bTextDialog)
288*cdf0e10cSrcweir         pRet->Put(SfxUInt16Item(SID_HTML_MODE, HTMLMODE_ON));
289*cdf0e10cSrcweir //  delete pPrt;
290*cdf0e10cSrcweir     return pRet;
291*cdf0e10cSrcweir }
292*cdf0e10cSrcweir /* -----------------12.02.99 12:28-------------------
293*cdf0e10cSrcweir  *
294*cdf0e10cSrcweir  * --------------------------------------------------*/
295*cdf0e10cSrcweir void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet )
296*cdf0e10cSrcweir {
297*cdf0e10cSrcweir     sal_Bool bTextDialog = nId == SID_SW_EDITOPTIONS;
298*cdf0e10cSrcweir     SwView* pAppView = GetView();
299*cdf0e10cSrcweir     if(pAppView && pAppView->GetViewFrame() != SfxViewFrame::Current())
300*cdf0e10cSrcweir         pAppView = 0;
301*cdf0e10cSrcweir     if(pAppView)
302*cdf0e10cSrcweir     {
303*cdf0e10cSrcweir         // the text dialog mustn't apply data to the web view and vice versa
304*cdf0e10cSrcweir         sal_Bool bWebView = 0 != PTR_CAST(SwWebView, pAppView);
305*cdf0e10cSrcweir         if( (bWebView == bTextDialog))
306*cdf0e10cSrcweir             pAppView = 0; //
307*cdf0e10cSrcweir     }
308*cdf0e10cSrcweir 
309*cdf0e10cSrcweir     SwViewOption aViewOpt = *GetUsrPref(!bTextDialog);
310*cdf0e10cSrcweir     SwMasterUsrPref* pPref = bTextDialog ? pUsrPref : pWebUsrPref;
311*cdf0e10cSrcweir 
312*cdf0e10cSrcweir     const SfxPoolItem* pItem;
313*cdf0e10cSrcweir     SfxBindings *pBindings = pAppView ? &pAppView->GetViewFrame()->GetBindings()
314*cdf0e10cSrcweir                                  : NULL;
315*cdf0e10cSrcweir 
316*cdf0e10cSrcweir     /*---------------------------------------------------------------------
317*cdf0e10cSrcweir             Seite Dokumentansicht auswerten
318*cdf0e10cSrcweir     -----------------------------------------------------------------------*/
319*cdf0e10cSrcweir     if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_DOCDISP, sal_False, &pItem ))
320*cdf0e10cSrcweir     {
321*cdf0e10cSrcweir         const SwDocDisplayItem* pDocDispItem = (const SwDocDisplayItem*)pItem;
322*cdf0e10cSrcweir 
323*cdf0e10cSrcweir         if(!aViewOpt.IsViewMetaChars())
324*cdf0e10cSrcweir         {
325*cdf0e10cSrcweir             if(     (!aViewOpt.IsTab( sal_True ) &&  pDocDispItem->bTab) ||
326*cdf0e10cSrcweir                     (!aViewOpt.IsBlank( sal_True ) && pDocDispItem->bSpace) ||
327*cdf0e10cSrcweir                     (!aViewOpt.IsParagraph( sal_True ) && pDocDispItem->bParagraphEnd) ||
328*cdf0e10cSrcweir                     (!aViewOpt.IsLineBreak( sal_True ) && pDocDispItem->bManualBreak) )
329*cdf0e10cSrcweir             {
330*cdf0e10cSrcweir                 aViewOpt.SetViewMetaChars(sal_True);
331*cdf0e10cSrcweir                 if(pBindings)
332*cdf0e10cSrcweir                     pBindings->Invalidate(FN_VIEW_META_CHARS);
333*cdf0e10cSrcweir             }
334*cdf0e10cSrcweir 
335*cdf0e10cSrcweir         }
336*cdf0e10cSrcweir         pDocDispItem->FillViewOptions( aViewOpt );
337*cdf0e10cSrcweir         if(pBindings)
338*cdf0e10cSrcweir         {
339*cdf0e10cSrcweir             pBindings->Invalidate(FN_VIEW_GRAPHIC);
340*cdf0e10cSrcweir             pBindings->Invalidate(FN_VIEW_HIDDEN_PARA);
341*cdf0e10cSrcweir         }
342*cdf0e10cSrcweir     }
343*cdf0e10cSrcweir 
344*cdf0e10cSrcweir     /*---------------------------------------------------------------------
345*cdf0e10cSrcweir                 Elemente - Item auswerten
346*cdf0e10cSrcweir     -----------------------------------------------------------------------*/
347*cdf0e10cSrcweir 
348*cdf0e10cSrcweir     if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_ELEM, sal_False, &pItem ) )
349*cdf0e10cSrcweir     {
350*cdf0e10cSrcweir         const SwElemItem* pElemItem = (const SwElemItem*)pItem;
351*cdf0e10cSrcweir         pElemItem->FillViewOptions( aViewOpt );
352*cdf0e10cSrcweir 
353*cdf0e10cSrcweir     }
354*cdf0e10cSrcweir 
355*cdf0e10cSrcweir     if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_METRIC, sal_False, &pItem ) )
356*cdf0e10cSrcweir     {
357*cdf0e10cSrcweir         SFX_APP()->SetOptions(rSet);
358*cdf0e10cSrcweir         const SfxUInt16Item* pMetricItem = (const SfxUInt16Item*)pItem;
359*cdf0e10cSrcweir         ::SetDfltMetric((FieldUnit)pMetricItem->GetValue(), !bTextDialog);
360*cdf0e10cSrcweir     }
361*cdf0e10cSrcweir     if( SFX_ITEM_SET == rSet.GetItemState(FN_HSCROLL_METRIC, sal_False, &pItem ) )
362*cdf0e10cSrcweir     {
363*cdf0e10cSrcweir         const SfxUInt16Item* pMetricItem = (const SfxUInt16Item*)pItem;
364*cdf0e10cSrcweir         FieldUnit eUnit = (FieldUnit)pMetricItem->GetValue();
365*cdf0e10cSrcweir         pPref->SetHScrollMetric(eUnit);
366*cdf0e10cSrcweir         if(pAppView)
367*cdf0e10cSrcweir             pAppView->ChangeTabMetric(eUnit);
368*cdf0e10cSrcweir     }
369*cdf0e10cSrcweir 
370*cdf0e10cSrcweir     if( SFX_ITEM_SET == rSet.GetItemState(FN_VSCROLL_METRIC, sal_False, &pItem ) )
371*cdf0e10cSrcweir     {
372*cdf0e10cSrcweir         const SfxUInt16Item* pMetricItem = (const SfxUInt16Item*)pItem;
373*cdf0e10cSrcweir         FieldUnit eUnit = (FieldUnit)pMetricItem->GetValue();
374*cdf0e10cSrcweir         pPref->SetVScrollMetric(eUnit);
375*cdf0e10cSrcweir         if(pAppView)
376*cdf0e10cSrcweir             pAppView->ChangeVLinealMetric(eUnit);
377*cdf0e10cSrcweir     }
378*cdf0e10cSrcweir 
379*cdf0e10cSrcweir     if( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_DEFTABSTOP, sal_False, &pItem ) )
380*cdf0e10cSrcweir     {
381*cdf0e10cSrcweir         sal_uInt16 nTabDist = ((const SfxUInt16Item*)pItem)->GetValue();
382*cdf0e10cSrcweir         pPref->SetDefTab(nTabDist);
383*cdf0e10cSrcweir         if(pAppView)
384*cdf0e10cSrcweir         {
385*cdf0e10cSrcweir             SvxTabStopItem aDefTabs( 0, 0, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP );
386*cdf0e10cSrcweir             MakeDefTabs( nTabDist, aDefTabs );
387*cdf0e10cSrcweir             pAppView->GetWrtShell().SetDefault( aDefTabs );
388*cdf0e10cSrcweir         }
389*cdf0e10cSrcweir     }
390*cdf0e10cSrcweir 
391*cdf0e10cSrcweir 
392*cdf0e10cSrcweir     /*-----------------01.02.97 11.36-------------------
393*cdf0e10cSrcweir         Hintergrund nur im WebDialog
394*cdf0e10cSrcweir     --------------------------------------------------*/
395*cdf0e10cSrcweir     if(SFX_ITEM_SET == rSet.GetItemState(RES_BACKGROUND))
396*cdf0e10cSrcweir     {
397*cdf0e10cSrcweir         const SvxBrushItem& rBrushItem = (const SvxBrushItem&)rSet.Get(
398*cdf0e10cSrcweir                                 RES_BACKGROUND);
399*cdf0e10cSrcweir         aViewOpt.SetRetoucheColor( rBrushItem.GetColor() );
400*cdf0e10cSrcweir     }
401*cdf0e10cSrcweir 
402*cdf0e10cSrcweir     /*--------------------------------------------------------------------
403*cdf0e10cSrcweir             Seite Rastereinstellungen auswerten
404*cdf0e10cSrcweir     ----------------------------------------------------------------------*/
405*cdf0e10cSrcweir 
406*cdf0e10cSrcweir     if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_GRID_OPTIONS, sal_False, &pItem ))
407*cdf0e10cSrcweir     {
408*cdf0e10cSrcweir         const SvxGridItem* pGridItem = (const SvxGridItem*)pItem;
409*cdf0e10cSrcweir 
410*cdf0e10cSrcweir         aViewOpt.SetSnap( pGridItem->GetUseGridSnap() );
411*cdf0e10cSrcweir         aViewOpt.SetSynchronize(pGridItem->GetSynchronize());
412*cdf0e10cSrcweir         if( aViewOpt.IsGridVisible() != pGridItem->GetGridVisible() )
413*cdf0e10cSrcweir             aViewOpt.SetGridVisible( pGridItem->GetGridVisible());
414*cdf0e10cSrcweir         Size aSize = Size( pGridItem->GetFldDrawX()  ,
415*cdf0e10cSrcweir                             pGridItem->GetFldDrawY()  );
416*cdf0e10cSrcweir         if( aViewOpt.GetSnapSize() != aSize )
417*cdf0e10cSrcweir             aViewOpt.SetSnapSize( aSize );
418*cdf0e10cSrcweir         short nDiv = (short)pGridItem->GetFldDivisionX() ;
419*cdf0e10cSrcweir         if( aViewOpt.GetDivisionX() != nDiv  )
420*cdf0e10cSrcweir             aViewOpt.SetDivisionX( nDiv );
421*cdf0e10cSrcweir         nDiv = (short)pGridItem->GetFldDivisionY();
422*cdf0e10cSrcweir         if( aViewOpt.GetDivisionY() != nDiv  )
423*cdf0e10cSrcweir             aViewOpt.SetDivisionY( nDiv  );
424*cdf0e10cSrcweir 
425*cdf0e10cSrcweir         if(pBindings)
426*cdf0e10cSrcweir         {
427*cdf0e10cSrcweir             pBindings->Invalidate(SID_GRID_VISIBLE);
428*cdf0e10cSrcweir             pBindings->Invalidate(SID_GRID_USE);
429*cdf0e10cSrcweir         }
430*cdf0e10cSrcweir     }
431*cdf0e10cSrcweir 
432*cdf0e10cSrcweir     //--------------------------------------------------------------------------
433*cdf0e10cSrcweir     //      Writer Drucker Zusatzeinstellungen auswerten
434*cdf0e10cSrcweir     //----------------------------------------------------------------------------
435*cdf0e10cSrcweir 
436*cdf0e10cSrcweir     if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_ADDPRINTER, sal_False, &pItem ))
437*cdf0e10cSrcweir     {
438*cdf0e10cSrcweir         SwPrintOptions* pOpt = GetPrtOptions(!bTextDialog);
439*cdf0e10cSrcweir         if (pOpt)
440*cdf0e10cSrcweir         {
441*cdf0e10cSrcweir             const SwAddPrinterItem* pAddPrinterAttr = (const SwAddPrinterItem*)pItem;
442*cdf0e10cSrcweir             *pOpt = *pAddPrinterAttr;
443*cdf0e10cSrcweir 
444*cdf0e10cSrcweir             if(pAppView)
445*cdf0e10cSrcweir                 pAppView->GetWrtShell().getIDocumentDeviceAccess()->setPrintData( *pOpt );
446*cdf0e10cSrcweir         }
447*cdf0e10cSrcweir 
448*cdf0e10cSrcweir     }
449*cdf0e10cSrcweir 
450*cdf0e10cSrcweir     if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_SHADOWCURSOR, sal_False, &pItem ))
451*cdf0e10cSrcweir     {
452*cdf0e10cSrcweir         ((SwShadowCursorItem*)pItem)->FillViewOptions( aViewOpt );
453*cdf0e10cSrcweir         if(pBindings)
454*cdf0e10cSrcweir             pBindings->Invalidate(FN_SHADOWCURSOR);
455*cdf0e10cSrcweir     }
456*cdf0e10cSrcweir 
457*cdf0e10cSrcweir     if( pAppView )
458*cdf0e10cSrcweir     {
459*cdf0e10cSrcweir         SwWrtShell &rWrtSh = pAppView->GetWrtShell();
460*cdf0e10cSrcweir         const bool bAlignFormulas = rWrtSh.GetDoc()->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT );
461*cdf0e10cSrcweir         pPref->SetAlignMathObjectsToBaseline( bAlignFormulas );
462*cdf0e10cSrcweir 
463*cdf0e10cSrcweir         // don't align formulas in documents that are currently loading
464*cdf0e10cSrcweir         if (bAlignFormulas && !rWrtSh.GetDoc()->IsInReading())
465*cdf0e10cSrcweir             rWrtSh.AlignAllFormulasToBaseline();
466*cdf0e10cSrcweir     }
467*cdf0e10cSrcweir 
468*cdf0e10cSrcweir     if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_CRSR_IN_PROTECTED, sal_False, &pItem ))
469*cdf0e10cSrcweir     {
470*cdf0e10cSrcweir         aViewOpt.SetCursorInProtectedArea(((const SfxBoolItem*)pItem)->GetValue());
471*cdf0e10cSrcweir     }
472*cdf0e10cSrcweir 
473*cdf0e10cSrcweir 
474*cdf0e10cSrcweir #ifdef DBG_UTIL
475*cdf0e10cSrcweir     /*--------------------------------------------------------------------------
476*cdf0e10cSrcweir                 Writer Testseite auswerten
477*cdf0e10cSrcweir     ----------------------------------------------------------------------------*/
478*cdf0e10cSrcweir 
479*cdf0e10cSrcweir             if( SFX_ITEM_SET == rSet.GetItemState(
480*cdf0e10cSrcweir                         FN_PARAM_SWTEST, sal_False, &pItem ))
481*cdf0e10cSrcweir             {
482*cdf0e10cSrcweir                 const SwTestItem* pTestItem = (const SwTestItem*)pItem;
483*cdf0e10cSrcweir                 aViewOpt.SetTest1((sal_Bool)pTestItem->bTest1);
484*cdf0e10cSrcweir                 aViewOpt.SetTest2((sal_Bool)pTestItem->bTest2);
485*cdf0e10cSrcweir                 aViewOpt.SetTest3((sal_Bool)pTestItem->bTest3);
486*cdf0e10cSrcweir                 aViewOpt.SetTest4((sal_Bool)pTestItem->bTest4);
487*cdf0e10cSrcweir                 aViewOpt.SetTest5((sal_Bool)pTestItem->bTest5);
488*cdf0e10cSrcweir                 aViewOpt.SetTest6((sal_Bool)pTestItem->bTest6);
489*cdf0e10cSrcweir                 aViewOpt.SetTest7((sal_Bool)pTestItem->bTest7);
490*cdf0e10cSrcweir                 aViewOpt.SetTest8((sal_Bool)pTestItem->bTest8);
491*cdf0e10cSrcweir                 SwViewOption::SetTest9((sal_Bool)pTestItem->bTest9);
492*cdf0e10cSrcweir                 aViewOpt.SetTest10((sal_Bool)pTestItem->bTest10);
493*cdf0e10cSrcweir             }
494*cdf0e10cSrcweir #endif
495*cdf0e10cSrcweir         // dann an der akt. View und Shell die entsp. Elemente setzen
496*cdf0e10cSrcweir     ApplyUsrPref( aViewOpt, pAppView, bTextDialog? VIEWOPT_DEST_TEXT : VIEWOPT_DEST_WEB);
497*cdf0e10cSrcweir }
498*cdf0e10cSrcweir /* -----------------12.02.99 12:28-------------------
499*cdf0e10cSrcweir  *
500*cdf0e10cSrcweir  * --------------------------------------------------*/
501*cdf0e10cSrcweir SfxTabPage* SwModule::CreateTabPage( sal_uInt16 nId, Window* pParent, const SfxItemSet& rSet )
502*cdf0e10cSrcweir {
503*cdf0e10cSrcweir     SfxTabPage* pRet = NULL;
504*cdf0e10cSrcweir     SfxAllItemSet aSet(*(rSet.GetPool()));
505*cdf0e10cSrcweir     switch( nId )
506*cdf0e10cSrcweir     {
507*cdf0e10cSrcweir         case RID_SW_TP_CONTENT_OPT:
508*cdf0e10cSrcweir         case RID_SW_TP_HTML_CONTENT_OPT:
509*cdf0e10cSrcweir         {
510*cdf0e10cSrcweir             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
511*cdf0e10cSrcweir             if ( pFact )
512*cdf0e10cSrcweir             {
513*cdf0e10cSrcweir                 ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
514*cdf0e10cSrcweir                 if ( fnCreatePage )
515*cdf0e10cSrcweir                     pRet = (*fnCreatePage)( pParent, rSet );
516*cdf0e10cSrcweir             }
517*cdf0e10cSrcweir             break;
518*cdf0e10cSrcweir         }
519*cdf0e10cSrcweir         case RID_SW_TP_HTML_OPTGRID_PAGE:
520*cdf0e10cSrcweir         case RID_SVXPAGE_GRID:
521*cdf0e10cSrcweir             pRet = SvxGridTabPage::Create(pParent, rSet);
522*cdf0e10cSrcweir         break;
523*cdf0e10cSrcweir 
524*cdf0e10cSrcweir         case RID_SW_TP_STD_FONT:
525*cdf0e10cSrcweir         case RID_SW_TP_STD_FONT_CJK:
526*cdf0e10cSrcweir         case RID_SW_TP_STD_FONT_CTL:
527*cdf0e10cSrcweir         {
528*cdf0e10cSrcweir             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
529*cdf0e10cSrcweir             if ( pFact )
530*cdf0e10cSrcweir             {
531*cdf0e10cSrcweir                 ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
532*cdf0e10cSrcweir                 if ( fnCreatePage )
533*cdf0e10cSrcweir                     pRet = (*fnCreatePage)( pParent, rSet );
534*cdf0e10cSrcweir             }
535*cdf0e10cSrcweir             if(RID_SW_TP_STD_FONT != nId)
536*cdf0e10cSrcweir             {
537*cdf0e10cSrcweir                 aSet.Put (SfxUInt16Item(SID_FONTMODE_TYPE, RID_SW_TP_STD_FONT_CJK == nId ? FONT_GROUP_CJK : FONT_GROUP_CTL));
538*cdf0e10cSrcweir                 pRet->PageCreated(aSet);
539*cdf0e10cSrcweir             }
540*cdf0e10cSrcweir         }
541*cdf0e10cSrcweir         break;
542*cdf0e10cSrcweir         case RID_SW_TP_HTML_OPTPRINT_PAGE:
543*cdf0e10cSrcweir         case RID_SW_TP_OPTPRINT_PAGE:
544*cdf0e10cSrcweir         {
545*cdf0e10cSrcweir             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
546*cdf0e10cSrcweir             if ( pFact )
547*cdf0e10cSrcweir             {
548*cdf0e10cSrcweir                 ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
549*cdf0e10cSrcweir                 if ( fnCreatePage )
550*cdf0e10cSrcweir                     pRet = (*fnCreatePage)( pParent, rSet );
551*cdf0e10cSrcweir             }
552*cdf0e10cSrcweir             aSet.Put (SfxBoolItem(SID_FAX_LIST, sal_True));
553*cdf0e10cSrcweir             pRet->PageCreated(aSet);
554*cdf0e10cSrcweir         }
555*cdf0e10cSrcweir         break;
556*cdf0e10cSrcweir         case RID_SW_TP_HTML_OPTTABLE_PAGE:
557*cdf0e10cSrcweir         case RID_SW_TP_OPTTABLE_PAGE:
558*cdf0e10cSrcweir         {
559*cdf0e10cSrcweir             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
560*cdf0e10cSrcweir             if ( pFact )
561*cdf0e10cSrcweir             {
562*cdf0e10cSrcweir                 ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
563*cdf0e10cSrcweir                 if ( fnCreatePage )
564*cdf0e10cSrcweir                     pRet = (*fnCreatePage)( pParent, rSet );
565*cdf0e10cSrcweir             }
566*cdf0e10cSrcweir             SwView* pCurrView = GetView();
567*cdf0e10cSrcweir             if(pCurrView)
568*cdf0e10cSrcweir             {
569*cdf0e10cSrcweir                 // wenn Text dann nicht WebView und umgekehrt
570*cdf0e10cSrcweir                 sal_Bool bWebView = 0 != PTR_CAST(SwWebView, pCurrView);
571*cdf0e10cSrcweir                 if( (bWebView &&  RID_SW_TP_HTML_OPTTABLE_PAGE == nId) ||
572*cdf0e10cSrcweir                     (!bWebView &&  RID_SW_TP_HTML_OPTTABLE_PAGE != nId) )
573*cdf0e10cSrcweir                 {
574*cdf0e10cSrcweir                     aSet.Put (SwWrtShellItem(SID_WRT_SHELL,pCurrView->GetWrtShellPtr()));
575*cdf0e10cSrcweir                     pRet->PageCreated(aSet);
576*cdf0e10cSrcweir                 }
577*cdf0e10cSrcweir             }
578*cdf0e10cSrcweir         }
579*cdf0e10cSrcweir         break;
580*cdf0e10cSrcweir         case RID_SW_TP_OPTSHDWCRSR:
581*cdf0e10cSrcweir         case RID_SW_TP_HTML_OPTSHDWCRSR:
582*cdf0e10cSrcweir         case RID_SW_TP_REDLINE_OPT:
583*cdf0e10cSrcweir         case RID_SW_TP_OPTLOAD_PAGE:
584*cdf0e10cSrcweir         case RID_SW_TP_OPTCOMPATIBILITY_PAGE:
585*cdf0e10cSrcweir         case RID_SW_TP_MAILCONFIG:
586*cdf0e10cSrcweir         {
587*cdf0e10cSrcweir             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
588*cdf0e10cSrcweir             if ( pFact )
589*cdf0e10cSrcweir             {
590*cdf0e10cSrcweir                 ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
591*cdf0e10cSrcweir                 if ( fnCreatePage )
592*cdf0e10cSrcweir                     pRet = (*fnCreatePage)( pParent, rSet );
593*cdf0e10cSrcweir             }
594*cdf0e10cSrcweir             if (pRet && (nId == RID_SW_TP_OPTSHDWCRSR || nId == RID_SW_TP_HTML_OPTSHDWCRSR))
595*cdf0e10cSrcweir             {
596*cdf0e10cSrcweir                 SwView* pCurrView = GetView();
597*cdf0e10cSrcweir                 if(pCurrView)
598*cdf0e10cSrcweir                 {
599*cdf0e10cSrcweir                     aSet.Put( SwWrtShellItem( SID_WRT_SHELL, pCurrView->GetWrtShellPtr() ) );
600*cdf0e10cSrcweir                     pRet->PageCreated(aSet);
601*cdf0e10cSrcweir                 }
602*cdf0e10cSrcweir             }
603*cdf0e10cSrcweir         }
604*cdf0e10cSrcweir         break;
605*cdf0e10cSrcweir #ifdef DBG_UTIL
606*cdf0e10cSrcweir         case  RID_SW_TP_OPTTEST_PAGE:
607*cdf0e10cSrcweir         {
608*cdf0e10cSrcweir             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
609*cdf0e10cSrcweir             if ( pFact )
610*cdf0e10cSrcweir             {
611*cdf0e10cSrcweir                 ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( nId );
612*cdf0e10cSrcweir                 if ( fnCreatePage )
613*cdf0e10cSrcweir                     pRet = (*fnCreatePage)( pParent, rSet );
614*cdf0e10cSrcweir             }
615*cdf0e10cSrcweir             break;
616*cdf0e10cSrcweir         }
617*cdf0e10cSrcweir #endif
618*cdf0e10cSrcweir         case  RID_SW_TP_BACKGROUND:
619*cdf0e10cSrcweir         {
620*cdf0e10cSrcweir             SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
621*cdf0e10cSrcweir             if ( pFact )
622*cdf0e10cSrcweir             {
623*cdf0e10cSrcweir                 ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND );
624*cdf0e10cSrcweir                 if ( fnCreatePage )
625*cdf0e10cSrcweir                     pRet = (*fnCreatePage)( pParent, rSet );
626*cdf0e10cSrcweir             }
627*cdf0e10cSrcweir             break;
628*cdf0e10cSrcweir         }
629*cdf0e10cSrcweir         case TP_OPTCAPTION_PAGE:
630*cdf0e10cSrcweir         case RID_SW_TP_OPTCAPTION_PAGE:
631*cdf0e10cSrcweir         {
632*cdf0e10cSrcweir             SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
633*cdf0e10cSrcweir             if ( pFact )
634*cdf0e10cSrcweir             {
635*cdf0e10cSrcweir                 ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SW_TP_OPTCAPTION_PAGE );
636*cdf0e10cSrcweir                 if ( fnCreatePage )
637*cdf0e10cSrcweir                     pRet = (*fnCreatePage)( pParent, rSet );
638*cdf0e10cSrcweir             }
639*cdf0e10cSrcweir         }
640*cdf0e10cSrcweir         break;
641*cdf0e10cSrcweir     }
642*cdf0e10cSrcweir 
643*cdf0e10cSrcweir     DBG_ASSERT( pRet, "SwModule::CreateTabPage(): Unknown tabpage id" );
644*cdf0e10cSrcweir     return pRet;
645*cdf0e10cSrcweir }
646*cdf0e10cSrcweir 
647