xref: /aoo41x/main/sfx2/source/appl/appcfg.cxx (revision d119d52d)
1*d119d52dSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*d119d52dSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*d119d52dSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*d119d52dSAndrew Rist  * distributed with this work for additional information
6*d119d52dSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*d119d52dSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*d119d52dSAndrew Rist  * "License"); you may not use this file except in compliance
9*d119d52dSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*d119d52dSAndrew Rist  *
11*d119d52dSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*d119d52dSAndrew Rist  *
13*d119d52dSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*d119d52dSAndrew Rist  * software distributed under the License is distributed on an
15*d119d52dSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*d119d52dSAndrew Rist  * KIND, either express or implied.  See the License for the
17*d119d52dSAndrew Rist  * specific language governing permissions and limitations
18*d119d52dSAndrew Rist  * under the License.
19*d119d52dSAndrew Rist  *
20*d119d52dSAndrew Rist  *************************************************************/
21*d119d52dSAndrew Rist 
22*d119d52dSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_sfx2.hxx"
26cdf0e10cSrcweir #include <com/sun/star/uno/Reference.hxx>
27cdf0e10cSrcweir #include <com/sun/star/frame/XDesktop.hpp>
28cdf0e10cSrcweir #include <com/sun/star/util/XURLTransformer.hpp>
29cdf0e10cSrcweir #ifndef _COM_SUN_STAR_BEANS_PropertyValue_HPP_
30cdf0e10cSrcweir #include <com/sun/star/beans/PropertyValue.hpp>
31cdf0e10cSrcweir #endif
32cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp>
33cdf0e10cSrcweir #include <com/sun/star/util/XFlushable.hpp>
34cdf0e10cSrcweir 
35cdf0e10cSrcweir #ifndef _STDLIB_H
36cdf0e10cSrcweir #include <stdlib.h>
37cdf0e10cSrcweir #endif
38cdf0e10cSrcweir #include <tools/config.hxx>
39cdf0e10cSrcweir #include <vcl/sound.hxx>
40cdf0e10cSrcweir #include <vcl/msgbox.hxx>
41cdf0e10cSrcweir #include <tools/string.hxx>
42cdf0e10cSrcweir #include <svl/itempool.hxx>
43cdf0e10cSrcweir #include <svl/aeitem.hxx>
44cdf0e10cSrcweir #include <svl/slstitm.hxx>
45cdf0e10cSrcweir #include <svl/stritem.hxx>
46cdf0e10cSrcweir #include <svl/intitem.hxx>
47cdf0e10cSrcweir #include <svl/eitem.hxx>
48cdf0e10cSrcweir #include <svl/szitem.hxx>
49cdf0e10cSrcweir #include <svl/undo.hxx>
50cdf0e10cSrcweir 
51cdf0e10cSrcweir #define _SVSTDARR_STRINGS
52cdf0e10cSrcweir #include <svl/svstdarr.hxx>
53cdf0e10cSrcweir #include <svtools/ttprops.hxx>
54cdf0e10cSrcweir #include <sfx2/sfxsids.hrc>
55cdf0e10cSrcweir #include <sot/exchange.hxx>
56cdf0e10cSrcweir 
57cdf0e10cSrcweir #include <svl/isethint.hxx>
58cdf0e10cSrcweir 
59cdf0e10cSrcweir #include <unotools/configmgr.hxx>
60cdf0e10cSrcweir #include <tools/urlobj.hxx>
61cdf0e10cSrcweir #include <tools/wldcrd.hxx>
62cdf0e10cSrcweir #include <unotools/saveopt.hxx>
63cdf0e10cSrcweir #include <svtools/helpopt.hxx>
64cdf0e10cSrcweir #include <unotools/undoopt.hxx>
65cdf0e10cSrcweir #include <unotools/securityoptions.hxx>
66cdf0e10cSrcweir #include <unotools/pathoptions.hxx>
67cdf0e10cSrcweir #include <unotools/inetoptions.hxx>
68cdf0e10cSrcweir #include <svtools/miscopt.hxx>
69cdf0e10cSrcweir #include <vcl/toolbox.hxx>
70cdf0e10cSrcweir #include <unotools/localfilehelper.hxx>
71cdf0e10cSrcweir #include <comphelper/processfactory.hxx>
72cdf0e10cSrcweir #include <rtl/ustrbuf.hxx>
73cdf0e10cSrcweir 
74cdf0e10cSrcweir #include <sfx2/app.hxx>
75cdf0e10cSrcweir #include <sfx2/docfile.hxx>
76cdf0e10cSrcweir #include <sfx2/viewfrm.hxx>
77cdf0e10cSrcweir #include "sfx2/sfxhelp.hxx"
78cdf0e10cSrcweir #include "sfxtypes.hxx"
79cdf0e10cSrcweir #include <sfx2/dispatch.hxx>
80cdf0e10cSrcweir #include <sfx2/objsh.hxx>
81cdf0e10cSrcweir #include "objshimp.hxx"
82cdf0e10cSrcweir #include <sfx2/viewsh.hxx>
83cdf0e10cSrcweir #include <sfx2/request.hxx>
84cdf0e10cSrcweir #include <sfx2/evntconf.hxx>
85cdf0e10cSrcweir #include "appdata.hxx"
86cdf0e10cSrcweir #include "workwin.hxx"
87cdf0e10cSrcweir #include "helper.hxx"	// SfxContentHelper::...
88cdf0e10cSrcweir #include "app.hrc"
89cdf0e10cSrcweir #include "sfx2/sfxresid.hxx"
90cdf0e10cSrcweir #include "shutdownicon.hxx"
91cdf0e10cSrcweir 
92cdf0e10cSrcweir using namespace ::com::sun::star::uno;
93cdf0e10cSrcweir using namespace ::com::sun::star::util;
94cdf0e10cSrcweir using namespace ::com::sun::star::frame;
95cdf0e10cSrcweir using namespace ::com::sun::star::beans;
96cdf0e10cSrcweir 
97cdf0e10cSrcweir //-------------------------------------------------------------------------
98cdf0e10cSrcweir 
99cdf0e10cSrcweir class SfxEventAsyncer_Impl : public SfxListener
100cdf0e10cSrcweir {
101cdf0e10cSrcweir     SfxEventHint        aHint;
102cdf0e10cSrcweir     Timer*              pTimer;
103cdf0e10cSrcweir 
104cdf0e10cSrcweir public:
105cdf0e10cSrcweir 
106cdf0e10cSrcweir 	virtual void		Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
107cdf0e10cSrcweir     SfxEventAsyncer_Impl( const SfxEventHint& rHint );
108cdf0e10cSrcweir     ~SfxEventAsyncer_Impl();
109cdf0e10cSrcweir 	DECL_LINK( TimerHdl, Timer*);
110cdf0e10cSrcweir };
111cdf0e10cSrcweir 
112cdf0e10cSrcweir // -----------------------------------------------------------------------
113cdf0e10cSrcweir 
Notify(SfxBroadcaster &,const SfxHint & rHint)114cdf0e10cSrcweir void SfxEventAsyncer_Impl::Notify( SfxBroadcaster&, const SfxHint& rHint )
115cdf0e10cSrcweir {
116cdf0e10cSrcweir 	SfxSimpleHint* pHint = PTR_CAST( SfxSimpleHint, &rHint );
117cdf0e10cSrcweir 	if( pHint && pHint->GetId() == SFX_HINT_DYING && pTimer->IsActive() )
118cdf0e10cSrcweir 	{
119cdf0e10cSrcweir 		pTimer->Stop();
120cdf0e10cSrcweir 		delete this;
121cdf0e10cSrcweir 	}
122cdf0e10cSrcweir }
123cdf0e10cSrcweir 
124cdf0e10cSrcweir // -----------------------------------------------------------------------
125cdf0e10cSrcweir 
SfxEventAsyncer_Impl(const SfxEventHint & rHint)126cdf0e10cSrcweir SfxEventAsyncer_Impl::SfxEventAsyncer_Impl( const SfxEventHint& rHint )
127cdf0e10cSrcweir  : aHint( rHint )
128cdf0e10cSrcweir {
129cdf0e10cSrcweir     if( rHint.GetObjShell() )
130cdf0e10cSrcweir         StartListening( *rHint.GetObjShell() );
131cdf0e10cSrcweir 	pTimer = new Timer;
132cdf0e10cSrcweir     pTimer->SetTimeoutHdl( LINK(this, SfxEventAsyncer_Impl, TimerHdl) );
133cdf0e10cSrcweir 	pTimer->SetTimeout( 0 );
134cdf0e10cSrcweir 	pTimer->Start();
135cdf0e10cSrcweir }
136cdf0e10cSrcweir 
137cdf0e10cSrcweir // -----------------------------------------------------------------------
138cdf0e10cSrcweir 
~SfxEventAsyncer_Impl()139cdf0e10cSrcweir SfxEventAsyncer_Impl::~SfxEventAsyncer_Impl()
140cdf0e10cSrcweir {
141cdf0e10cSrcweir 	delete pTimer;
142cdf0e10cSrcweir }
143cdf0e10cSrcweir 
144cdf0e10cSrcweir // -----------------------------------------------------------------------
145cdf0e10cSrcweir 
IMPL_LINK(SfxEventAsyncer_Impl,TimerHdl,Timer *,pAsyncTimer)146cdf0e10cSrcweir IMPL_LINK(SfxEventAsyncer_Impl, TimerHdl, Timer*, pAsyncTimer)
147cdf0e10cSrcweir {
148cdf0e10cSrcweir     (void)pAsyncTimer; // unused variable
149cdf0e10cSrcweir     SfxObjectShellRef xRef( aHint.GetObjShell() );
150cdf0e10cSrcweir     pAsyncTimer->Stop();
151cdf0e10cSrcweir #ifdef DBG_UTIL
152cdf0e10cSrcweir 	if (!xRef.Is())
153cdf0e10cSrcweir 	{
154cdf0e10cSrcweir 		ByteString aTmp( "SfxEvent: ");
155cdf0e10cSrcweir 		aTmp += ByteString( String( aHint.GetEventName() ), RTL_TEXTENCODING_UTF8 );
156cdf0e10cSrcweir 		DBG_TRACE( aTmp.GetBuffer() );
157cdf0e10cSrcweir 	}
158cdf0e10cSrcweir #endif
159cdf0e10cSrcweir     SFX_APP()->Broadcast( aHint );
160cdf0e10cSrcweir     if ( xRef.Is() )
161cdf0e10cSrcweir         xRef->Broadcast( aHint );
162cdf0e10cSrcweir     delete this;
163cdf0e10cSrcweir 	return 0L;
164cdf0e10cSrcweir }
165cdf0e10cSrcweir 
166cdf0e10cSrcweir 
167cdf0e10cSrcweir //--------------------------------------------------------------------
168cdf0e10cSrcweir 
GetOptions(SfxItemSet & rSet)169cdf0e10cSrcweir sal_Bool SfxApplication::GetOptions( SfxItemSet& rSet )
170cdf0e10cSrcweir {
171cdf0e10cSrcweir     sal_Bool bRet = sal_False;
172cdf0e10cSrcweir     SfxItemPool &rPool = GetPool();
173cdf0e10cSrcweir 	String aTRUEStr('1');
174cdf0e10cSrcweir 
175cdf0e10cSrcweir 	const sal_uInt16 *pRanges = rSet.GetRanges();
176cdf0e10cSrcweir     SvtSaveOptions aSaveOptions;
177cdf0e10cSrcweir     SvtUndoOptions aUndoOptions;
178cdf0e10cSrcweir     SvtHelpOptions aHelpOptions;
179cdf0e10cSrcweir 	SvtInetOptions aInetOptions;
180cdf0e10cSrcweir 	SvtSecurityOptions	aSecurityOptions;
181cdf0e10cSrcweir     SvtMiscOptions aMiscOptions;
182cdf0e10cSrcweir 
183cdf0e10cSrcweir 	while ( *pRanges )
184cdf0e10cSrcweir 	{
185cdf0e10cSrcweir 		for(sal_uInt16 nWhich = *pRanges++; nWhich <= *pRanges; ++nWhich)
186cdf0e10cSrcweir 		{
187cdf0e10cSrcweir 			switch(nWhich)
188cdf0e10cSrcweir 			{
189cdf0e10cSrcweir     			case SID_ATTR_BUTTON_OUTSTYLE3D :
190cdf0e10cSrcweir 					if(rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_BUTTON_OUTSTYLE3D ),
191cdf0e10cSrcweir                               aMiscOptions.GetToolboxStyle() != TOOLBOX_STYLE_FLAT)))
192cdf0e10cSrcweir 						bRet = sal_True;
193cdf0e10cSrcweir 					break;
194cdf0e10cSrcweir     			case SID_ATTR_BUTTON_BIGSIZE :
195cdf0e10cSrcweir                 {
196cdf0e10cSrcweir 					if( rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_BUTTON_BIGSIZE ), aMiscOptions.AreCurrentSymbolsLarge() ) ) )
197cdf0e10cSrcweir 						bRet = sal_True;
198cdf0e10cSrcweir 					break;
199cdf0e10cSrcweir                 }
200cdf0e10cSrcweir     			case SID_ATTR_BACKUP :
201cdf0e10cSrcweir                     {
202cdf0e10cSrcweir                         bRet = sal_True;
203cdf0e10cSrcweir                         if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_BACKUP))
204cdf0e10cSrcweir                             if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_BACKUP ),aSaveOptions.IsBackup())))
205cdf0e10cSrcweir                                 bRet = sal_False;
206cdf0e10cSrcweir                     }
207cdf0e10cSrcweir 					break;
208cdf0e10cSrcweir     			case SID_ATTR_PRETTYPRINTING:
209cdf0e10cSrcweir                     {
210cdf0e10cSrcweir                         bRet = sal_True;
211cdf0e10cSrcweir                         if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_DOPRETTYPRINTING))
212cdf0e10cSrcweir                             if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_PRETTYPRINTING ), aSaveOptions.IsPrettyPrinting())))
213cdf0e10cSrcweir                                 bRet = sal_False;
214cdf0e10cSrcweir                     }
215cdf0e10cSrcweir 					break;
216cdf0e10cSrcweir                 case SID_ATTR_WARNALIENFORMAT:
217cdf0e10cSrcweir                     {
218cdf0e10cSrcweir                         bRet = sal_True;
219cdf0e10cSrcweir                         if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_WARNALIENFORMAT))
220cdf0e10cSrcweir                             if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_WARNALIENFORMAT ), aSaveOptions.IsWarnAlienFormat())))
221cdf0e10cSrcweir                                 bRet = sal_False;
222cdf0e10cSrcweir                     }
223cdf0e10cSrcweir 					break;
224cdf0e10cSrcweir     			case SID_ATTR_AUTOSAVE :
225cdf0e10cSrcweir                     {
226cdf0e10cSrcweir                         bRet = sal_True;
227cdf0e10cSrcweir                         if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_AUTOSAVE))
228cdf0e10cSrcweir                             if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_AUTOSAVE ), aSaveOptions.IsAutoSave())))
229cdf0e10cSrcweir                                 bRet = sal_False;
230cdf0e10cSrcweir                     }
231cdf0e10cSrcweir 					break;
232cdf0e10cSrcweir 				case SID_ATTR_AUTOSAVEPROMPT :
233cdf0e10cSrcweir                     {
234cdf0e10cSrcweir                         bRet = sal_True;
235cdf0e10cSrcweir                         if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_AUTOSAVEPROMPT))
236cdf0e10cSrcweir                             if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_AUTOSAVEPROMPT ), aSaveOptions.IsAutoSavePrompt())))
237cdf0e10cSrcweir                                 bRet = sal_False;
238cdf0e10cSrcweir                     }
239cdf0e10cSrcweir 					break;
240cdf0e10cSrcweir     			case SID_ATTR_AUTOSAVEMINUTE :
241cdf0e10cSrcweir                     {
242cdf0e10cSrcweir                         bRet = sal_True;
243cdf0e10cSrcweir                         if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_AUTOSAVETIME))
244cdf0e10cSrcweir                             if (!rSet.Put( SfxUInt16Item( rPool.GetWhich( SID_ATTR_AUTOSAVEMINUTE ), (sal_uInt16)aSaveOptions.GetAutoSaveTime())))
245cdf0e10cSrcweir                                 bRet = sal_False;
246cdf0e10cSrcweir                     }
247cdf0e10cSrcweir 					break;
248cdf0e10cSrcweir     			case SID_ATTR_DOCINFO :
249cdf0e10cSrcweir                     {
250cdf0e10cSrcweir                         bRet = sal_True;
251cdf0e10cSrcweir                         if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_DOCINFSAVE))
252cdf0e10cSrcweir                             if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_DOCINFO ), aSaveOptions.IsDocInfoSave())))
253cdf0e10cSrcweir                                 bRet = sal_False;
254cdf0e10cSrcweir                     }
255cdf0e10cSrcweir 					break;
256cdf0e10cSrcweir     			case SID_ATTR_WORKINGSET :
257cdf0e10cSrcweir                     {
258cdf0e10cSrcweir                         bRet = sal_True;
259cdf0e10cSrcweir                         if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_SAVEWORKINGSET))
260cdf0e10cSrcweir                             if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_WORKINGSET ), aSaveOptions.IsSaveWorkingSet())))
261cdf0e10cSrcweir                                 bRet = sal_False;
262cdf0e10cSrcweir                     }
263cdf0e10cSrcweir 					break;
264cdf0e10cSrcweir     			case SID_ATTR_SAVEDOCVIEW :
265cdf0e10cSrcweir                     {
266cdf0e10cSrcweir                         bRet = sal_True;
267cdf0e10cSrcweir                         if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_SAVEDOCVIEW))
268cdf0e10cSrcweir                             if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_SAVEDOCVIEW ), aSaveOptions.IsSaveDocView())))
269cdf0e10cSrcweir                                 bRet = sal_False;
270cdf0e10cSrcweir                     }
271cdf0e10cSrcweir 					break;
272cdf0e10cSrcweir     			case SID_ATTR_METRIC :
273cdf0e10cSrcweir //                    if(rSet.Put( SfxUInt16Item( rPool.GetWhich( SID_ATTR_METRIC ),
274cdf0e10cSrcweir //                                pOptions->GetMetric() ) ) )
275cdf0e10cSrcweir //                        bRet = sal_True;
276cdf0e10cSrcweir 					break;
277cdf0e10cSrcweir     			case SID_HELPBALLOONS :
278cdf0e10cSrcweir 					if(rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_HELPBALLOONS ),
279cdf0e10cSrcweir                                aHelpOptions.IsExtendedHelp() ) ) )
280cdf0e10cSrcweir         				bRet = sal_True;
281cdf0e10cSrcweir 					break;
282cdf0e10cSrcweir     			case SID_HELPTIPS :
283cdf0e10cSrcweir 					if(rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_HELPTIPS ),
284cdf0e10cSrcweir                                aHelpOptions.IsHelpTips() ) ) )
285cdf0e10cSrcweir         				bRet = sal_True;
286cdf0e10cSrcweir 					break;
287cdf0e10cSrcweir     			case SID_ATTR_AUTOHELPAGENT :
288cdf0e10cSrcweir 					if(rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_ATTR_AUTOHELPAGENT ),
289cdf0e10cSrcweir                                aHelpOptions.IsHelpAgentAutoStartMode() ) ) )
290cdf0e10cSrcweir         				bRet = sal_True;
291cdf0e10cSrcweir 					break;
292cdf0e10cSrcweir     			case SID_HELPAGENT_TIMEOUT :
293cdf0e10cSrcweir 					if ( rSet.Put( SfxInt32Item( rPool.GetWhich( SID_HELPAGENT_TIMEOUT ),
294cdf0e10cSrcweir 												 aHelpOptions.GetHelpAgentTimeoutPeriod() ) ) )
295cdf0e10cSrcweir         				bRet = sal_True;
296cdf0e10cSrcweir 					break;
297cdf0e10cSrcweir     			case SID_ATTR_WELCOMESCREEN :
298cdf0e10cSrcweir 					if(rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_ATTR_WELCOMESCREEN ),
299cdf0e10cSrcweir                                aHelpOptions.IsWelcomeScreen() ) ) )
300cdf0e10cSrcweir         				bRet = sal_True;
301cdf0e10cSrcweir 					break;
302cdf0e10cSrcweir                 case SID_HELP_STYLESHEET :
303cdf0e10cSrcweir                     if(rSet.Put( SfxStringItem ( rPool.GetWhich( SID_HELP_STYLESHEET ),
304cdf0e10cSrcweir                                aHelpOptions.GetHelpStyleSheet() ) ) )
305cdf0e10cSrcweir         				bRet = sal_True;
306cdf0e10cSrcweir                 break;
307cdf0e10cSrcweir     			case SID_ATTR_UNDO_COUNT :
308cdf0e10cSrcweir 					if(rSet.Put( SfxUInt16Item ( rPool.GetWhich( SID_ATTR_UNDO_COUNT ),
309cdf0e10cSrcweir                                  (sal_uInt16)aUndoOptions.GetUndoCount() ) ) )
310cdf0e10cSrcweir         				bRet = sal_True;
311cdf0e10cSrcweir 					break;
312cdf0e10cSrcweir     			case SID_ATTR_QUICKLAUNCHER :
313cdf0e10cSrcweir                 {
314cdf0e10cSrcweir                     if ( ShutdownIcon::IsQuickstarterInstalled() )
315cdf0e10cSrcweir                     {
316cdf0e10cSrcweir                         if ( rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_QUICKLAUNCHER ),
317cdf0e10cSrcweir                                                     ShutdownIcon::GetAutostart() ) ) )
318cdf0e10cSrcweir                             bRet = sal_True;
319cdf0e10cSrcweir                     }
320cdf0e10cSrcweir                     else
321cdf0e10cSrcweir                     {
322cdf0e10cSrcweir                         rSet.DisableItem( rPool.GetWhich( SID_ATTR_QUICKLAUNCHER ) );
323cdf0e10cSrcweir                         bRet = sal_True;
324cdf0e10cSrcweir                     }
325cdf0e10cSrcweir 					break;
326cdf0e10cSrcweir                 }
327cdf0e10cSrcweir     			case SID_SAVEREL_INET :
328cdf0e10cSrcweir                     {
329cdf0e10cSrcweir                         bRet = sal_True;
330cdf0e10cSrcweir                         if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_SAVERELINET))
331cdf0e10cSrcweir                             if (!rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_SAVEREL_INET ), aSaveOptions.IsSaveRelINet() )))
332cdf0e10cSrcweir                                 bRet = sal_False;
333cdf0e10cSrcweir                     }
334cdf0e10cSrcweir 					break;
335cdf0e10cSrcweir     			case SID_SAVEREL_FSYS :
336cdf0e10cSrcweir                     {
337cdf0e10cSrcweir                         bRet = sal_True;
338cdf0e10cSrcweir                         if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_SAVERELFSYS))
339cdf0e10cSrcweir                             if (!rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_SAVEREL_FSYS ), aSaveOptions.IsSaveRelFSys() )))
340cdf0e10cSrcweir                                 bRet = sal_False;
341cdf0e10cSrcweir                     }
342cdf0e10cSrcweir 					break;
343cdf0e10cSrcweir                 case SID_BASIC_ENABLED :
344cdf0e10cSrcweir                     {
345cdf0e10cSrcweir                         bRet = sal_True;
346cdf0e10cSrcweir                         if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::E_BASICMODE))
347cdf0e10cSrcweir                         {
348cdf0e10cSrcweir                             if ( !rSet.Put( SfxUInt16Item( rPool.GetWhich( SID_BASIC_ENABLED ), sal::static_int_cast< sal_uInt16 >(aSecurityOptions.GetBasicMode()))))
349cdf0e10cSrcweir                                 bRet = sal_False;
350cdf0e10cSrcweir                         }
351cdf0e10cSrcweir                     }
352cdf0e10cSrcweir                     break;
353cdf0e10cSrcweir                 case SID_INET_EXE_PLUGIN  :
354cdf0e10cSrcweir                     {
355cdf0e10cSrcweir                         bRet = sal_True;
356cdf0e10cSrcweir                         if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::E_EXECUTEPLUGINS))
357cdf0e10cSrcweir                         {
358cdf0e10cSrcweir                             if ( !rSet.Put( SfxBoolItem( SID_INET_EXE_PLUGIN, aSecurityOptions.IsExecutePlugins() ) ) )
359cdf0e10cSrcweir                                 bRet = sal_False;
360cdf0e10cSrcweir                         }
361cdf0e10cSrcweir                     }
362cdf0e10cSrcweir                     break;
363cdf0e10cSrcweir                 case SID_MACRO_WARNING :
364cdf0e10cSrcweir                     {
365cdf0e10cSrcweir                         bRet = sal_True;
366cdf0e10cSrcweir                         if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::E_WARNING))
367cdf0e10cSrcweir                         {
368cdf0e10cSrcweir                             if ( !rSet.Put( SfxBoolItem( SID_MACRO_WARNING, aSecurityOptions.IsWarningEnabled() ) ) )
369cdf0e10cSrcweir                                 bRet = sal_False;
370cdf0e10cSrcweir                         }
371cdf0e10cSrcweir                     }
372cdf0e10cSrcweir                     break;
373cdf0e10cSrcweir                 case SID_MACRO_CONFIRMATION :
374cdf0e10cSrcweir                     {
375cdf0e10cSrcweir                         bRet = sal_True;
376cdf0e10cSrcweir                         if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::E_CONFIRMATION))
377cdf0e10cSrcweir                         {
378cdf0e10cSrcweir                             if ( !rSet.Put( SfxBoolItem( SID_MACRO_CONFIRMATION, aSecurityOptions.IsConfirmationEnabled() ) ) )
379cdf0e10cSrcweir                                 bRet = sal_False;
380cdf0e10cSrcweir                         }
381cdf0e10cSrcweir                     }
382cdf0e10cSrcweir                     break;
383cdf0e10cSrcweir                 case SID_SECURE_URL :
384cdf0e10cSrcweir                     {
385cdf0e10cSrcweir                         bRet = sal_True;
386cdf0e10cSrcweir                         if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::E_SECUREURLS))
387cdf0e10cSrcweir                         {
388cdf0e10cSrcweir                             ::com::sun::star::uno::Sequence< ::rtl::OUString > seqURLs = aSecurityOptions.GetSecureURLs();
389cdf0e10cSrcweir                             List aList;
390cdf0e10cSrcweir                             sal_uInt32 nCount = seqURLs.getLength();
391cdf0e10cSrcweir                             sal_uInt32 nURL;
392cdf0e10cSrcweir                             for( nURL=0; nURL<nCount; ++nURL )
393cdf0e10cSrcweir                             {
394cdf0e10cSrcweir                                 aList.Insert( new String( seqURLs[nURL] ), LIST_APPEND );
395cdf0e10cSrcweir                             }
396cdf0e10cSrcweir                             if( !rSet.Put( SfxStringListItem( rPool.GetWhich(SID_SECURE_URL),
397cdf0e10cSrcweir                                     &aList ) ) )
398cdf0e10cSrcweir                             {
399cdf0e10cSrcweir                                 bRet = sal_False;
400cdf0e10cSrcweir                             }
401cdf0e10cSrcweir                             for( nURL=0; nURL<nCount; ++nURL )
402cdf0e10cSrcweir                             {
403cdf0e10cSrcweir                                 delete (String*)aList.GetObject(nURL);
404cdf0e10cSrcweir                             }
405cdf0e10cSrcweir                             aList.Clear();
406cdf0e10cSrcweir                         }
407cdf0e10cSrcweir                     }
408cdf0e10cSrcweir                     break;
409cdf0e10cSrcweir     			case SID_ENABLE_METAFILEPRINT :
410cdf0e10cSrcweir #ifdef ENABLE_MISSINGKEYASSERTIONS//MUSTINI
411cdf0e10cSrcweir 					DBG_ASSERT(sal_False, "SfxApplication::GetOptions()\nSoffice.ini key \"Common\\MetafilePrint\" is obsolete! .. How I can support SID_ENABLE_METAFILEPRINT any longer?\n");
412cdf0e10cSrcweir #endif
413cdf0e10cSrcweir 					break;
414cdf0e10cSrcweir                 case SID_INET_PROXY_TYPE :
415cdf0e10cSrcweir                 {
416cdf0e10cSrcweir                     if( rSet.Put( SfxUInt16Item ( rPool.GetWhich( SID_INET_PROXY_TYPE ),
417cdf0e10cSrcweir                         (sal_uInt16)aInetOptions.GetProxyType() )))
418cdf0e10cSrcweir                             bRet = sal_True;
419cdf0e10cSrcweir                     break;
420cdf0e10cSrcweir                 }
421cdf0e10cSrcweir                 case SID_INET_HTTP_PROXY_NAME :
422cdf0e10cSrcweir                 {
423cdf0e10cSrcweir                     if ( rSet.Put( SfxStringItem ( rPool.GetWhich(SID_INET_HTTP_PROXY_NAME ),
424cdf0e10cSrcweir                         aInetOptions.GetProxyHttpName() )))
425cdf0e10cSrcweir                             bRet = sal_True;
426cdf0e10cSrcweir                     break;
427cdf0e10cSrcweir                 }
428cdf0e10cSrcweir                 case SID_INET_HTTP_PROXY_PORT :
429cdf0e10cSrcweir                     if ( rSet.Put( SfxInt32Item( rPool.GetWhich(SID_INET_HTTP_PROXY_PORT ),
430cdf0e10cSrcweir                         aInetOptions.GetProxyHttpPort() )))
431cdf0e10cSrcweir                             bRet = sal_True;
432cdf0e10cSrcweir                     break;
433cdf0e10cSrcweir                 case SID_INET_FTP_PROXY_NAME :
434cdf0e10cSrcweir                     if ( rSet.Put( SfxStringItem ( rPool.GetWhich(SID_INET_FTP_PROXY_NAME ),
435cdf0e10cSrcweir                         aInetOptions.GetProxyFtpName() )))
436cdf0e10cSrcweir                             bRet = sal_True;
437cdf0e10cSrcweir                     break;
438cdf0e10cSrcweir                 case SID_INET_FTP_PROXY_PORT :
439cdf0e10cSrcweir                     if ( rSet.Put( SfxInt32Item ( rPool.GetWhich(SID_INET_FTP_PROXY_PORT ),
440cdf0e10cSrcweir                         aInetOptions.GetProxyFtpPort() )))
441cdf0e10cSrcweir                             bRet = sal_True;
442cdf0e10cSrcweir                     break;
443cdf0e10cSrcweir                 case SID_INET_SECURITY_PROXY_NAME :
444cdf0e10cSrcweir                 case SID_INET_SECURITY_PROXY_PORT :
445cdf0e10cSrcweir #ifdef ENABLE_MISSINGKEYASSERTIONS//MUSTINI
446cdf0e10cSrcweir                     DBG_ASSERT( sal_False, "SfxApplication::GetOptions()\nSome INET values no longer supported!\n" );
447cdf0e10cSrcweir #endif
448cdf0e10cSrcweir                     break;
449cdf0e10cSrcweir                 case SID_INET_NOPROXY :
450cdf0e10cSrcweir                     if( rSet.Put( SfxStringItem ( rPool.GetWhich( SID_INET_NOPROXY),
451cdf0e10cSrcweir                         aInetOptions.GetProxyNoProxy() )))
452cdf0e10cSrcweir                             bRet = sal_True;
453cdf0e10cSrcweir                     break;
454cdf0e10cSrcweir 				case SID_ATTR_PATHNAME :
455cdf0e10cSrcweir 				case SID_ATTR_PATHGROUP :
456cdf0e10cSrcweir 				{
457cdf0e10cSrcweir 					SfxAllEnumItem aNames(rPool.GetWhich(SID_ATTR_PATHGROUP));
458cdf0e10cSrcweir     				SfxAllEnumItem aValues(rPool.GetWhich(SID_ATTR_PATHNAME));
459cdf0e10cSrcweir                     SvtPathOptions aPathCfg;
460cdf0e10cSrcweir                     for ( sal_uInt16 nProp = SvtPathOptions::PATH_ADDIN;
461cdf0e10cSrcweir 						  nProp <= SvtPathOptions::PATH_WORK; nProp++ )
462cdf0e10cSrcweir                     {
463cdf0e10cSrcweir 						const String aName( SfxResId( CONFIG_PATH_START + nProp ) );
464cdf0e10cSrcweir 						aNames.InsertValue( nProp, aName );
465cdf0e10cSrcweir                         String aValue;
466cdf0e10cSrcweir                         switch ( nProp )
467cdf0e10cSrcweir                         {
468cdf0e10cSrcweir                             case SvtPathOptions::PATH_ADDIN:        ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aPathCfg.GetAddinPath(), aValue ); break;
469cdf0e10cSrcweir                             case SvtPathOptions::PATH_AUTOCORRECT:  aValue = aPathCfg.GetAutoCorrectPath(); break;
470cdf0e10cSrcweir                             case SvtPathOptions::PATH_AUTOTEXT:     aValue = aPathCfg.GetAutoTextPath(); break;
471cdf0e10cSrcweir                             case SvtPathOptions::PATH_BACKUP:       aValue = aPathCfg.GetBackupPath(); break;
472cdf0e10cSrcweir                             case SvtPathOptions::PATH_BASIC:        aValue = aPathCfg.GetBasicPath(); break;
473cdf0e10cSrcweir                             case SvtPathOptions::PATH_BITMAP:       aValue = aPathCfg.GetBitmapPath(); break;
474cdf0e10cSrcweir                             case SvtPathOptions::PATH_CONFIG:       aValue = aPathCfg.GetConfigPath(); break;
475cdf0e10cSrcweir                             case SvtPathOptions::PATH_DICTIONARY:   aValue = aPathCfg.GetDictionaryPath(); break;
476cdf0e10cSrcweir                             case SvtPathOptions::PATH_FAVORITES:    aValue = aPathCfg.GetFavoritesPath(); break;
477cdf0e10cSrcweir                             case SvtPathOptions::PATH_FILTER:       ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aPathCfg.GetFilterPath(), aValue ); break;
478cdf0e10cSrcweir                             case SvtPathOptions::PATH_GALLERY:      aValue = aPathCfg.GetGalleryPath(); break;
479cdf0e10cSrcweir                             case SvtPathOptions::PATH_GRAPHIC:      aValue = aPathCfg.GetGraphicPath(); break;
480cdf0e10cSrcweir                             case SvtPathOptions::PATH_HELP:         ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aPathCfg.GetHelpPath(), aValue ); break;
481cdf0e10cSrcweir                             case SvtPathOptions::PATH_LINGUISTIC:   aValue = aPathCfg.GetLinguisticPath(); break;
482cdf0e10cSrcweir                             case SvtPathOptions::PATH_MODULE:       ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aPathCfg.GetModulePath(), aValue ); break;
483cdf0e10cSrcweir                             case SvtPathOptions::PATH_PALETTE:      aValue = aPathCfg.GetPalettePath(); break;
484cdf0e10cSrcweir                             case SvtPathOptions::PATH_PLUGIN:       ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aPathCfg.GetPluginPath(), aValue ); break;
485cdf0e10cSrcweir                             case SvtPathOptions::PATH_STORAGE:      ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aPathCfg.GetStoragePath(), aValue ); break;
486cdf0e10cSrcweir                             case SvtPathOptions::PATH_TEMP:         aValue = aPathCfg.GetTempPath(); break;
487cdf0e10cSrcweir                             case SvtPathOptions::PATH_TEMPLATE:     aValue = aPathCfg.GetTemplatePath(); break;
488cdf0e10cSrcweir                             case SvtPathOptions::PATH_USERCONFIG:   aValue = aPathCfg.GetUserConfigPath(); break;
489cdf0e10cSrcweir                             case SvtPathOptions::PATH_WORK:         aValue = aPathCfg.GetWorkPath(); break;
490cdf0e10cSrcweir                         }
491cdf0e10cSrcweir                         aValues.InsertValue( nProp, aValue );
492cdf0e10cSrcweir                     }
493cdf0e10cSrcweir 
494cdf0e10cSrcweir 					if ( rSet.Put(aNames) || rSet.Put(aValues) )
495cdf0e10cSrcweir 						bRet = sal_True;
496cdf0e10cSrcweir 				}
497cdf0e10cSrcweir 
498cdf0e10cSrcweir 				default:
499cdf0e10cSrcweir 					DBG_WARNING( "W1:Wrong ID while getting Options!" );
500cdf0e10cSrcweir 					break;
501cdf0e10cSrcweir 			}
502cdf0e10cSrcweir #ifdef DBG_UTIL
503cdf0e10cSrcweir 			if ( !bRet )
504cdf0e10cSrcweir 				DBG_ERROR( "Putting options failed!" );
505cdf0e10cSrcweir #endif
506cdf0e10cSrcweir 		}
507cdf0e10cSrcweir 		pRanges++;
508cdf0e10cSrcweir 	}
509cdf0e10cSrcweir 
510cdf0e10cSrcweir 	return bRet;
511cdf0e10cSrcweir }
512cdf0e10cSrcweir 
513cdf0e10cSrcweir //--------------------------------------------------------------------
IsSecureURL(const INetURLObject & rURL,const String * pReferer) const514cdf0e10cSrcweir sal_Bool SfxApplication::IsSecureURL( const INetURLObject& rURL, const String* pReferer ) const
515cdf0e10cSrcweir {
516cdf0e10cSrcweir 	return SvtSecurityOptions().IsSecureURL( rURL.GetMainURL( INetURLObject::NO_DECODE ), *pReferer );
517cdf0e10cSrcweir }
518cdf0e10cSrcweir //--------------------------------------------------------------------
519cdf0e10cSrcweir // TODO/CLEANUP: wieso zwei SetOptions Methoden?
SetOptions_Impl(const SfxItemSet & rSet)520cdf0e10cSrcweir void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
521cdf0e10cSrcweir {
522cdf0e10cSrcweir     const SfxPoolItem *pItem = 0;
523cdf0e10cSrcweir     SfxItemPool &rPool = GetPool();
524cdf0e10cSrcweir 	sal_Bool bResetSession = sal_False;
525cdf0e10cSrcweir 	sal_Bool bProxiesModified = sal_False;
526cdf0e10cSrcweir 
527cdf0e10cSrcweir     SvtSaveOptions aSaveOptions;
528cdf0e10cSrcweir     SvtUndoOptions aUndoOptions;
529cdf0e10cSrcweir     SvtHelpOptions aHelpOptions;
530cdf0e10cSrcweir 	SvtSecurityOptions aSecurityOptions;
531cdf0e10cSrcweir 	SvtPathOptions aPathOptions;
532cdf0e10cSrcweir 	SvtInetOptions aInetOptions;
533cdf0e10cSrcweir     SvtMiscOptions aMiscOptions;
534cdf0e10cSrcweir     if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_BUTTON_OUTSTYLE3D), sal_True, &pItem) )
535cdf0e10cSrcweir     {
536cdf0e10cSrcweir         DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
537cdf0e10cSrcweir 		sal_uInt16 nOutStyle =
538cdf0e10cSrcweir 			( (const SfxBoolItem *)pItem)->GetValue() ? 0 : TOOLBOX_STYLE_FLAT;
539cdf0e10cSrcweir         aMiscOptions.SetToolboxStyle( nOutStyle );
540cdf0e10cSrcweir     }
541cdf0e10cSrcweir 
542cdf0e10cSrcweir     if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_BUTTON_BIGSIZE), sal_True, &pItem) )
543cdf0e10cSrcweir     {
544cdf0e10cSrcweir         DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
545cdf0e10cSrcweir 		sal_Bool bBigSize = ( (const SfxBoolItem*)pItem )->GetValue();
546cdf0e10cSrcweir         aMiscOptions.SetSymbolsSize(
547cdf0e10cSrcweir             sal::static_int_cast< sal_Int16 >(
548cdf0e10cSrcweir                 bBigSize ? SFX_SYMBOLS_SIZE_LARGE : SFX_SYMBOLS_SIZE_SMALL ) );
549cdf0e10cSrcweir         SfxViewFrame* pCurrViewFrame = SfxViewFrame::GetFirst();
550cdf0e10cSrcweir         while ( pCurrViewFrame )
551cdf0e10cSrcweir         {
552cdf0e10cSrcweir             // update all "final" dispatchers
553cdf0e10cSrcweir             if ( !pCurrViewFrame->GetActiveChildFrame_Impl() )
554cdf0e10cSrcweir                 pCurrViewFrame->GetDispatcher()->Update_Impl(sal_True);
555cdf0e10cSrcweir             pCurrViewFrame = SfxViewFrame::GetNext(*pCurrViewFrame);
556cdf0e10cSrcweir         }
557cdf0e10cSrcweir     }
558cdf0e10cSrcweir 
559cdf0e10cSrcweir 	// Backup
560cdf0e10cSrcweir     if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_BACKUP), sal_True, &pItem) )
561cdf0e10cSrcweir     {
562cdf0e10cSrcweir         DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
563cdf0e10cSrcweir         aSaveOptions.SetBackup( ( (const SfxBoolItem*)pItem )->GetValue() );
564cdf0e10cSrcweir     }
565cdf0e10cSrcweir 
566cdf0e10cSrcweir 	// PrettyPrinting
567cdf0e10cSrcweir     if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_ATTR_PRETTYPRINTING ), sal_True, &pItem ) )
568cdf0e10cSrcweir     {
569cdf0e10cSrcweir         DBG_ASSERT( pItem->ISA( SfxBoolItem ), "BoolItem expected" );
570cdf0e10cSrcweir         aSaveOptions.SetPrettyPrinting( static_cast< const SfxBoolItem*> ( pItem )->GetValue() );
571cdf0e10cSrcweir     }
572cdf0e10cSrcweir 
573cdf0e10cSrcweir     // WarnAlienFormat
574cdf0e10cSrcweir     if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_ATTR_WARNALIENFORMAT ), sal_True, &pItem ) )
575cdf0e10cSrcweir     {
576cdf0e10cSrcweir         DBG_ASSERT( pItem->ISA( SfxBoolItem ), "BoolItem expected" );
577cdf0e10cSrcweir         aSaveOptions.SetWarnAlienFormat( static_cast< const SfxBoolItem*> ( pItem )->GetValue() );
578cdf0e10cSrcweir     }
579cdf0e10cSrcweir 
580cdf0e10cSrcweir 	// AutoSave
581cdf0e10cSrcweir     if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOSAVE), sal_True, &pItem))
582cdf0e10cSrcweir     {
583cdf0e10cSrcweir         DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
584cdf0e10cSrcweir         aSaveOptions.SetAutoSave( ( (const SfxBoolItem*)pItem )->GetValue() );
585cdf0e10cSrcweir     }
586cdf0e10cSrcweir 
587cdf0e10cSrcweir 	// AutoSave-Propt
588cdf0e10cSrcweir     if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOSAVEPROMPT), sal_True, &pItem))
589cdf0e10cSrcweir     {
590cdf0e10cSrcweir         DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
591cdf0e10cSrcweir         aSaveOptions.SetAutoSavePrompt(((const SfxBoolItem *)pItem)->GetValue());
592cdf0e10cSrcweir     }
593cdf0e10cSrcweir 
594cdf0e10cSrcweir 	// AutoSave-Time
595cdf0e10cSrcweir     if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOSAVEMINUTE), sal_True, &pItem))
596cdf0e10cSrcweir     {
597cdf0e10cSrcweir         DBG_ASSERT(pItem->ISA(SfxUInt16Item), "UInt16Item expected");
598cdf0e10cSrcweir         aSaveOptions.SetAutoSaveTime(((const SfxUInt16Item *)pItem)->GetValue());
599cdf0e10cSrcweir     }
600cdf0e10cSrcweir 
601cdf0e10cSrcweir 	// DocInfo
602cdf0e10cSrcweir     if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_DOCINFO), sal_True, &pItem))
603cdf0e10cSrcweir     {
604cdf0e10cSrcweir         DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
605cdf0e10cSrcweir         aSaveOptions.SetDocInfoSave(((const SfxBoolItem *)pItem)->GetValue());
606cdf0e10cSrcweir     }
607cdf0e10cSrcweir 
608cdf0e10cSrcweir 	// offende Dokumente merken
609cdf0e10cSrcweir     if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_WORKINGSET), sal_True, &pItem))
610cdf0e10cSrcweir     {
611cdf0e10cSrcweir         DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
612cdf0e10cSrcweir         aSaveOptions.SetSaveWorkingSet(((const SfxBoolItem *)pItem)->GetValue());
613cdf0e10cSrcweir     }
614cdf0e10cSrcweir 
615cdf0e10cSrcweir 	// Fenster-Einstellung speichern
616cdf0e10cSrcweir     if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_SAVEDOCVIEW), sal_True, &pItem))
617cdf0e10cSrcweir     {
618cdf0e10cSrcweir         DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
619cdf0e10cSrcweir         aSaveOptions.SetSaveDocView(((const SfxBoolItem *)pItem)->GetValue());
620cdf0e10cSrcweir     }
621cdf0e10cSrcweir 
622cdf0e10cSrcweir 	// Metric
623cdf0e10cSrcweir     if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_METRIC), sal_True, &pItem))
624cdf0e10cSrcweir     {
625cdf0e10cSrcweir         DBG_ASSERT(pItem->ISA(SfxUInt16Item), "UInt16Item expected");
626cdf0e10cSrcweir //        pOptions->SetMetric((FieldUnit)((const SfxUInt16Item*)pItem)->GetValue());
627cdf0e10cSrcweir     }
628cdf0e10cSrcweir 
629cdf0e10cSrcweir 	// HelpBalloons
630cdf0e10cSrcweir     if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_HELPBALLOONS), sal_True, &pItem))
631cdf0e10cSrcweir     {
632cdf0e10cSrcweir         DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
633cdf0e10cSrcweir         aHelpOptions.SetExtendedHelp(((const SfxBoolItem *)pItem)->GetValue());
634cdf0e10cSrcweir     }
635cdf0e10cSrcweir 
636cdf0e10cSrcweir 	// HelpTips
637cdf0e10cSrcweir     if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_HELPTIPS), sal_True, &pItem))
638cdf0e10cSrcweir     {
639cdf0e10cSrcweir         DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
640cdf0e10cSrcweir         aHelpOptions.SetHelpTips(((const SfxBoolItem *)pItem)->GetValue());
641cdf0e10cSrcweir     }
642cdf0e10cSrcweir 
643cdf0e10cSrcweir 	// AutoHelpAgent
644cdf0e10cSrcweir     if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOHELPAGENT ), sal_True, &pItem))
645cdf0e10cSrcweir     {
646cdf0e10cSrcweir         DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
647cdf0e10cSrcweir         aHelpOptions.SetHelpAgentAutoStartMode( ((const SfxBoolItem *)pItem)->GetValue() );
648cdf0e10cSrcweir     }
649cdf0e10cSrcweir 
650cdf0e10cSrcweir 	// help agent timeout
651cdf0e10cSrcweir     if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_HELPAGENT_TIMEOUT ), sal_True, &pItem ) )
652cdf0e10cSrcweir     {
653cdf0e10cSrcweir         DBG_ASSERT(pItem->ISA(SfxInt32Item), "Int32Item expected");
654cdf0e10cSrcweir 		aHelpOptions.SetHelpAgentTimeoutPeriod( ( (const SfxInt32Item*)pItem )->GetValue() );
655cdf0e10cSrcweir     }
656cdf0e10cSrcweir 
657cdf0e10cSrcweir 	// WelcomeScreen
658cdf0e10cSrcweir     if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_WELCOMESCREEN ), sal_True, &pItem))
659cdf0e10cSrcweir     {
660cdf0e10cSrcweir         DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
661cdf0e10cSrcweir         aHelpOptions.SetWelcomeScreen( ((const SfxBoolItem *)pItem)->GetValue() );
662cdf0e10cSrcweir     }
663cdf0e10cSrcweir 
664cdf0e10cSrcweir 	// WelcomeScreen
665cdf0e10cSrcweir     if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_WELCOMESCREEN_RESET ), sal_True, &pItem))
666cdf0e10cSrcweir     {
667cdf0e10cSrcweir         DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
668cdf0e10cSrcweir 		sal_Bool bReset = ((const SfxBoolItem *)pItem)->GetValue();
669cdf0e10cSrcweir 		if ( bReset )
670cdf0e10cSrcweir 		{
671cdf0e10cSrcweir             DBG_ERROR( "Not implemented, may be EOL!" );
672cdf0e10cSrcweir         }                                                   }
673cdf0e10cSrcweir 
674cdf0e10cSrcweir     if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_HELP_STYLESHEET ), sal_True, &pItem))
675cdf0e10cSrcweir     {
676cdf0e10cSrcweir         DBG_ASSERT(pItem->ISA(SfxStringItem), "StringItem expected");
677cdf0e10cSrcweir         aHelpOptions.SetHelpStyleSheet( ((const SfxStringItem *)pItem)->GetValue() );
678cdf0e10cSrcweir     }
679cdf0e10cSrcweir 
680cdf0e10cSrcweir     // SaveRelINet
681cdf0e10cSrcweir     if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_SAVEREL_INET), sal_True, &pItem))
682cdf0e10cSrcweir     {
683cdf0e10cSrcweir         DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
684cdf0e10cSrcweir         aSaveOptions.SetSaveRelINet(((const SfxBoolItem *)pItem)->GetValue());
685cdf0e10cSrcweir     }
686cdf0e10cSrcweir 
687cdf0e10cSrcweir 	// SaveRelFSys
688cdf0e10cSrcweir     if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_SAVEREL_FSYS), sal_True, &pItem))
689cdf0e10cSrcweir     {
690cdf0e10cSrcweir         DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
691cdf0e10cSrcweir         aSaveOptions.SetSaveRelFSys(((const SfxBoolItem *)pItem)->GetValue());
692cdf0e10cSrcweir     }
693cdf0e10cSrcweir 
694cdf0e10cSrcweir 	// Undo-Count
695cdf0e10cSrcweir     if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_UNDO_COUNT), sal_True, &pItem))
696cdf0e10cSrcweir     {
697cdf0e10cSrcweir         DBG_ASSERT(pItem->ISA(SfxUInt16Item), "UInt16Item expected");
698cdf0e10cSrcweir         sal_uInt16 nUndoCount = ((const SfxUInt16Item*)pItem)->GetValue();
699cdf0e10cSrcweir         aUndoOptions.SetUndoCount( nUndoCount );
700cdf0e10cSrcweir 
701cdf0e10cSrcweir         // um alle Undo-Manager zu erwischen: "uber alle Frames iterieren
702cdf0e10cSrcweir         for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst();
703cdf0e10cSrcweir               pFrame;
704cdf0e10cSrcweir               pFrame = SfxViewFrame::GetNext(*pFrame) )
705cdf0e10cSrcweir         {
706cdf0e10cSrcweir             // den Dispatcher des Frames rausholen
707cdf0e10cSrcweir             SfxDispatcher *pDispat = pFrame->GetDispatcher();
708cdf0e10cSrcweir             pDispat->Flush();
709cdf0e10cSrcweir 
710cdf0e10cSrcweir             // "uber alle SfxShells auf dem Stack des Dispatchers iterieren
711cdf0e10cSrcweir             sal_uInt16 nIdx = 0;
712cdf0e10cSrcweir             for ( SfxShell *pSh = pDispat->GetShell(nIdx);
713cdf0e10cSrcweir                   pSh;
714cdf0e10cSrcweir                   ++nIdx, pSh = pDispat->GetShell(nIdx) )
715cdf0e10cSrcweir             {
716cdf0e10cSrcweir                 ::svl::IUndoManager *pShUndoMgr = pSh->GetUndoManager();
717cdf0e10cSrcweir                 if ( pShUndoMgr )
718cdf0e10cSrcweir                     pShUndoMgr->SetMaxUndoActionCount( nUndoCount );
719cdf0e10cSrcweir             }
720cdf0e10cSrcweir         }
721cdf0e10cSrcweir     }
722cdf0e10cSrcweir 
723cdf0e10cSrcweir 	// Office autostart
724cdf0e10cSrcweir     if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_QUICKLAUNCHER), sal_True, &pItem))
725cdf0e10cSrcweir     {
726cdf0e10cSrcweir         DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
727cdf0e10cSrcweir         ShutdownIcon::SetAutostart( ( (const SfxBoolItem*)pItem )->GetValue() != sal_False );
728cdf0e10cSrcweir     }
729cdf0e10cSrcweir 
730cdf0e10cSrcweir 	// StarBasic Enable
731cdf0e10cSrcweir 	if ( SFX_ITEM_SET == rSet.GetItemState(SID_BASIC_ENABLED, sal_True, &pItem))
732cdf0e10cSrcweir     {
733cdf0e10cSrcweir 		DBG_ASSERT(pItem->ISA(SfxUInt16Item), "SfxInt16Item expected");
734cdf0e10cSrcweir 		aSecurityOptions.SetBasicMode( (EBasicSecurityMode)( (const SfxUInt16Item*)pItem )->GetValue() );
735cdf0e10cSrcweir     }
736cdf0e10cSrcweir 
737cdf0e10cSrcweir 	// Execute PlugIns
738cdf0e10cSrcweir 	if ( SFX_ITEM_SET == rSet.GetItemState(SID_INET_EXE_PLUGIN, sal_True, &pItem))
739cdf0e10cSrcweir     {
740cdf0e10cSrcweir 		DBG_ASSERT(pItem->ISA(SfxBoolItem), "SfxBoolItem expected");
741cdf0e10cSrcweir         aSecurityOptions.SetExecutePlugins( ( (const SfxBoolItem *)pItem )->GetValue() );
742cdf0e10cSrcweir 		bResetSession = sal_True;
743cdf0e10cSrcweir     }
744cdf0e10cSrcweir 
745cdf0e10cSrcweir     if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_INET_PROXY_TYPE), sal_True, &pItem))
746cdf0e10cSrcweir     {
747cdf0e10cSrcweir         DBG_ASSERT( pItem->ISA(SfxUInt16Item), "UInt16Item expected" );
748cdf0e10cSrcweir         aInetOptions.SetProxyType((SvtInetOptions::ProxyType)( (const SfxUInt16Item*)pItem )->GetValue());
749cdf0e10cSrcweir         bResetSession = sal_True;
750cdf0e10cSrcweir         bProxiesModified = sal_True;
751cdf0e10cSrcweir     }
752cdf0e10cSrcweir 
753cdf0e10cSrcweir     if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_HTTP_PROXY_NAME ), sal_True, &pItem ) )
754cdf0e10cSrcweir     {
755cdf0e10cSrcweir         DBG_ASSERT( pItem->ISA(SfxStringItem), "StringItem expected" );
756cdf0e10cSrcweir         aInetOptions.SetProxyHttpName( ((const SfxStringItem *)pItem)->GetValue() );
757cdf0e10cSrcweir         bResetSession = sal_True;
758cdf0e10cSrcweir         bProxiesModified = sal_True;
759cdf0e10cSrcweir     }
760cdf0e10cSrcweir     if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_HTTP_PROXY_PORT ), sal_True, &pItem ) )
761cdf0e10cSrcweir     {
762cdf0e10cSrcweir         DBG_ASSERT( pItem->ISA(SfxInt32Item), "Int32Item expected" );
763cdf0e10cSrcweir         aInetOptions.SetProxyHttpPort( ( (const SfxInt32Item*)pItem )->GetValue() );
764cdf0e10cSrcweir         bResetSession = sal_True;
765cdf0e10cSrcweir         bProxiesModified = sal_True;
766cdf0e10cSrcweir     }
767cdf0e10cSrcweir     if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_FTP_PROXY_NAME ), sal_True, &pItem ) )
768cdf0e10cSrcweir     {
769cdf0e10cSrcweir         DBG_ASSERT( pItem->ISA(SfxStringItem), "StringItem expected" );
770cdf0e10cSrcweir         aInetOptions.SetProxyFtpName( ((const SfxStringItem *)pItem)->GetValue() );
771cdf0e10cSrcweir         bResetSession = sal_True;
772cdf0e10cSrcweir         bProxiesModified = sal_True;
773cdf0e10cSrcweir     }
774cdf0e10cSrcweir     if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_FTP_PROXY_PORT ), sal_True, &pItem ) )
775cdf0e10cSrcweir     {
776cdf0e10cSrcweir         DBG_ASSERT( pItem->ISA(SfxInt32Item), "Int32Item expected" );
777cdf0e10cSrcweir         aInetOptions.SetProxyFtpPort( ( (const SfxInt32Item*)pItem )->GetValue() );
778cdf0e10cSrcweir         bResetSession = sal_True;
779cdf0e10cSrcweir         bProxiesModified = sal_True;
780cdf0e10cSrcweir     }
781cdf0e10cSrcweir     if ( SFX_ITEM_SET == rSet.GetItemState(SID_INET_NOPROXY, sal_True, &pItem))
782cdf0e10cSrcweir     {
783cdf0e10cSrcweir         DBG_ASSERT(pItem->ISA(SfxStringItem), "StringItem expected");
784cdf0e10cSrcweir         aInetOptions.SetProxyNoProxy(((const SfxStringItem *)pItem)->GetValue());
785cdf0e10cSrcweir         bResetSession = sal_True;
786cdf0e10cSrcweir         bProxiesModified = sal_True;
787cdf0e10cSrcweir     }
788cdf0e10cSrcweir 
789cdf0e10cSrcweir 	// Secure-Referers
790cdf0e10cSrcweir 	if ( SFX_ITEM_SET == rSet.GetItemState(SID_SECURE_URL, sal_True, &pItem))
791cdf0e10cSrcweir     {
792cdf0e10cSrcweir 		DELETEZ(pAppData_Impl->pSecureURLs);
793cdf0e10cSrcweir 
794cdf0e10cSrcweir 		DBG_ASSERT(pItem->ISA(SfxStringListItem), "StringListItem expected");
795cdf0e10cSrcweir 		const List *pList = ((SfxStringListItem*)pItem)->GetList();
796cdf0e10cSrcweir 		sal_uInt32 nCount = pList->Count();
797cdf0e10cSrcweir 		::com::sun::star::uno::Sequence< ::rtl::OUString > seqURLs(nCount);
798cdf0e10cSrcweir 		for( sal_uInt32 nPosition=0;nPosition<nCount;++nPosition)
799cdf0e10cSrcweir 		{
800cdf0e10cSrcweir 			seqURLs[nPosition] = *(const String*)(pList->GetObject(nPosition));
801cdf0e10cSrcweir 		}
802cdf0e10cSrcweir 		aSecurityOptions.SetSecureURLs( seqURLs );
803cdf0e10cSrcweir     }
804cdf0e10cSrcweir 
805cdf0e10cSrcweir     if ( SFX_ITEM_SET == rSet.GetItemState(SID_MACRO_WARNING, sal_True, &pItem))
806cdf0e10cSrcweir     {
807cdf0e10cSrcweir 		DBG_ASSERT(pItem->ISA(SfxBoolItem), "SfxBoolItem expected");
808cdf0e10cSrcweir         aSecurityOptions.SetWarningEnabled( ( (const SfxBoolItem *)pItem )->GetValue() );
809cdf0e10cSrcweir     }
810cdf0e10cSrcweir     if ( SFX_ITEM_SET == rSet.GetItemState(SID_MACRO_CONFIRMATION, sal_True, &pItem))
811cdf0e10cSrcweir     {
812cdf0e10cSrcweir 		DBG_ASSERT(pItem->ISA(SfxBoolItem), "SfxBoolItem expected");
813cdf0e10cSrcweir         aSecurityOptions.SetConfirmationEnabled( ( (const SfxBoolItem *)pItem )->GetValue() );
814cdf0e10cSrcweir     }
815cdf0e10cSrcweir 
816cdf0e10cSrcweir     // EnableMetafilePrint
817cdf0e10cSrcweir     if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_ENABLE_METAFILEPRINT ), sal_True, &pItem ) )
818cdf0e10cSrcweir     {
819cdf0e10cSrcweir #ifdef ENABLE_MISSINGKEYASSERTIONS//MUSTINI
820cdf0e10cSrcweir 		DBG_ASSERT(sal_False, "SfxApplication::SetOptions_Impl()\nsoffice.ini key \"MetafilPrint\" not supported any longer!\n");
821cdf0e10cSrcweir #endif
822cdf0e10cSrcweir     }
823cdf0e10cSrcweir 
824cdf0e10cSrcweir 	// geaenderte Daten speichern
825cdf0e10cSrcweir 	aInetOptions.flush();
826cdf0e10cSrcweir }
827cdf0e10cSrcweir 
828cdf0e10cSrcweir //--------------------------------------------------------------------
SetOptions(const SfxItemSet & rSet)829cdf0e10cSrcweir void SfxApplication::SetOptions(const SfxItemSet &rSet)
830cdf0e10cSrcweir {
831cdf0e10cSrcweir 	SvtPathOptions aPathOptions;
832cdf0e10cSrcweir 
833cdf0e10cSrcweir 	// Daten werden in DocInfo und IniManager gespeichert
834cdf0e10cSrcweir     const SfxPoolItem *pItem = 0;
835cdf0e10cSrcweir     SfxItemPool &rPool = GetPool();
836cdf0e10cSrcweir 
837cdf0e10cSrcweir 	SfxAllItemSet aSendSet( rSet );
838cdf0e10cSrcweir 
839cdf0e10cSrcweir 	// PathName
840cdf0e10cSrcweir     if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_PATHNAME), sal_True, &pItem))
841cdf0e10cSrcweir     {
842cdf0e10cSrcweir         DBG_ASSERT(pItem->ISA(SfxAllEnumItem), "AllEnumItem expected");
843cdf0e10cSrcweir 		const SfxAllEnumItem* pEnumItem = (const SfxAllEnumItem *)pItem;
844cdf0e10cSrcweir 		sal_uInt32 nCount = pEnumItem->GetValueCount();
845cdf0e10cSrcweir 		String aNoChangeStr( ' ' );
846cdf0e10cSrcweir 		for( sal_uInt32 nPath=0; nPath<nCount; ++nPath )
847cdf0e10cSrcweir 		{
848cdf0e10cSrcweir 			String sValue = pEnumItem->GetValueTextByPos((sal_uInt16)nPath);
849cdf0e10cSrcweir 			if ( sValue != aNoChangeStr )
850cdf0e10cSrcweir 			{
851cdf0e10cSrcweir 				switch( nPath )
852cdf0e10cSrcweir 				{
853cdf0e10cSrcweir                     case SvtPathOptions::PATH_ADDIN:
854cdf0e10cSrcweir                     {
855cdf0e10cSrcweir                         String aTmp;
856cdf0e10cSrcweir                         if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( sValue, aTmp ) )
857cdf0e10cSrcweir                             aPathOptions.SetAddinPath( aTmp );
858cdf0e10cSrcweir                         break;
859cdf0e10cSrcweir                     }
860cdf0e10cSrcweir 
861cdf0e10cSrcweir 					case SvtPathOptions::PATH_AUTOCORRECT:	aPathOptions.SetAutoCorrectPath( sValue );break;
862cdf0e10cSrcweir 					case SvtPathOptions::PATH_AUTOTEXT:		aPathOptions.SetAutoTextPath( sValue );break;
863cdf0e10cSrcweir 					case SvtPathOptions::PATH_BACKUP:		aPathOptions.SetBackupPath( sValue );break;
864cdf0e10cSrcweir 					case SvtPathOptions::PATH_BASIC:		aPathOptions.SetBasicPath( sValue );break;
865cdf0e10cSrcweir 					case SvtPathOptions::PATH_BITMAP:		aPathOptions.SetBitmapPath( sValue );break;
866cdf0e10cSrcweir 					case SvtPathOptions::PATH_CONFIG:		aPathOptions.SetConfigPath( sValue );break;
867cdf0e10cSrcweir 					case SvtPathOptions::PATH_DICTIONARY:	aPathOptions.SetDictionaryPath( sValue );break;
868cdf0e10cSrcweir 					case SvtPathOptions::PATH_FAVORITES:	aPathOptions.SetFavoritesPath( sValue );break;
869cdf0e10cSrcweir                     case SvtPathOptions::PATH_FILTER:
870cdf0e10cSrcweir                     {
871cdf0e10cSrcweir                         String aTmp;
872cdf0e10cSrcweir                         if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( sValue, aTmp ) )
873cdf0e10cSrcweir                             aPathOptions.SetFilterPath( aTmp );
874cdf0e10cSrcweir                         break;
875cdf0e10cSrcweir                     }
876cdf0e10cSrcweir 					case SvtPathOptions::PATH_GALLERY:		aPathOptions.SetGalleryPath( sValue );break;
877cdf0e10cSrcweir 					case SvtPathOptions::PATH_GRAPHIC:		aPathOptions.SetGraphicPath( sValue );break;
878cdf0e10cSrcweir                     case SvtPathOptions::PATH_HELP:
879cdf0e10cSrcweir                     {
880cdf0e10cSrcweir                         String aTmp;
881cdf0e10cSrcweir                         if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( sValue, aTmp ) )
882cdf0e10cSrcweir                             aPathOptions.SetHelpPath( aTmp );
883cdf0e10cSrcweir                         break;
884cdf0e10cSrcweir                     }
885cdf0e10cSrcweir 
886cdf0e10cSrcweir 					case SvtPathOptions::PATH_LINGUISTIC:	aPathOptions.SetLinguisticPath( sValue );break;
887cdf0e10cSrcweir                     case SvtPathOptions::PATH_MODULE:
888cdf0e10cSrcweir                     {
889cdf0e10cSrcweir                         String aTmp;
890cdf0e10cSrcweir                         if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( sValue, aTmp ) )
891cdf0e10cSrcweir                             aPathOptions.SetModulePath( aTmp );
892cdf0e10cSrcweir                         break;
893cdf0e10cSrcweir                     }
894cdf0e10cSrcweir 
895cdf0e10cSrcweir 					case SvtPathOptions::PATH_PALETTE:		aPathOptions.SetPalettePath( sValue );break;
896cdf0e10cSrcweir                     case SvtPathOptions::PATH_PLUGIN:
897cdf0e10cSrcweir                     {
898cdf0e10cSrcweir                         String aTmp;
899cdf0e10cSrcweir                         if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( sValue, aTmp ) )
900cdf0e10cSrcweir                             aPathOptions.SetPluginPath( aTmp );
901cdf0e10cSrcweir                         break;
902cdf0e10cSrcweir                     }
903cdf0e10cSrcweir 
904cdf0e10cSrcweir                     case SvtPathOptions::PATH_STORAGE:
905cdf0e10cSrcweir                     {
906cdf0e10cSrcweir                         String aTmp;
907cdf0e10cSrcweir                         if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( sValue, aTmp ) )
908cdf0e10cSrcweir                             aPathOptions.SetStoragePath( aTmp );
909cdf0e10cSrcweir                         break;
910cdf0e10cSrcweir                     }
911cdf0e10cSrcweir 
912cdf0e10cSrcweir 					case SvtPathOptions::PATH_TEMP:			aPathOptions.SetTempPath( sValue );break;
913cdf0e10cSrcweir 					case SvtPathOptions::PATH_TEMPLATE:		aPathOptions.SetTemplatePath( sValue );break;
914cdf0e10cSrcweir 					case SvtPathOptions::PATH_USERCONFIG:	aPathOptions.SetUserConfigPath( sValue );break;
915cdf0e10cSrcweir 					case SvtPathOptions::PATH_WORK:			aPathOptions.SetWorkPath( sValue );break;
916cdf0e10cSrcweir 					default: DBG_ERRORFILE("SfxApplication::SetOptions_Impl()\nInvalid path number found for set directories!");
917cdf0e10cSrcweir 				}
918cdf0e10cSrcweir 			}
919cdf0e10cSrcweir 		}
920cdf0e10cSrcweir 
921cdf0e10cSrcweir 		aSendSet.ClearItem( rPool.GetWhich( SID_ATTR_PATHNAME ) );
922cdf0e10cSrcweir     }
923cdf0e10cSrcweir 
924cdf0e10cSrcweir 	SetOptions_Impl( rSet );
925cdf0e10cSrcweir 
926cdf0e10cSrcweir 	// Undo-Count
927cdf0e10cSrcweir 	Broadcast( SfxItemSetHint( rSet ) );
928cdf0e10cSrcweir }
929cdf0e10cSrcweir 
930cdf0e10cSrcweir //--------------------------------------------------------------------
931cdf0e10cSrcweir 
932cdf0e10cSrcweir // alle Dokumente speichern
933cdf0e10cSrcweir 
SaveAll_Impl(sal_Bool bPrompt,sal_Bool bAutoSave)934cdf0e10cSrcweir sal_Bool SfxApplication::SaveAll_Impl(sal_Bool bPrompt, sal_Bool bAutoSave)
935cdf0e10cSrcweir {
936cdf0e10cSrcweir     bAutoSave = sal_False; // functionality moved to new AutoRecovery Service!
937cdf0e10cSrcweir 
938cdf0e10cSrcweir     sal_Bool bFunc = sal_True;
939cdf0e10cSrcweir     short nRet;
940cdf0e10cSrcweir 
941cdf0e10cSrcweir     for ( SfxObjectShell *pDoc = SfxObjectShell::GetFirst();
942cdf0e10cSrcweir           pDoc;
943cdf0e10cSrcweir           pDoc = SfxObjectShell::GetNext(*pDoc) )
944cdf0e10cSrcweir     {
945cdf0e10cSrcweir 		if( SFX_CREATE_MODE_STANDARD == pDoc->GetCreateMode() &&
946cdf0e10cSrcweir 			SfxViewFrame::GetFirst(pDoc) &&
947cdf0e10cSrcweir 			!pDoc->IsInModalMode() &&
948cdf0e10cSrcweir 			!pDoc->HasModalViews() )
949cdf0e10cSrcweir 		{
950cdf0e10cSrcweir 			if ( pDoc->GetProgress() == 0 )
951cdf0e10cSrcweir 			{
952cdf0e10cSrcweir 				if ( !pDoc->IsModified() )
953cdf0e10cSrcweir 					continue;
954cdf0e10cSrcweir 
955cdf0e10cSrcweir 				if ( bPrompt || (bAutoSave && !pDoc->HasName()) )
956cdf0e10cSrcweir 					nRet = QuerySave_Impl( *pDoc, bAutoSave );
957cdf0e10cSrcweir 				else
958cdf0e10cSrcweir 					nRet = RET_YES;
959cdf0e10cSrcweir 
960cdf0e10cSrcweir 				if ( nRet == RET_YES )
961cdf0e10cSrcweir 				{
962cdf0e10cSrcweir 					SfxRequest aReq( SID_SAVEDOC, 0, pDoc->GetPool() );
963cdf0e10cSrcweir 					const SfxPoolItem *pPoolItem = pDoc->ExecuteSlot( aReq );
964cdf0e10cSrcweir 					if ( !pPoolItem || !pPoolItem->ISA(SfxBoolItem) ||
965cdf0e10cSrcweir 						!( (const SfxBoolItem*) pPoolItem )->GetValue() )
966cdf0e10cSrcweir 						bFunc = sal_False;
967cdf0e10cSrcweir 				}
968cdf0e10cSrcweir 				else if ( nRet == RET_CANCEL )
969cdf0e10cSrcweir 				{
970cdf0e10cSrcweir 					bFunc = sal_False;
971cdf0e10cSrcweir 					break;
972cdf0e10cSrcweir 				}
973cdf0e10cSrcweir 				else if ( nRet == RET_NO )
974cdf0e10cSrcweir 				{
975cdf0e10cSrcweir 				}
976cdf0e10cSrcweir 			}
977cdf0e10cSrcweir 		}
978cdf0e10cSrcweir     }
979cdf0e10cSrcweir 
980cdf0e10cSrcweir     return bFunc;
981cdf0e10cSrcweir }
982cdf0e10cSrcweir 
983cdf0e10cSrcweir //--------------------------------------------------------------------
984cdf0e10cSrcweir 
985cdf0e10cSrcweir //--------------------------------------------------------------------
NotifyEvent(const SfxEventHint & rEventHint,bool bSynchron)986cdf0e10cSrcweir void SfxApplication::NotifyEvent( const SfxEventHint& rEventHint, bool bSynchron )
987cdf0e10cSrcweir {
988cdf0e10cSrcweir     SfxObjectShell *pDoc = rEventHint.GetObjShell();
989cdf0e10cSrcweir     if ( pDoc && ( pDoc->IsPreview() || !pDoc->Get_Impl()->bInitialized ) )
990cdf0e10cSrcweir         return;
991cdf0e10cSrcweir 
992cdf0e10cSrcweir #ifdef DBG_UTIL
993cdf0e10cSrcweir     //::rtl::OUString aName = SfxEventConfiguration::GetEventName_Impl( rEventHint.GetEventId() );
994cdf0e10cSrcweir     //ByteString aTmp( "SfxEvent: ");
995cdf0e10cSrcweir     //aTmp += ByteString( String(aName), RTL_TEXTENCODING_UTF8 );
996cdf0e10cSrcweir     //DBG_TRACE( aTmp.GetBuffer() );
997cdf0e10cSrcweir #endif
998cdf0e10cSrcweir 
999cdf0e10cSrcweir 	if ( bSynchron )
1000cdf0e10cSrcweir     {
1001cdf0e10cSrcweir #ifdef DBG_UTIL
1002cdf0e10cSrcweir 		if (!pDoc)
1003cdf0e10cSrcweir 		{
1004cdf0e10cSrcweir 			ByteString aTmp( "SfxEvent: ");
1005cdf0e10cSrcweir 			aTmp += ByteString( String( rEventHint.GetEventName() ), RTL_TEXTENCODING_UTF8 );
1006cdf0e10cSrcweir 			DBG_TRACE( aTmp.GetBuffer() );
1007cdf0e10cSrcweir 		}
1008cdf0e10cSrcweir #endif
1009cdf0e10cSrcweir         Broadcast(rEventHint);
1010cdf0e10cSrcweir         if ( pDoc )
1011cdf0e10cSrcweir             pDoc->Broadcast( rEventHint );
1012cdf0e10cSrcweir     }
1013cdf0e10cSrcweir     else
1014cdf0e10cSrcweir         new SfxEventAsyncer_Impl( rEventHint );
1015cdf0e10cSrcweir }
1016cdf0e10cSrcweir 
1017cdf0e10cSrcweir IMPL_OBJHINT( SfxStringHint, String )
1018cdf0e10cSrcweir 
1019