update dev300-m58
[ooovba.git] / sfx2 / source / appl / appcfg.cxx
blobc99f00a09df16076a40c286e9ad15f907671bedd
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: appcfg.cxx,v $
10 * $Revision: 1.74 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sfx2.hxx"
33 #include <com/sun/star/uno/Reference.hxx>
34 #include <com/sun/star/frame/XDesktop.hpp>
35 #include <com/sun/star/util/XURLTransformer.hpp>
36 #ifndef _COM_SUN_STAR_BEANS_PropertyValue_HPP_
37 #include <com/sun/star/beans/PropertyValue.hpp>
38 #endif
39 #include <com/sun/star/beans/XPropertySet.hpp>
40 #include <com/sun/star/util/XFlushable.hpp>
42 #ifndef _STDLIB_H
43 #include <stdlib.h>
44 #endif
45 #include <tools/config.hxx>
46 #include <vcl/sound.hxx>
47 #include <vcl/msgbox.hxx>
48 #include <tools/string.hxx>
49 #include <svtools/itempool.hxx>
50 #include <svtools/aeitem.hxx>
51 #include <svtools/slstitm.hxx>
52 #include <svtools/stritem.hxx>
53 #include <svtools/intitem.hxx>
54 #include <svtools/eitem.hxx>
55 #include <svtools/szitem.hxx>
56 #include <svtools/undo.hxx>
58 #define _SVSTDARR_STRINGS
59 #include <svtools/svstdarr.hxx>
60 #include <svtools/ttprops.hxx>
61 #include <sfx2/sfxsids.hrc>
62 #include <sot/exchange.hxx>
64 //#include <svtools/agprop.hxx>
65 #include <sj2/sjapplet.hxx>
66 #include <svtools/isethint.hxx>
68 #include <unotools/configmgr.hxx>
69 #include <tools/urlobj.hxx>
70 #include <tools/wldcrd.hxx>
71 #include <svtools/saveopt.hxx>
72 #include <svtools/helpopt.hxx>
73 #include <svtools/undoopt.hxx>
74 #include <svtools/securityoptions.hxx>
75 #include <svtools/pathoptions.hxx>
76 #include <svtools/inetoptions.hxx>
77 #include <svtools/miscopt.hxx>
78 #include <vcl/toolbox.hxx>
79 #include <unotools/localfilehelper.hxx>
80 #include <comphelper/processfactory.hxx>
81 #include <rtl/ustrbuf.hxx>
82 #include <svtools/misccfg.hxx>
84 #include <sfx2/app.hxx>
85 #include <sfx2/docfile.hxx>
86 #include <sfx2/viewfrm.hxx>
87 #include "sfxhelp.hxx"
88 #include "sfxtypes.hxx"
89 #include <sfx2/dispatch.hxx>
90 #include <sfx2/objsh.hxx>
91 #include "objshimp.hxx"
92 #include <sfx2/viewsh.hxx>
93 #include <sfx2/request.hxx>
94 #include <sfx2/evntconf.hxx>
95 #include "appdata.hxx"
96 #include "workwin.hxx"
97 #include <sfx2/macrconf.hxx>
98 #include "helper.hxx" // SfxContentHelper::...
99 #include "app.hrc"
100 #include "sfxresid.hxx"
101 #include "shutdownicon.hxx"
103 using namespace ::com::sun::star::uno;
104 using namespace ::com::sun::star::util;
105 using namespace ::com::sun::star::frame;
106 using namespace ::com::sun::star::beans;
108 //-------------------------------------------------------------------------
110 class SfxEventAsyncer_Impl : public SfxListener
112 SfxEventHint aHint;
113 Timer* pTimer;
115 public:
117 virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
118 SfxEventAsyncer_Impl( const SfxEventHint& rHint );
119 ~SfxEventAsyncer_Impl();
120 DECL_LINK( TimerHdl, Timer*);
123 // -----------------------------------------------------------------------
125 void SfxEventAsyncer_Impl::Notify( SfxBroadcaster&, const SfxHint& rHint )
127 SfxSimpleHint* pHint = PTR_CAST( SfxSimpleHint, &rHint );
128 if( pHint && pHint->GetId() == SFX_HINT_DYING && pTimer->IsActive() )
130 pTimer->Stop();
131 delete this;
135 // -----------------------------------------------------------------------
137 SfxEventAsyncer_Impl::SfxEventAsyncer_Impl( const SfxEventHint& rHint )
138 : aHint( rHint )
140 if( rHint.GetObjShell() )
141 StartListening( *rHint.GetObjShell() );
142 pTimer = new Timer;
143 pTimer->SetTimeoutHdl( LINK(this, SfxEventAsyncer_Impl, TimerHdl) );
144 pTimer->SetTimeout( 0 );
145 pTimer->Start();
148 // -----------------------------------------------------------------------
150 SfxEventAsyncer_Impl::~SfxEventAsyncer_Impl()
152 delete pTimer;
155 // -----------------------------------------------------------------------
157 IMPL_LINK(SfxEventAsyncer_Impl, TimerHdl, Timer*, pAsyncTimer)
159 (void)pAsyncTimer; // unused variable
160 SfxObjectShellRef xRef( aHint.GetObjShell() );
161 pAsyncTimer->Stop();
162 #ifdef DBG_UTIL
163 ::rtl::OUString aName = SfxEventConfiguration::GetEventName_Impl( aHint.GetEventId() );
164 ByteString aTmp( "SfxEvent: ");
165 aTmp += ByteString( String(aName), RTL_TEXTENCODING_UTF8 );
166 DBG_TRACE( aTmp.GetBuffer() );
167 #endif
168 SFX_APP()->Broadcast( aHint );
169 if ( xRef.Is() )
170 xRef->Broadcast( aHint );
171 delete this;
172 return 0L;
176 //--------------------------------------------------------------------
178 BOOL SfxApplication::GetOptions( SfxItemSet& rSet )
180 BOOL bRet = FALSE;
181 SfxItemPool &rPool = GetPool();
182 String aTRUEStr('1');
184 const USHORT *pRanges = rSet.GetRanges();
185 SvtSaveOptions aSaveOptions;
186 SvtUndoOptions aUndoOptions;
187 SvtHelpOptions aHelpOptions;
188 SvtInetOptions aInetOptions;
189 SvtSecurityOptions aSecurityOptions;
190 SvtMiscOptions aMiscOptions;
192 while ( *pRanges )
194 for(USHORT nWhich = *pRanges++; nWhich <= *pRanges; ++nWhich)
196 switch(nWhich)
198 case SID_ATTR_BUTTON_OUTSTYLE3D :
199 if(rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_BUTTON_OUTSTYLE3D ),
200 aMiscOptions.GetToolboxStyle() != TOOLBOX_STYLE_FLAT)))
201 bRet = TRUE;
202 break;
203 case SID_ATTR_BUTTON_BIGSIZE :
205 if( rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_BUTTON_BIGSIZE ), aMiscOptions.AreCurrentSymbolsLarge() ) ) )
206 bRet = TRUE;
207 break;
209 case SID_ATTR_BACKUP :
211 bRet = TRUE;
212 if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_BACKUP))
213 if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_BACKUP ),aSaveOptions.IsBackup())))
214 bRet = FALSE;
216 break;
217 case SID_ATTR_PRETTYPRINTING:
219 bRet = TRUE;
220 if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_DOPRETTYPRINTING))
221 if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_PRETTYPRINTING ), aSaveOptions.IsPrettyPrinting())))
222 bRet = FALSE;
224 break;
225 case SID_ATTR_WARNALIENFORMAT:
227 bRet = TRUE;
228 if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_WARNALIENFORMAT))
229 if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_WARNALIENFORMAT ), aSaveOptions.IsWarnAlienFormat())))
230 bRet = FALSE;
232 break;
233 case SID_ATTR_AUTOSAVE :
235 bRet = TRUE;
236 if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_AUTOSAVE))
237 if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_AUTOSAVE ), aSaveOptions.IsAutoSave())))
238 bRet = FALSE;
240 break;
241 case SID_ATTR_AUTOSAVEPROMPT :
243 bRet = TRUE;
244 if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_AUTOSAVEPROMPT))
245 if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_AUTOSAVEPROMPT ), aSaveOptions.IsAutoSavePrompt())))
246 bRet = FALSE;
248 break;
249 case SID_ATTR_AUTOSAVEMINUTE :
251 bRet = TRUE;
252 if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_AUTOSAVETIME))
253 if (!rSet.Put( SfxUInt16Item( rPool.GetWhich( SID_ATTR_AUTOSAVEMINUTE ), (UINT16)aSaveOptions.GetAutoSaveTime())))
254 bRet = FALSE;
256 break;
257 case SID_ATTR_DOCINFO :
259 bRet = TRUE;
260 if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_DOCINFSAVE))
261 if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_DOCINFO ), aSaveOptions.IsDocInfoSave())))
262 bRet = FALSE;
264 break;
265 case SID_ATTR_WORKINGSET :
267 bRet = TRUE;
268 if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_SAVEWORKINGSET))
269 if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_WORKINGSET ), aSaveOptions.IsSaveWorkingSet())))
270 bRet = FALSE;
272 break;
273 case SID_ATTR_SAVEDOCWINS :
275 bRet = TRUE;
276 if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_SAVEDOCWINS))
277 if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_SAVEDOCWINS ), aSaveOptions.IsSaveDocWins())))
278 bRet = FALSE;
280 break;
281 case SID_ATTR_SAVEDOCVIEW :
283 bRet = TRUE;
284 if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_SAVEDOCVIEW))
285 if (!rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_SAVEDOCVIEW ), aSaveOptions.IsSaveDocView())))
286 bRet = FALSE;
288 break;
289 case SID_ATTR_METRIC :
290 // if(rSet.Put( SfxUInt16Item( rPool.GetWhich( SID_ATTR_METRIC ),
291 // pOptions->GetMetric() ) ) )
292 // bRet = TRUE;
293 break;
294 case SID_HELPBALLOONS :
295 if(rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_HELPBALLOONS ),
296 aHelpOptions.IsExtendedHelp() ) ) )
297 bRet = TRUE;
298 break;
299 case SID_HELPTIPS :
300 if(rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_HELPTIPS ),
301 aHelpOptions.IsHelpTips() ) ) )
302 bRet = TRUE;
303 break;
304 case SID_ATTR_AUTOHELPAGENT :
305 if(rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_ATTR_AUTOHELPAGENT ),
306 aHelpOptions.IsHelpAgentAutoStartMode() ) ) )
307 bRet = TRUE;
308 break;
309 case SID_HELPAGENT_TIMEOUT :
310 if ( rSet.Put( SfxInt32Item( rPool.GetWhich( SID_HELPAGENT_TIMEOUT ),
311 aHelpOptions.GetHelpAgentTimeoutPeriod() ) ) )
312 bRet = TRUE;
313 break;
314 case SID_ATTR_WELCOMESCREEN :
315 if(rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_ATTR_WELCOMESCREEN ),
316 aHelpOptions.IsWelcomeScreen() ) ) )
317 bRet = TRUE;
318 break;
319 case SID_HELP_STYLESHEET :
320 if(rSet.Put( SfxStringItem ( rPool.GetWhich( SID_HELP_STYLESHEET ),
321 aHelpOptions.GetHelpStyleSheet() ) ) )
322 bRet = TRUE;
323 break;
324 case SID_ATTR_UNDO_COUNT :
325 if(rSet.Put( SfxUInt16Item ( rPool.GetWhich( SID_ATTR_UNDO_COUNT ),
326 (UINT16)aUndoOptions.GetUndoCount() ) ) )
327 bRet = TRUE;
328 break;
329 case SID_ATTR_QUICKLAUNCHER :
331 if ( ShutdownIcon::IsQuickstarterInstalled() )
333 if ( rSet.Put( SfxBoolItem( rPool.GetWhich( SID_ATTR_QUICKLAUNCHER ),
334 ShutdownIcon::GetAutostart() ) ) )
335 bRet = TRUE;
337 else
339 rSet.DisableItem( rPool.GetWhich( SID_ATTR_QUICKLAUNCHER ) );
340 bRet = TRUE;
342 break;
344 case SID_SAVEREL_INET :
346 bRet = TRUE;
347 if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_SAVERELINET))
348 if (!rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_SAVEREL_INET ), aSaveOptions.IsSaveRelINet() )))
349 bRet = FALSE;
351 break;
352 case SID_SAVEREL_FSYS :
354 bRet = TRUE;
355 if (!aSaveOptions.IsReadOnly(SvtSaveOptions::E_SAVERELFSYS))
356 if (!rSet.Put( SfxBoolItem ( rPool.GetWhich( SID_SAVEREL_FSYS ), aSaveOptions.IsSaveRelFSys() )))
357 bRet = FALSE;
359 break;
360 case SID_BASIC_ENABLED :
362 bRet = TRUE;
363 if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::E_BASICMODE))
365 if ( !rSet.Put( SfxUInt16Item( rPool.GetWhich( SID_BASIC_ENABLED ), sal::static_int_cast< UINT16 >(aSecurityOptions.GetBasicMode()))))
366 bRet = FALSE;
369 break;
370 case SID_INET_EXE_PLUGIN :
372 bRet = TRUE;
373 if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::E_EXECUTEPLUGINS))
375 if ( !rSet.Put( SfxBoolItem( SID_INET_EXE_PLUGIN, aSecurityOptions.IsExecutePlugins() ) ) )
376 bRet = FALSE;
379 break;
380 case SID_MACRO_WARNING :
382 bRet = TRUE;
383 if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::E_WARNING))
385 if ( !rSet.Put( SfxBoolItem( SID_MACRO_WARNING, aSecurityOptions.IsWarningEnabled() ) ) )
386 bRet = FALSE;
389 break;
390 case SID_MACRO_CONFIRMATION :
392 bRet = TRUE;
393 if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::E_CONFIRMATION))
395 if ( !rSet.Put( SfxBoolItem( SID_MACRO_CONFIRMATION, aSecurityOptions.IsConfirmationEnabled() ) ) )
396 bRet = FALSE;
399 break;
400 case SID_SECURE_URL :
402 bRet = TRUE;
403 if (!aSecurityOptions.IsReadOnly(SvtSecurityOptions::E_SECUREURLS))
405 ::com::sun::star::uno::Sequence< ::rtl::OUString > seqURLs = aSecurityOptions.GetSecureURLs();
406 List aList;
407 sal_uInt32 nCount = seqURLs.getLength();
408 sal_uInt32 nURL;
409 for( nURL=0; nURL<nCount; ++nURL )
411 aList.Insert( new String( seqURLs[nURL] ), LIST_APPEND );
413 if( !rSet.Put( SfxStringListItem( rPool.GetWhich(SID_SECURE_URL),
414 &aList ) ) )
416 bRet = FALSE;
418 for( nURL=0; nURL<nCount; ++nURL )
420 delete (String*)aList.GetObject(nURL);
422 aList.Clear();
425 break;
426 case SID_ENABLE_METAFILEPRINT :
427 #ifdef ENABLE_MISSINGKEYASSERTIONS//MUSTINI
428 DBG_ASSERT(sal_False, "SfxApplication::GetOptions()\nSoffice.ini key \"Common\\MetafilePrint\" is obsolete! .. How I can support SID_ENABLE_METAFILEPRINT any longer?\n");
429 #endif
430 break;
431 case SID_INET_PROXY_TYPE :
433 if( rSet.Put( SfxUInt16Item ( rPool.GetWhich( SID_INET_PROXY_TYPE ),
434 (UINT16)aInetOptions.GetProxyType() )))
435 bRet = TRUE;
436 break;
438 case SID_INET_HTTP_PROXY_NAME :
440 if ( rSet.Put( SfxStringItem ( rPool.GetWhich(SID_INET_HTTP_PROXY_NAME ),
441 aInetOptions.GetProxyHttpName() )))
442 bRet = TRUE;
443 break;
445 case SID_INET_HTTP_PROXY_PORT :
446 if ( rSet.Put( SfxInt32Item( rPool.GetWhich(SID_INET_HTTP_PROXY_PORT ),
447 aInetOptions.GetProxyHttpPort() )))
448 bRet = TRUE;
449 break;
450 case SID_INET_FTP_PROXY_NAME :
451 if ( rSet.Put( SfxStringItem ( rPool.GetWhich(SID_INET_FTP_PROXY_NAME ),
452 aInetOptions.GetProxyFtpName() )))
453 bRet = TRUE;
454 break;
455 case SID_INET_FTP_PROXY_PORT :
456 if ( rSet.Put( SfxInt32Item ( rPool.GetWhich(SID_INET_FTP_PROXY_PORT ),
457 aInetOptions.GetProxyFtpPort() )))
458 bRet = TRUE;
459 break;
460 case SID_INET_SECURITY_PROXY_NAME :
461 case SID_INET_SECURITY_PROXY_PORT :
462 #ifdef ENABLE_MISSINGKEYASSERTIONS//MUSTINI
463 DBG_ASSERT( sal_False, "SfxApplication::GetOptions()\nSome INET values no longer supported!\n" );
464 #endif
465 break;
466 case SID_INET_NOPROXY :
467 if( rSet.Put( SfxStringItem ( rPool.GetWhich( SID_INET_NOPROXY),
468 aInetOptions.GetProxyNoProxy() )))
469 bRet = TRUE;
470 break;
471 case SID_ATTR_PATHNAME :
472 case SID_ATTR_PATHGROUP :
474 SfxAllEnumItem aNames(rPool.GetWhich(SID_ATTR_PATHGROUP));
475 SfxAllEnumItem aValues(rPool.GetWhich(SID_ATTR_PATHNAME));
476 SvtPathOptions aPathCfg;
477 for ( USHORT nProp = SvtPathOptions::PATH_ADDIN;
478 nProp <= SvtPathOptions::PATH_WORK; nProp++ )
480 const String aName( SfxResId( CONFIG_PATH_START + nProp ) );
481 aNames.InsertValue( nProp, aName );
482 String aValue;
483 switch ( nProp )
485 case SvtPathOptions::PATH_ADDIN: ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aPathCfg.GetAddinPath(), aValue ); break;
486 case SvtPathOptions::PATH_AUTOCORRECT: aValue = aPathCfg.GetAutoCorrectPath(); break;
487 case SvtPathOptions::PATH_AUTOTEXT: aValue = aPathCfg.GetAutoTextPath(); break;
488 case SvtPathOptions::PATH_BACKUP: aValue = aPathCfg.GetBackupPath(); break;
489 case SvtPathOptions::PATH_BASIC: aValue = aPathCfg.GetBasicPath(); break;
490 case SvtPathOptions::PATH_BITMAP: aValue = aPathCfg.GetBitmapPath(); break;
491 case SvtPathOptions::PATH_CONFIG: aValue = aPathCfg.GetConfigPath(); break;
492 case SvtPathOptions::PATH_DICTIONARY: aValue = aPathCfg.GetDictionaryPath(); break;
493 case SvtPathOptions::PATH_FAVORITES: aValue = aPathCfg.GetFavoritesPath(); break;
494 case SvtPathOptions::PATH_FILTER: ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aPathCfg.GetFilterPath(), aValue ); break;
495 case SvtPathOptions::PATH_GALLERY: aValue = aPathCfg.GetGalleryPath(); break;
496 case SvtPathOptions::PATH_GRAPHIC: aValue = aPathCfg.GetGraphicPath(); break;
497 case SvtPathOptions::PATH_HELP: ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aPathCfg.GetHelpPath(), aValue ); break;
498 case SvtPathOptions::PATH_LINGUISTIC: aValue = aPathCfg.GetLinguisticPath(); break;
499 case SvtPathOptions::PATH_MODULE: ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aPathCfg.GetModulePath(), aValue ); break;
500 case SvtPathOptions::PATH_PALETTE: aValue = aPathCfg.GetPalettePath(); break;
501 case SvtPathOptions::PATH_PLUGIN: ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aPathCfg.GetPluginPath(), aValue ); break;
502 case SvtPathOptions::PATH_STORAGE: ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aPathCfg.GetStoragePath(), aValue ); break;
503 case SvtPathOptions::PATH_TEMP: aValue = aPathCfg.GetTempPath(); break;
504 case SvtPathOptions::PATH_TEMPLATE: aValue = aPathCfg.GetTemplatePath(); break;
505 case SvtPathOptions::PATH_USERCONFIG: aValue = aPathCfg.GetUserConfigPath(); break;
506 case SvtPathOptions::PATH_WORK: aValue = aPathCfg.GetWorkPath(); break;
508 aValues.InsertValue( nProp, aValue );
511 if ( rSet.Put(aNames) || rSet.Put(aValues) )
512 bRet = TRUE;
515 default:
516 DBG_WARNING( "W1:Wrong ID while getting Options!" );
517 break;
519 #ifdef DBG_UTIL
520 if ( !bRet )
521 DBG_ERROR( "Putting options failed!" );
522 #endif
524 pRanges++;
527 return bRet;
530 //--------------------------------------------------------------------
531 BOOL SfxApplication::IsSecureURL( const INetURLObject& rURL, const String* pReferer ) const
533 return SvtSecurityOptions().IsSecureURL( rURL.GetMainURL( INetURLObject::NO_DECODE ), *pReferer );
535 //--------------------------------------------------------------------
536 // TODO/CLEANUP: wieso zwei SetOptions Methoden?
537 void SfxApplication::SetOptions_Impl( const SfxItemSet& rSet )
539 const SfxPoolItem *pItem = 0;
540 SfxItemPool &rPool = GetPool();
541 BOOL bResetSession = FALSE;
542 BOOL bProxiesModified = FALSE;
544 SvtSaveOptions aSaveOptions;
545 SvtUndoOptions aUndoOptions;
546 SvtHelpOptions aHelpOptions;
547 SvtSecurityOptions aSecurityOptions;
548 SvtPathOptions aPathOptions;
549 SvtInetOptions aInetOptions;
550 SvtMiscOptions aMiscOptions;
551 if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_BUTTON_OUTSTYLE3D), TRUE, &pItem) )
553 DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
554 USHORT nOutStyle =
555 ( (const SfxBoolItem *)pItem)->GetValue() ? 0 : TOOLBOX_STYLE_FLAT;
556 aMiscOptions.SetToolboxStyle( nOutStyle );
559 if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_BUTTON_BIGSIZE), TRUE, &pItem) )
561 DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
562 BOOL bBigSize = ( (const SfxBoolItem*)pItem )->GetValue();
563 aMiscOptions.SetSymbolsSize(
564 sal::static_int_cast< sal_Int16 >(
565 bBigSize ? SFX_SYMBOLS_SIZE_LARGE : SFX_SYMBOLS_SIZE_SMALL ) );
566 SfxViewFrame* pCurrViewFrame = SfxViewFrame::GetFirst();
567 while ( pCurrViewFrame )
569 // update all "final" dispatchers
570 if ( !pCurrViewFrame->GetActiveChildFrame_Impl() )
571 pCurrViewFrame->GetDispatcher()->Update_Impl(sal_True);
572 pCurrViewFrame = SfxViewFrame::GetNext(*pCurrViewFrame);
576 // Backup
577 if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_BACKUP), TRUE, &pItem) )
579 DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
580 aSaveOptions.SetBackup( ( (const SfxBoolItem*)pItem )->GetValue() );
583 // PrettyPrinting
584 if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_ATTR_PRETTYPRINTING ), TRUE, &pItem ) )
586 DBG_ASSERT( pItem->ISA( SfxBoolItem ), "BoolItem expected" );
587 aSaveOptions.SetPrettyPrinting( static_cast< const SfxBoolItem*> ( pItem )->GetValue() );
590 // WarnAlienFormat
591 if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_ATTR_WARNALIENFORMAT ), TRUE, &pItem ) )
593 DBG_ASSERT( pItem->ISA( SfxBoolItem ), "BoolItem expected" );
594 aSaveOptions.SetWarnAlienFormat( static_cast< const SfxBoolItem*> ( pItem )->GetValue() );
597 // AutoSave
598 if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOSAVE), TRUE, &pItem))
600 DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
601 aSaveOptions.SetAutoSave( ( (const SfxBoolItem*)pItem )->GetValue() );
604 // AutoSave-Propt
605 if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOSAVEPROMPT), TRUE, &pItem))
607 DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
608 aSaveOptions.SetAutoSavePrompt(((const SfxBoolItem *)pItem)->GetValue());
611 // AutoSave-Time
612 if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOSAVEMINUTE), TRUE, &pItem))
614 DBG_ASSERT(pItem->ISA(SfxUInt16Item), "UInt16Item expected");
615 aSaveOptions.SetAutoSaveTime(((const SfxUInt16Item *)pItem)->GetValue());
618 // DocInfo
619 if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_DOCINFO), TRUE, &pItem))
621 DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
622 aSaveOptions.SetDocInfoSave(((const SfxBoolItem *)pItem)->GetValue());
625 // offende Dokumente merken
626 if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_WORKINGSET), TRUE, &pItem))
628 DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
629 aSaveOptions.SetSaveWorkingSet(((const SfxBoolItem *)pItem)->GetValue());
632 // offene Fenster speichern
633 if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_SAVEDOCWINS), TRUE, &pItem))
635 DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
636 aSaveOptions.SetSaveDocWins(((const SfxBoolItem *)pItem)->GetValue());
639 // Fenster-Einstellung speichern
640 if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_SAVEDOCVIEW), TRUE, &pItem))
642 DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
643 aSaveOptions.SetSaveDocView(((const SfxBoolItem *)pItem)->GetValue());
646 // Metric
647 if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_METRIC), TRUE, &pItem))
649 DBG_ASSERT(pItem->ISA(SfxUInt16Item), "UInt16Item expected");
650 // pOptions->SetMetric((FieldUnit)((const SfxUInt16Item*)pItem)->GetValue());
653 // HelpBalloons
654 if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_HELPBALLOONS), TRUE, &pItem))
656 DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
657 aHelpOptions.SetExtendedHelp(((const SfxBoolItem *)pItem)->GetValue());
660 // HelpTips
661 if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_HELPTIPS), TRUE, &pItem))
663 DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
664 aHelpOptions.SetHelpTips(((const SfxBoolItem *)pItem)->GetValue());
667 // AutoHelpAgent
668 if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_AUTOHELPAGENT ), TRUE, &pItem))
670 DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
671 aHelpOptions.SetHelpAgentAutoStartMode( ((const SfxBoolItem *)pItem)->GetValue() );
674 // help agent timeout
675 if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_HELPAGENT_TIMEOUT ), TRUE, &pItem ) )
677 DBG_ASSERT(pItem->ISA(SfxInt32Item), "Int32Item expected");
678 aHelpOptions.SetHelpAgentTimeoutPeriod( ( (const SfxInt32Item*)pItem )->GetValue() );
681 // WelcomeScreen
682 if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_WELCOMESCREEN ), TRUE, &pItem))
684 DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
685 aHelpOptions.SetWelcomeScreen( ((const SfxBoolItem *)pItem)->GetValue() );
688 // WelcomeScreen
689 if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_WELCOMESCREEN_RESET ), TRUE, &pItem))
691 DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
692 BOOL bReset = ((const SfxBoolItem *)pItem)->GetValue();
693 if ( bReset )
695 DBG_ERROR( "Not implemented, may be EOL!" );
698 if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_HELP_STYLESHEET ), TRUE, &pItem))
700 DBG_ASSERT(pItem->ISA(SfxStringItem), "StringItem expected");
701 aHelpOptions.SetHelpStyleSheet( ((const SfxStringItem *)pItem)->GetValue() );
704 // SaveRelINet
705 if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_SAVEREL_INET), TRUE, &pItem))
707 DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
708 aSaveOptions.SetSaveRelINet(((const SfxBoolItem *)pItem)->GetValue());
711 // SaveRelFSys
712 if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_SAVEREL_FSYS), TRUE, &pItem))
714 DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
715 aSaveOptions.SetSaveRelFSys(((const SfxBoolItem *)pItem)->GetValue());
718 // Undo-Count
719 if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_UNDO_COUNT), TRUE, &pItem))
721 DBG_ASSERT(pItem->ISA(SfxUInt16Item), "UInt16Item expected");
722 USHORT nUndoCount = ((const SfxUInt16Item*)pItem)->GetValue();
723 aUndoOptions.SetUndoCount( nUndoCount );
725 // um alle Undo-Manager zu erwischen: "uber alle Frames iterieren
726 for ( SfxViewFrame *pFrame = SfxViewFrame::GetFirst();
727 pFrame;
728 pFrame = SfxViewFrame::GetNext(*pFrame) )
730 // den Dispatcher des Frames rausholen
731 SfxDispatcher *pDispat = pFrame->GetDispatcher();
732 pDispat->Flush();
734 // "uber alle SfxShells auf dem Stack des Dispatchers iterieren
735 USHORT nIdx = 0;
736 for ( SfxShell *pSh = pDispat->GetShell(nIdx);
737 pSh;
738 ++nIdx, pSh = pDispat->GetShell(nIdx) )
740 SfxUndoManager *pShUndoMgr = pSh->GetUndoManager();
741 if ( pShUndoMgr )
742 pShUndoMgr->SetMaxUndoActionCount( nUndoCount );
747 // Office autostart
748 if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_QUICKLAUNCHER), TRUE, &pItem))
750 DBG_ASSERT(pItem->ISA(SfxBoolItem), "BoolItem expected");
751 ShutdownIcon::SetAutostart( ( (const SfxBoolItem*)pItem )->GetValue() != FALSE );
754 // StarBasic Enable
755 if ( SFX_ITEM_SET == rSet.GetItemState(SID_BASIC_ENABLED, TRUE, &pItem))
757 DBG_ASSERT(pItem->ISA(SfxUInt16Item), "SfxInt16Item expected");
758 aSecurityOptions.SetBasicMode( (EBasicSecurityMode)( (const SfxUInt16Item*)pItem )->GetValue() );
761 // Execute PlugIns
762 if ( SFX_ITEM_SET == rSet.GetItemState(SID_INET_EXE_PLUGIN, TRUE, &pItem))
764 DBG_ASSERT(pItem->ISA(SfxBoolItem), "SfxBoolItem expected");
765 aSecurityOptions.SetExecutePlugins( ( (const SfxBoolItem *)pItem )->GetValue() );
766 bResetSession = TRUE;
769 if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_INET_PROXY_TYPE), TRUE, &pItem))
771 DBG_ASSERT( pItem->ISA(SfxUInt16Item), "UInt16Item expected" );
772 aInetOptions.SetProxyType((SvtInetOptions::ProxyType)( (const SfxUInt16Item*)pItem )->GetValue());
773 bResetSession = TRUE;
774 bProxiesModified = TRUE;
777 if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_HTTP_PROXY_NAME ), TRUE, &pItem ) )
779 DBG_ASSERT( pItem->ISA(SfxStringItem), "StringItem expected" );
780 aInetOptions.SetProxyHttpName( ((const SfxStringItem *)pItem)->GetValue() );
781 bResetSession = TRUE;
782 bProxiesModified = TRUE;
784 if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_HTTP_PROXY_PORT ), TRUE, &pItem ) )
786 DBG_ASSERT( pItem->ISA(SfxInt32Item), "Int32Item expected" );
787 aInetOptions.SetProxyHttpPort( ( (const SfxInt32Item*)pItem )->GetValue() );
788 bResetSession = TRUE;
789 bProxiesModified = TRUE;
791 if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_FTP_PROXY_NAME ), TRUE, &pItem ) )
793 DBG_ASSERT( pItem->ISA(SfxStringItem), "StringItem expected" );
794 aInetOptions.SetProxyFtpName( ((const SfxStringItem *)pItem)->GetValue() );
795 bResetSession = TRUE;
796 bProxiesModified = TRUE;
798 if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_INET_FTP_PROXY_PORT ), TRUE, &pItem ) )
800 DBG_ASSERT( pItem->ISA(SfxInt32Item), "Int32Item expected" );
801 aInetOptions.SetProxyFtpPort( ( (const SfxInt32Item*)pItem )->GetValue() );
802 bResetSession = TRUE;
803 bProxiesModified = TRUE;
805 if ( SFX_ITEM_SET == rSet.GetItemState(SID_INET_NOPROXY, TRUE, &pItem))
807 DBG_ASSERT(pItem->ISA(SfxStringItem), "StringItem expected");
808 aInetOptions.SetProxyNoProxy(((const SfxStringItem *)pItem)->GetValue());
809 bResetSession = TRUE;
810 bProxiesModified = TRUE;
813 // Secure-Referers
814 if ( SFX_ITEM_SET == rSet.GetItemState(SID_SECURE_URL, TRUE, &pItem))
816 DELETEZ(pAppData_Impl->pSecureURLs);
818 DBG_ASSERT(pItem->ISA(SfxStringListItem), "StringListItem expected");
819 const List *pList = ((SfxStringListItem*)pItem)->GetList();
820 sal_uInt32 nCount = pList->Count();
821 ::com::sun::star::uno::Sequence< ::rtl::OUString > seqURLs(nCount);
822 for( sal_uInt32 nPosition=0;nPosition<nCount;++nPosition)
824 seqURLs[nPosition] = *(const String*)(pList->GetObject(nPosition));
826 aSecurityOptions.SetSecureURLs( seqURLs );
829 if ( SFX_ITEM_SET == rSet.GetItemState(SID_MACRO_WARNING, TRUE, &pItem))
831 DBG_ASSERT(pItem->ISA(SfxBoolItem), "SfxBoolItem expected");
832 aSecurityOptions.SetWarningEnabled( ( (const SfxBoolItem *)pItem )->GetValue() );
834 if ( SFX_ITEM_SET == rSet.GetItemState(SID_MACRO_CONFIRMATION, TRUE, &pItem))
836 DBG_ASSERT(pItem->ISA(SfxBoolItem), "SfxBoolItem expected");
837 aSecurityOptions.SetConfirmationEnabled( ( (const SfxBoolItem *)pItem )->GetValue() );
840 // EnableMetafilePrint
841 if ( SFX_ITEM_SET == rSet.GetItemState( rPool.GetWhich( SID_ENABLE_METAFILEPRINT ), TRUE, &pItem ) )
843 #ifdef ENABLE_MISSINGKEYASSERTIONS//MUSTINI
844 DBG_ASSERT(sal_False, "SfxApplication::SetOptions_Impl()\nsoffice.ini key \"MetafilPrint\" not supported any longer!\n");
845 #endif
848 // INet Session neu aufsetzen
849 if ( bResetSession )
853 SjApplet2::settingsChanged();
855 catch ( ... )
857 DBG_ERRORFILE( "SjApplet2::settingsChanged() throws an exception" );
861 // geaenderte Daten speichern
862 aInetOptions.flush();
865 //--------------------------------------------------------------------
866 void SfxApplication::SetOptions(const SfxItemSet &rSet)
868 SvtPathOptions aPathOptions;
870 // Daten werden in DocInfo und IniManager gespeichert
871 const SfxPoolItem *pItem = 0;
872 SfxItemPool &rPool = GetPool();
874 SfxAllItemSet aSendSet( rSet );
876 // PathName
877 if ( SFX_ITEM_SET == rSet.GetItemState(rPool.GetWhich(SID_ATTR_PATHNAME), TRUE, &pItem))
879 DBG_ASSERT(pItem->ISA(SfxAllEnumItem), "AllEnumItem expected");
880 const SfxAllEnumItem* pEnumItem = (const SfxAllEnumItem *)pItem;
881 sal_uInt32 nCount = pEnumItem->GetValueCount();
882 String aNoChangeStr( ' ' );
883 for( sal_uInt32 nPath=0; nPath<nCount; ++nPath )
885 String sValue = pEnumItem->GetValueTextByPos((USHORT)nPath);
886 if ( sValue != aNoChangeStr )
888 switch( nPath )
890 case SvtPathOptions::PATH_ADDIN:
892 String aTmp;
893 if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( sValue, aTmp ) )
894 aPathOptions.SetAddinPath( aTmp );
895 break;
898 case SvtPathOptions::PATH_AUTOCORRECT: aPathOptions.SetAutoCorrectPath( sValue );break;
899 case SvtPathOptions::PATH_AUTOTEXT: aPathOptions.SetAutoTextPath( sValue );break;
900 case SvtPathOptions::PATH_BACKUP: aPathOptions.SetBackupPath( sValue );break;
901 case SvtPathOptions::PATH_BASIC: aPathOptions.SetBasicPath( sValue );break;
902 case SvtPathOptions::PATH_BITMAP: aPathOptions.SetBitmapPath( sValue );break;
903 case SvtPathOptions::PATH_CONFIG: aPathOptions.SetConfigPath( sValue );break;
904 case SvtPathOptions::PATH_DICTIONARY: aPathOptions.SetDictionaryPath( sValue );break;
905 case SvtPathOptions::PATH_FAVORITES: aPathOptions.SetFavoritesPath( sValue );break;
906 case SvtPathOptions::PATH_FILTER:
908 String aTmp;
909 if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( sValue, aTmp ) )
910 aPathOptions.SetFilterPath( aTmp );
911 break;
913 case SvtPathOptions::PATH_GALLERY: aPathOptions.SetGalleryPath( sValue );break;
914 case SvtPathOptions::PATH_GRAPHIC: aPathOptions.SetGraphicPath( sValue );break;
915 case SvtPathOptions::PATH_HELP:
917 String aTmp;
918 if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( sValue, aTmp ) )
919 aPathOptions.SetHelpPath( aTmp );
920 break;
923 case SvtPathOptions::PATH_LINGUISTIC: aPathOptions.SetLinguisticPath( sValue );break;
924 case SvtPathOptions::PATH_MODULE:
926 String aTmp;
927 if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( sValue, aTmp ) )
928 aPathOptions.SetModulePath( aTmp );
929 break;
932 case SvtPathOptions::PATH_PALETTE: aPathOptions.SetPalettePath( sValue );break;
933 case SvtPathOptions::PATH_PLUGIN:
935 String aTmp;
936 if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( sValue, aTmp ) )
937 aPathOptions.SetPluginPath( aTmp );
938 break;
941 case SvtPathOptions::PATH_STORAGE:
943 String aTmp;
944 if( ::utl::LocalFileHelper::ConvertURLToPhysicalName( sValue, aTmp ) )
945 aPathOptions.SetStoragePath( aTmp );
946 break;
949 case SvtPathOptions::PATH_TEMP: aPathOptions.SetTempPath( sValue );break;
950 case SvtPathOptions::PATH_TEMPLATE: aPathOptions.SetTemplatePath( sValue );break;
951 case SvtPathOptions::PATH_USERCONFIG: aPathOptions.SetUserConfigPath( sValue );break;
952 case SvtPathOptions::PATH_WORK: aPathOptions.SetWorkPath( sValue );break;
953 default: DBG_ERRORFILE("SfxApplication::SetOptions_Impl()\nInvalid path number found for set directories!");
958 aSendSet.ClearItem( rPool.GetWhich( SID_ATTR_PATHNAME ) );
961 SetOptions_Impl( rSet );
963 // Undo-Count
964 Broadcast( SfxItemSetHint( rSet ) );
967 //--------------------------------------------------------------------
969 // alle Dokumente speichern
971 BOOL SfxApplication::SaveAll_Impl(BOOL bPrompt, BOOL bAutoSave)
973 bAutoSave = FALSE; // functionality moved to new AutoRecovery Service!
975 BOOL bFunc = TRUE;
976 short nRet;
978 for ( SfxObjectShell *pDoc = SfxObjectShell::GetFirst();
979 pDoc;
980 pDoc = SfxObjectShell::GetNext(*pDoc) )
982 if( SFX_CREATE_MODE_STANDARD == pDoc->GetCreateMode() &&
983 SfxViewFrame::GetFirst(pDoc) &&
984 !pDoc->IsInModalMode() &&
985 !pDoc->HasModalViews() )
987 if ( pDoc->GetProgress() == 0 )
989 if ( !pDoc->IsModified() )
990 continue;
992 if ( bPrompt || (bAutoSave && !pDoc->HasName()) )
993 nRet = QuerySave_Impl( *pDoc, bAutoSave );
994 else
995 nRet = RET_YES;
997 if ( nRet == RET_YES )
999 SfxRequest aReq( SID_SAVEDOC, 0, pDoc->GetPool() );
1000 const SfxPoolItem *pPoolItem = pDoc->ExecuteSlot( aReq );
1001 if ( !pPoolItem || !pPoolItem->ISA(SfxBoolItem) ||
1002 !( (const SfxBoolItem*) pPoolItem )->GetValue() )
1003 bFunc = FALSE;
1005 else if ( nRet == RET_CANCEL )
1007 bFunc = FALSE;
1008 break;
1010 else if ( nRet == RET_NO )
1017 return bFunc;
1020 //--------------------------------------------------------------------
1022 SfxMacroConfig* SfxApplication::GetMacroConfig() const
1024 return SfxMacroConfig::GetOrCreate();
1027 //--------------------------------------------------------------------
1028 SfxEventConfiguration* SfxApplication::GetEventConfig() const
1030 if (!pAppData_Impl->pEventConfig)
1031 pAppData_Impl->pEventConfig = new SfxEventConfiguration;
1032 return pAppData_Impl->pEventConfig;
1035 //--------------------------------------------------------------------
1037 //--------------------------------------------------------------------
1038 void SfxApplication::NotifyEvent( const SfxEventHint& rEventHint, FASTBOOL bSynchron )
1040 DBG_ASSERT(pAppData_Impl->pEventConfig,"Keine Events angemeldet!");
1042 SfxObjectShell *pDoc = rEventHint.GetObjShell();
1043 if ( pDoc && ( pDoc->IsPreview() || !pDoc->Get_Impl()->bInitialized ) )
1044 return;
1046 #ifdef DBG_UTIL
1047 ::rtl::OUString aName = SfxEventConfiguration::GetEventName_Impl( rEventHint.GetEventId() );
1048 ByteString aTmp( "SfxEvent: ");
1049 aTmp += ByteString( String(aName), RTL_TEXTENCODING_UTF8 );
1050 DBG_TRACE( aTmp.GetBuffer() );
1051 #endif
1053 if ( bSynchron )
1055 Broadcast(rEventHint);
1056 if ( pDoc )
1057 pDoc->Broadcast( rEventHint );
1059 else
1060 new SfxEventAsyncer_Impl( rEventHint );
1063 IMPL_OBJHINT( SfxStringHint, String )
1065 SfxMiscCfg* SfxApplication::GetMiscConfig()
1067 if ( !pAppData_Impl->pMiscConfig )
1068 pAppData_Impl->pMiscConfig = new SfxMiscCfg;
1070 return pAppData_Impl->pMiscConfig;