diff options
Diffstat (limited to 'sfx2/source/appl/appmisc.cxx')
-rw-r--r-- | sfx2/source/appl/appmisc.cxx | 123 |
1 files changed, 73 insertions, 50 deletions
diff --git a/sfx2/source/appl/appmisc.cxx b/sfx2/source/appl/appmisc.cxx index 94b921f8122e..eafe9d262189 100644 --- a/sfx2/source/appl/appmisc.cxx +++ b/sfx2/source/appl/appmisc.cxx @@ -29,9 +29,7 @@ #include "precompiled_sfx2.hxx" #include <vcl/status.hxx> #include <vcl/msgbox.hxx> -#ifndef _VOS_PROCESS_HXX //autogen #include <vos/process.hxx> -#endif #include <vos/xception.hxx> #include <svl/whiter.hxx> #include <svl/stritem.hxx> @@ -41,9 +39,7 @@ #include <unotools/internaloptions.hxx> #include <unotools/pathoptions.hxx> #include <com/sun/star/registry/InvalidRegistryException.hpp> -#ifndef _COM_SUN_STAR_BEANS_PropertyValue_HPP_ #include <com/sun/star/beans/PropertyValue.hpp> -#endif #include <com/sun/star/frame/XFrame.hpp> #include <com/sun/star/util/XURLTransformer.hpp> #include <com/sun/star/frame/XFramesSupplier.hpp> @@ -51,11 +47,8 @@ #include <tools/config.hxx> #include <tools/rcid.h> #include <vos/mutex.hxx> -#ifndef GCC -#endif #include <unotools/configmgr.hxx> #include <com/sun/star/frame/XDesktop.hpp> - #include <unotools/ucbstreamhelper.hxx> #include <framework/menuconfiguration.hxx> #include <comphelper/processfactory.hxx> @@ -63,6 +56,7 @@ #include <unotools/bootstrap.hxx> #include <unotools/moduleoptions.hxx> #include <osl/file.hxx> +#include <rtl/bootstrap.hxx> #include "sfx2/sfxresid.hxx" #include <sfx2/app.hxx> @@ -160,45 +154,6 @@ SFX_IMPL_INTERFACE(SfxApplication,SfxShell,SfxResId(RID_DESKTOP)) } //-------------------------------------------------------------------- - -void SfxApplication::InitializeDisplayName_Impl() -{ - SfxAppData_Impl* pAppData = Get_Impl(); - if ( !pAppData->pLabelResMgr ) - return; - - String aTitle = Application::GetDisplayName(); - if ( !aTitle.Len() ) - { - OClearableGuard aGuard( OMutex::getGlobalMutex() ); - - // create version string -/*!!! (pb) don't show a version number at the moment - USHORT nProductVersion = ProductVersion::GetVersion().ToInt32(); - String aVersion( String::CreateFromInt32( nProductVersion / 10 ) ); - aVersion += 0x002E ; // 2Eh ^= '.' - aVersion += ( String::CreateFromInt32( nProductVersion % 10 ) ); -*/ - // load application title - aTitle = String( ResId( RID_APPTITLE, *pAppData->pLabelResMgr ) ); - // merge version into title - aTitle.SearchAndReplaceAscii( "$(VER)", String() /*aVersion*/ ); - - aGuard.clear(); - -#ifdef DBG_UTIL - ::rtl::OUString aDefault; - aTitle += DEFINE_CONST_UNICODE(" ["); - - String aVerId( utl::Bootstrap::getBuildIdData( aDefault )); - aTitle += aVerId; - aTitle += ']'; -#endif - Application::SetDisplayName( aTitle ); - } -} - -//-------------------------------------------------------------------- SfxProgress* SfxApplication::GetProgress() const /* [Beschreibung] @@ -237,8 +192,8 @@ SvUShorts* SfxApplication::GetDisabledSlotList_Impl() pStream = ::utl::UcbStreamHelper::CreateStream( aObj.GetMainURL( INetURLObject::NO_DECODE ), STREAM_STD_READ ); } - BOOL bSlotsEnabled = SvtInternalOptions().SlotCFGEnabled(); - BOOL bSlots = ( pStream && !pStream->GetError() ); + sal_Bool bSlotsEnabled = SvtInternalOptions().SlotCFGEnabled(); + sal_Bool bSlots = ( pStream && !pStream->GetError() ); if( bSlots && bSlotsEnabled ) { // SlotDatei einlesen @@ -305,7 +260,7 @@ SfxModule* SfxApplication::GetModule_Impl() { SfxModule* pModule = SfxModule::GetActiveModule(); if ( !pModule ) - pModule = SfxModule::GetActiveModule( SfxViewFrame::GetFirst( FALSE ) ); + pModule = SfxModule::GetActiveModule( SfxViewFrame::GetFirst( sal_False ) ); if( pModule ) return pModule; else @@ -327,9 +282,77 @@ ISfxTemplateCommon* SfxApplication::GetCurrentTemplateCommon( SfxBindings& rBind } SfxResourceManager& SfxApplication::GetResourceManager() const { return *pAppData_Impl->pResMgr; } -BOOL SfxApplication::IsDowning() const { return pAppData_Impl->bDowning; } +sal_Bool SfxApplication::IsDowning() const { return pAppData_Impl->bDowning; } SfxDispatcher* SfxApplication::GetAppDispatcher_Impl() { return pAppData_Impl->pAppDispat; } SfxSlotPool& SfxApplication::GetAppSlotPool_Impl() const { return *pAppData_Impl->pSlotPool; } //SfxOptions& SfxApplication::GetOptions() { return *pAppData_Impl->pOptions; } //const SfxOptions& SfxApplication::GetOptions() const { return *pAppData_Impl->pOptions; } +static bool impl_loadBitmap( + const rtl::OUString &rPath, const rtl::OUString &rBmpFileName, + Image &rLogo ) +{ + rtl::OUString uri( rPath ); + rtl::Bootstrap::expandMacros( uri ); + INetURLObject aObj( uri ); + aObj.insertName( rBmpFileName ); + SvFileStream aStrm( aObj.PathToFileName(), STREAM_STD_READ ); + if ( !aStrm.GetError() ) + { + // Use graphic class to also support more graphic formats (bmp,png,...) + Graphic aGraphic; + + GraphicFilter* pGF = GraphicFilter::GetGraphicFilter(); + pGF->ImportGraphic( aGraphic, String(), aStrm, GRFILTER_FORMAT_DONTKNOW ); + + // Default case, we load the intro bitmap from a seperate file + // (e.g. staroffice_intro.bmp or starsuite_intro.bmp) + BitmapEx aBmp = aGraphic.GetBitmapEx(); + rLogo = Image( aBmp ); + return true; + } + return false; +} + +/** loads the application logo as used in the about dialog and impress slideshow pause screen */ +Image SfxApplication::GetApplicationLogo() +{ + Image aAppLogo; + + rtl::OUString aAbouts; + bool bLoaded = false; + sal_Int32 nIndex = 0; + do + { + bLoaded = impl_loadBitmap( + rtl::OUString::createFromAscii( "$BRAND_BASE_DIR/program" ), + aAbouts.getToken( 0, ',', nIndex ), aAppLogo ); + } + while ( !bLoaded && ( nIndex >= 0 ) ); + + // fallback to "about.bmp" + if ( !bLoaded ) + { + bLoaded = impl_loadBitmap( + rtl::OUString::createFromAscii( "$BRAND_BASE_DIR/program/edition" ), + rtl::OUString::createFromAscii( "about.png" ), aAppLogo ); + if ( !bLoaded ) + bLoaded = impl_loadBitmap( + rtl::OUString::createFromAscii( "$BRAND_BASE_DIR/program/edition" ), + rtl::OUString::createFromAscii( "about.bmp" ), aAppLogo ); + } + + if ( !bLoaded ) + { + bLoaded = impl_loadBitmap( + rtl::OUString::createFromAscii( "$BRAND_BASE_DIR/program" ), + rtl::OUString::createFromAscii( "about.png" ), aAppLogo ); + if ( !bLoaded ) + bLoaded = impl_loadBitmap( + rtl::OUString::createFromAscii( "$BRAND_BASE_DIR/program" ), + rtl::OUString::createFromAscii( "about.bmp" ), aAppLogo ); + } + + return aAppLogo; +} + |