xref: /aoo41x/main/sfx2/source/appl/appmisc.cxx (revision cdf0e10c)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_sfx2.hxx"
30*cdf0e10cSrcweir #include <vcl/status.hxx>
31*cdf0e10cSrcweir #include <vcl/msgbox.hxx>
32*cdf0e10cSrcweir #include <vos/process.hxx>
33*cdf0e10cSrcweir #include <vos/xception.hxx>
34*cdf0e10cSrcweir #include <svl/whiter.hxx>
35*cdf0e10cSrcweir #include <svl/stritem.hxx>
36*cdf0e10cSrcweir #include <svl/intitem.hxx>
37*cdf0e10cSrcweir #include <svl/eitem.hxx>
38*cdf0e10cSrcweir #include <svtools/filter.hxx>
39*cdf0e10cSrcweir #include <unotools/internaloptions.hxx>
40*cdf0e10cSrcweir #include <unotools/pathoptions.hxx>
41*cdf0e10cSrcweir #include <com/sun/star/registry/InvalidRegistryException.hpp>
42*cdf0e10cSrcweir #include <com/sun/star/beans/PropertyValue.hpp>
43*cdf0e10cSrcweir #include <com/sun/star/frame/XFrame.hpp>
44*cdf0e10cSrcweir #include <com/sun/star/util/XURLTransformer.hpp>
45*cdf0e10cSrcweir #include <com/sun/star/frame/XFramesSupplier.hpp>
46*cdf0e10cSrcweir #include <com/sun/star/uno/Reference.h>
47*cdf0e10cSrcweir #include <tools/config.hxx>
48*cdf0e10cSrcweir #include <tools/rcid.h>
49*cdf0e10cSrcweir #include <vos/mutex.hxx>
50*cdf0e10cSrcweir #include <unotools/configmgr.hxx>
51*cdf0e10cSrcweir #include <com/sun/star/frame/XDesktop.hpp>
52*cdf0e10cSrcweir #include <unotools/ucbstreamhelper.hxx>
53*cdf0e10cSrcweir #include <framework/menuconfiguration.hxx>
54*cdf0e10cSrcweir #include <comphelper/processfactory.hxx>
55*cdf0e10cSrcweir #include <unotools/localfilehelper.hxx>
56*cdf0e10cSrcweir #include <unotools/bootstrap.hxx>
57*cdf0e10cSrcweir #include <unotools/moduleoptions.hxx>
58*cdf0e10cSrcweir #include <osl/file.hxx>
59*cdf0e10cSrcweir #include <rtl/bootstrap.hxx>
60*cdf0e10cSrcweir 
61*cdf0e10cSrcweir #include "sfx2/sfxresid.hxx"
62*cdf0e10cSrcweir #include <sfx2/app.hxx>
63*cdf0e10cSrcweir #include "appdata.hxx"
64*cdf0e10cSrcweir #include "arrdecl.hxx"
65*cdf0e10cSrcweir #include <sfx2/tbxctrl.hxx>
66*cdf0e10cSrcweir #include "sfx2/stbitem.hxx"
67*cdf0e10cSrcweir #include <sfx2/mnuitem.hxx>
68*cdf0e10cSrcweir #include <sfx2/docfac.hxx>
69*cdf0e10cSrcweir #include <sfx2/docfile.hxx>
70*cdf0e10cSrcweir #include <sfx2/docfilt.hxx>
71*cdf0e10cSrcweir #include <sfx2/request.hxx>
72*cdf0e10cSrcweir #include <sfx2/bindings.hxx>
73*cdf0e10cSrcweir #include <sfx2/dispatch.hxx>
74*cdf0e10cSrcweir #include "workwin.hxx"
75*cdf0e10cSrcweir #include "intro.hxx"
76*cdf0e10cSrcweir #include <sfx2/fcontnr.hxx>
77*cdf0e10cSrcweir #include "sfxlocal.hrc"
78*cdf0e10cSrcweir #include <sfx2/sfx.hrc>
79*cdf0e10cSrcweir #include "app.hrc"
80*cdf0e10cSrcweir #include <sfx2/templdlg.hxx>
81*cdf0e10cSrcweir #include <sfx2/module.hxx>
82*cdf0e10cSrcweir #include <sfx2/msgpool.hxx>
83*cdf0e10cSrcweir #include <sfx2/viewfrm.hxx>
84*cdf0e10cSrcweir #include "openflag.hxx"
85*cdf0e10cSrcweir #include <sfx2/viewsh.hxx>
86*cdf0e10cSrcweir #include <sfx2/objface.hxx>
87*cdf0e10cSrcweir #include "helper.hxx"	// SfxContentHelper::Kill()
88*cdf0e10cSrcweir 
89*cdf0e10cSrcweir using namespace ::vos;
90*cdf0e10cSrcweir using namespace ::com::sun::star::uno;
91*cdf0e10cSrcweir using namespace ::com::sun::star::util;
92*cdf0e10cSrcweir using namespace ::com::sun::star::beans;
93*cdf0e10cSrcweir using namespace ::com::sun::star::container;
94*cdf0e10cSrcweir 
95*cdf0e10cSrcweir //===================================================================
96*cdf0e10cSrcweir 
97*cdf0e10cSrcweir SV_IMPL_PTRARR( SfxTbxCtrlFactArr_Impl, SfxTbxCtrlFactory* );
98*cdf0e10cSrcweir SV_IMPL_PTRARR( SfxStbCtrlFactArr_Impl, SfxStbCtrlFactory* );
99*cdf0e10cSrcweir SV_IMPL_PTRARR( SfxMenuCtrlFactArr_Impl, SfxMenuCtrlFactory* );
100*cdf0e10cSrcweir SV_IMPL_PTRARR( SfxChildWinFactArr_Impl, SfxChildWinFactory* );
101*cdf0e10cSrcweir SV_IMPL_PTRARR( SfxModuleArr_Impl, SfxModule* );
102*cdf0e10cSrcweir 
103*cdf0e10cSrcweir //===================================================================
104*cdf0e10cSrcweir 
105*cdf0e10cSrcweir #define SfxApplication
106*cdf0e10cSrcweir #include "sfxslots.hxx"
107*cdf0e10cSrcweir 
108*cdf0e10cSrcweir class SfxSpecialConfigError_Impl
109*cdf0e10cSrcweir {
110*cdf0e10cSrcweir 	String aError;
111*cdf0e10cSrcweir 
112*cdf0e10cSrcweir public:
113*cdf0e10cSrcweir 
114*cdf0e10cSrcweir 	SfxSpecialConfigError_Impl( const String& rStr );
115*cdf0e10cSrcweir 	DECL_LINK( TimerHdl, Timer*);
116*cdf0e10cSrcweir };
117*cdf0e10cSrcweir 
118*cdf0e10cSrcweir 
119*cdf0e10cSrcweir SfxSpecialConfigError_Impl::SfxSpecialConfigError_Impl( const String& rStr ) :
120*cdf0e10cSrcweir 	aError( rStr )
121*cdf0e10cSrcweir {
122*cdf0e10cSrcweir 	Timer *pTimer = new Timer;
123*cdf0e10cSrcweir 	pTimer->SetTimeoutHdl( LINK(this, SfxSpecialConfigError_Impl, TimerHdl) );
124*cdf0e10cSrcweir 	pTimer->SetTimeout( 0 );
125*cdf0e10cSrcweir 	pTimer->Start();
126*cdf0e10cSrcweir }
127*cdf0e10cSrcweir 
128*cdf0e10cSrcweir IMPL_LINK( SfxSpecialConfigError_Impl, TimerHdl, Timer*, pTimer )
129*cdf0e10cSrcweir {
130*cdf0e10cSrcweir 	delete pTimer;
131*cdf0e10cSrcweir 	ErrorBox( 0, WinBits( WB_OK ) , aError ).Execute();
132*cdf0e10cSrcweir 	delete this;
133*cdf0e10cSrcweir     SFX_APP()->GetAppDispatcher_Impl()->Execute( SID_QUITAPP );
134*cdf0e10cSrcweir 	return 0L;
135*cdf0e10cSrcweir }
136*cdf0e10cSrcweir 
137*cdf0e10cSrcweir //====================================================================
138*cdf0e10cSrcweir 
139*cdf0e10cSrcweir #define SFX_ITEMTYPE_STATBAR			 4
140*cdf0e10cSrcweir 
141*cdf0e10cSrcweir SFX_IMPL_INTERFACE(SfxApplication,SfxShell,SfxResId(RID_DESKTOP))
142*cdf0e10cSrcweir {
143*cdf0e10cSrcweir     SFX_STATUSBAR_REGISTRATION(SfxResId(SFX_ITEMTYPE_STATBAR));
144*cdf0e10cSrcweir     SFX_CHILDWINDOW_REGISTRATION(SID_DOCKWIN_0);
145*cdf0e10cSrcweir     SFX_CHILDWINDOW_REGISTRATION(SID_DOCKWIN_1);
146*cdf0e10cSrcweir     SFX_CHILDWINDOW_REGISTRATION(SID_DOCKWIN_2);
147*cdf0e10cSrcweir     SFX_CHILDWINDOW_REGISTRATION(SID_DOCKWIN_3);
148*cdf0e10cSrcweir     SFX_CHILDWINDOW_REGISTRATION(SID_DOCKWIN_4);
149*cdf0e10cSrcweir     SFX_CHILDWINDOW_REGISTRATION(SID_DOCKWIN_5);
150*cdf0e10cSrcweir     SFX_CHILDWINDOW_REGISTRATION(SID_DOCKWIN_6);
151*cdf0e10cSrcweir     SFX_CHILDWINDOW_REGISTRATION(SID_DOCKWIN_7);
152*cdf0e10cSrcweir     SFX_CHILDWINDOW_REGISTRATION(SID_DOCKWIN_8);
153*cdf0e10cSrcweir     SFX_CHILDWINDOW_REGISTRATION(SID_DOCKWIN_9);
154*cdf0e10cSrcweir }
155*cdf0e10cSrcweir 
156*cdf0e10cSrcweir //--------------------------------------------------------------------
157*cdf0e10cSrcweir SfxProgress* SfxApplication::GetProgress() const
158*cdf0e10cSrcweir 
159*cdf0e10cSrcweir /*  [Beschreibung]
160*cdf0e10cSrcweir 
161*cdf0e10cSrcweir     Liefert den f"ur die gesamte Applikation laufenden SfxProgress
162*cdf0e10cSrcweir     oder 0, falls keiner f"ur die gesamte Applikation l"auft.
163*cdf0e10cSrcweir 
164*cdf0e10cSrcweir 
165*cdf0e10cSrcweir     [Querverweise]
166*cdf0e10cSrcweir 
167*cdf0e10cSrcweir     <SfxProgress::GetActiveProgress(SfxViewFrame*)>
168*cdf0e10cSrcweir     <SfxViewFrame::GetProgress()const>
169*cdf0e10cSrcweir */
170*cdf0e10cSrcweir 
171*cdf0e10cSrcweir {
172*cdf0e10cSrcweir     return pAppData_Impl->pProgress;
173*cdf0e10cSrcweir }
174*cdf0e10cSrcweir 
175*cdf0e10cSrcweir //------------------------------------------------------------------------
176*cdf0e10cSrcweir 
177*cdf0e10cSrcweir SvUShorts* SfxApplication::GetDisabledSlotList_Impl()
178*cdf0e10cSrcweir {
179*cdf0e10cSrcweir 	sal_Bool bError = sal_False;
180*cdf0e10cSrcweir 	SvUShorts* pList = pAppData_Impl->pDisabledSlotList;
181*cdf0e10cSrcweir 	if ( !pList )
182*cdf0e10cSrcweir 	{
183*cdf0e10cSrcweir 		// Gibt es eine Slotdatei ?
184*cdf0e10cSrcweir         INetURLObject aUserObj( SvtPathOptions().GetUserConfigPath() );
185*cdf0e10cSrcweir         aUserObj.insertName( DEFINE_CONST_UNICODE( "slots.cfg" ) );
186*cdf0e10cSrcweir         SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( aUserObj.GetMainURL( INetURLObject::NO_DECODE ), STREAM_STD_READ );
187*cdf0e10cSrcweir         if ( !pStream || pStream->GetError() == ERRCODE_IO_NOTEXISTS )
188*cdf0e10cSrcweir         {
189*cdf0e10cSrcweir             delete pStream;
190*cdf0e10cSrcweir             INetURLObject aObj( SvtPathOptions().GetConfigPath() );
191*cdf0e10cSrcweir             aObj.insertName( DEFINE_CONST_UNICODE( "slots.cfg" ) );
192*cdf0e10cSrcweir             pStream = ::utl::UcbStreamHelper::CreateStream( aObj.GetMainURL( INetURLObject::NO_DECODE ), STREAM_STD_READ );
193*cdf0e10cSrcweir         }
194*cdf0e10cSrcweir 
195*cdf0e10cSrcweir         sal_Bool bSlotsEnabled = SvtInternalOptions().SlotCFGEnabled();
196*cdf0e10cSrcweir         sal_Bool bSlots = ( pStream && !pStream->GetError() );
197*cdf0e10cSrcweir         if( bSlots && bSlotsEnabled )
198*cdf0e10cSrcweir 		{
199*cdf0e10cSrcweir             // SlotDatei einlesen
200*cdf0e10cSrcweir             String aTitle;
201*cdf0e10cSrcweir             pStream->ReadByteString(aTitle);
202*cdf0e10cSrcweir             if ( aTitle.CompareToAscii("SfxSlotFile" ) == COMPARE_EQUAL )
203*cdf0e10cSrcweir             {
204*cdf0e10cSrcweir                 sal_uInt16 nCount;
205*cdf0e10cSrcweir                 (*pStream) >> nCount;
206*cdf0e10cSrcweir                 pList = pAppData_Impl->pDisabledSlotList =
207*cdf0e10cSrcweir                         new SvUShorts( nCount < 255 ? (sal_Int8) nCount : 255, 255 );
208*cdf0e10cSrcweir 
209*cdf0e10cSrcweir                 sal_uInt16 nSlot;
210*cdf0e10cSrcweir                 for ( sal_uInt16 n=0; n<nCount; n++ )
211*cdf0e10cSrcweir                 {
212*cdf0e10cSrcweir                     (*pStream) >> nSlot;
213*cdf0e10cSrcweir                     pList->Insert( nSlot, n );
214*cdf0e10cSrcweir                 }
215*cdf0e10cSrcweir 
216*cdf0e10cSrcweir                 pStream->ReadByteString(aTitle);
217*cdf0e10cSrcweir                 if ( aTitle.CompareToAscii("END" ) != COMPARE_EQUAL || pStream->GetError() )
218*cdf0e10cSrcweir                 {
219*cdf0e10cSrcweir                     // Lesen schief gegangen
220*cdf0e10cSrcweir                     DELETEZ( pList );
221*cdf0e10cSrcweir                     bError = sal_True;
222*cdf0e10cSrcweir                 }
223*cdf0e10cSrcweir             }
224*cdf0e10cSrcweir             else
225*cdf0e10cSrcweir             {
226*cdf0e10cSrcweir                 // Streamerkennung  fehlgeschlagen
227*cdf0e10cSrcweir                 bError = sal_True;
228*cdf0e10cSrcweir             }
229*cdf0e10cSrcweir 		}
230*cdf0e10cSrcweir         else if ( bSlots != bSlotsEnabled )
231*cdf0e10cSrcweir 		{
232*cdf0e10cSrcweir 			// Wenn kein Slotlist-Eintrag, dann darf auch keine SlotDatei
233*cdf0e10cSrcweir 			// vorhanden sein
234*cdf0e10cSrcweir             bError = sal_True;
235*cdf0e10cSrcweir 		}
236*cdf0e10cSrcweir 
237*cdf0e10cSrcweir         delete pStream;
238*cdf0e10cSrcweir 	}
239*cdf0e10cSrcweir 	else if ( pList == (SvUShorts*) -1L )
240*cdf0e10cSrcweir 	{
241*cdf0e10cSrcweir 		return NULL;
242*cdf0e10cSrcweir 	}
243*cdf0e10cSrcweir 
244*cdf0e10cSrcweir 	if ( !pList )
245*cdf0e10cSrcweir 		pAppData_Impl->pDisabledSlotList = (SvUShorts*) -1L;
246*cdf0e10cSrcweir 
247*cdf0e10cSrcweir 	if ( bError )
248*cdf0e10cSrcweir 	{
249*cdf0e10cSrcweir 		// Wenn ein Sloteintrag vorhanden ist, aber keine oder eine fehlerhafte
250*cdf0e10cSrcweir 		// SlotDatei, oder aber eine Slotdatei, aber kein Sloteintrag, dann
251*cdf0e10cSrcweir 		// gilt dies als fehlerhafte Konfiguration
252*cdf0e10cSrcweir         new SfxSpecialConfigError_Impl( String( SfxResId( RID_SPECIALCONFIG_ERROR ) ) );
253*cdf0e10cSrcweir 	}
254*cdf0e10cSrcweir 
255*cdf0e10cSrcweir    	return pList;
256*cdf0e10cSrcweir }
257*cdf0e10cSrcweir 
258*cdf0e10cSrcweir 
259*cdf0e10cSrcweir SfxModule* SfxApplication::GetModule_Impl()
260*cdf0e10cSrcweir {
261*cdf0e10cSrcweir     SfxModule* pModule = SfxModule::GetActiveModule();
262*cdf0e10cSrcweir     if ( !pModule )
263*cdf0e10cSrcweir         pModule = SfxModule::GetActiveModule( SfxViewFrame::GetFirst( sal_False ) );
264*cdf0e10cSrcweir 	if( pModule )
265*cdf0e10cSrcweir 		return pModule;
266*cdf0e10cSrcweir     else
267*cdf0e10cSrcweir     {
268*cdf0e10cSrcweir         DBG_ERROR( "No module!" );
269*cdf0e10cSrcweir         return NULL;
270*cdf0e10cSrcweir     }
271*cdf0e10cSrcweir }
272*cdf0e10cSrcweir 
273*cdf0e10cSrcweir ISfxTemplateCommon* SfxApplication::GetCurrentTemplateCommon( SfxBindings& rBindings )
274*cdf0e10cSrcweir {
275*cdf0e10cSrcweir 	if( pAppData_Impl->pTemplateCommon )
276*cdf0e10cSrcweir 		return pAppData_Impl->pTemplateCommon;
277*cdf0e10cSrcweir 	SfxChildWindow *pChild = rBindings.GetWorkWindow_Impl()->GetChildWindow_Impl(
278*cdf0e10cSrcweir 		SfxTemplateDialogWrapper::GetChildWindowId() );
279*cdf0e10cSrcweir 	if ( pChild )
280*cdf0e10cSrcweir 		return ((SfxTemplateDialog*) pChild->GetWindow())->GetISfxTemplateCommon();
281*cdf0e10cSrcweir 	return 0;
282*cdf0e10cSrcweir }
283*cdf0e10cSrcweir 
284*cdf0e10cSrcweir SfxResourceManager& SfxApplication::GetResourceManager() const { return *pAppData_Impl->pResMgr; }
285*cdf0e10cSrcweir sal_Bool  SfxApplication::IsDowning() const { return pAppData_Impl->bDowning; }
286*cdf0e10cSrcweir SfxDispatcher* SfxApplication::GetAppDispatcher_Impl() { return pAppData_Impl->pAppDispat; }
287*cdf0e10cSrcweir SfxSlotPool& SfxApplication::GetAppSlotPool_Impl() const { return *pAppData_Impl->pSlotPool; }
288*cdf0e10cSrcweir //SfxOptions&  SfxApplication::GetOptions() { return *pAppData_Impl->pOptions; }
289*cdf0e10cSrcweir //const SfxOptions& SfxApplication::GetOptions() const { return *pAppData_Impl->pOptions; }
290*cdf0e10cSrcweir 
291*cdf0e10cSrcweir static bool impl_loadBitmap(
292*cdf0e10cSrcweir     const rtl::OUString &rPath, const rtl::OUString &rBmpFileName,
293*cdf0e10cSrcweir     Image &rLogo )
294*cdf0e10cSrcweir {
295*cdf0e10cSrcweir     rtl::OUString uri( rPath );
296*cdf0e10cSrcweir     rtl::Bootstrap::expandMacros( uri );
297*cdf0e10cSrcweir     INetURLObject aObj( uri );
298*cdf0e10cSrcweir     aObj.insertName( rBmpFileName );
299*cdf0e10cSrcweir     SvFileStream aStrm( aObj.PathToFileName(), STREAM_STD_READ );
300*cdf0e10cSrcweir     if ( !aStrm.GetError() )
301*cdf0e10cSrcweir     {
302*cdf0e10cSrcweir         // Use graphic class to also support more graphic formats (bmp,png,...)
303*cdf0e10cSrcweir         Graphic aGraphic;
304*cdf0e10cSrcweir 
305*cdf0e10cSrcweir         GraphicFilter* pGF = GraphicFilter::GetGraphicFilter();
306*cdf0e10cSrcweir         pGF->ImportGraphic( aGraphic, String(), aStrm, GRFILTER_FORMAT_DONTKNOW );
307*cdf0e10cSrcweir 
308*cdf0e10cSrcweir         // Default case, we load the intro bitmap from a seperate file
309*cdf0e10cSrcweir         // (e.g. staroffice_intro.bmp or starsuite_intro.bmp)
310*cdf0e10cSrcweir         BitmapEx aBmp = aGraphic.GetBitmapEx();
311*cdf0e10cSrcweir         rLogo = Image( aBmp );
312*cdf0e10cSrcweir         return true;
313*cdf0e10cSrcweir     }
314*cdf0e10cSrcweir     return false;
315*cdf0e10cSrcweir }
316*cdf0e10cSrcweir 
317*cdf0e10cSrcweir /** loads the application logo as used in the about dialog and impress slideshow pause screen */
318*cdf0e10cSrcweir Image SfxApplication::GetApplicationLogo()
319*cdf0e10cSrcweir {
320*cdf0e10cSrcweir 	Image aAppLogo;
321*cdf0e10cSrcweir 
322*cdf0e10cSrcweir     rtl::OUString aAbouts;
323*cdf0e10cSrcweir     bool bLoaded = false;
324*cdf0e10cSrcweir     sal_Int32 nIndex = 0;
325*cdf0e10cSrcweir     do
326*cdf0e10cSrcweir     {
327*cdf0e10cSrcweir         bLoaded = impl_loadBitmap(
328*cdf0e10cSrcweir             rtl::OUString::createFromAscii( "$BRAND_BASE_DIR/program" ),
329*cdf0e10cSrcweir             aAbouts.getToken( 0, ',', nIndex ), aAppLogo );
330*cdf0e10cSrcweir     }
331*cdf0e10cSrcweir     while ( !bLoaded && ( nIndex >= 0 ) );
332*cdf0e10cSrcweir 
333*cdf0e10cSrcweir     // fallback to "about.bmp"
334*cdf0e10cSrcweir     if ( !bLoaded )
335*cdf0e10cSrcweir     {
336*cdf0e10cSrcweir         bLoaded = impl_loadBitmap(
337*cdf0e10cSrcweir             rtl::OUString::createFromAscii( "$BRAND_BASE_DIR/program/edition" ),
338*cdf0e10cSrcweir             rtl::OUString::createFromAscii( "about.png" ), aAppLogo );
339*cdf0e10cSrcweir         if ( !bLoaded )
340*cdf0e10cSrcweir             bLoaded = impl_loadBitmap(
341*cdf0e10cSrcweir                 rtl::OUString::createFromAscii( "$BRAND_BASE_DIR/program/edition" ),
342*cdf0e10cSrcweir                 rtl::OUString::createFromAscii( "about.bmp" ), aAppLogo );
343*cdf0e10cSrcweir     }
344*cdf0e10cSrcweir 
345*cdf0e10cSrcweir     if ( !bLoaded )
346*cdf0e10cSrcweir     {
347*cdf0e10cSrcweir         bLoaded = impl_loadBitmap(
348*cdf0e10cSrcweir             rtl::OUString::createFromAscii( "$BRAND_BASE_DIR/program" ),
349*cdf0e10cSrcweir             rtl::OUString::createFromAscii( "about.png" ), aAppLogo );
350*cdf0e10cSrcweir         if ( !bLoaded )
351*cdf0e10cSrcweir             bLoaded = impl_loadBitmap(
352*cdf0e10cSrcweir                 rtl::OUString::createFromAscii( "$BRAND_BASE_DIR/program" ),
353*cdf0e10cSrcweir                 rtl::OUString::createFromAscii( "about.bmp" ), aAppLogo );
354*cdf0e10cSrcweir     }
355*cdf0e10cSrcweir 
356*cdf0e10cSrcweir 	return aAppLogo;
357*cdf0e10cSrcweir }
358*cdf0e10cSrcweir 
359