diff options
Diffstat (limited to 'sfx2/source/appl/appmisc.cxx')
-rw-r--r-- | sfx2/source/appl/appmisc.cxx | 79 |
1 files changed, 72 insertions, 7 deletions
diff --git a/sfx2/source/appl/appmisc.cxx b/sfx2/source/appl/appmisc.cxx index 6471c4eca140..1fdbe5f77107 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,6 +154,8 @@ SFX_IMPL_INTERFACE(SfxApplication,SfxShell,SfxResId(RID_DESKTOP)) } //-------------------------------------------------------------------- +<<<<<<< local +======= void SfxApplication::InitializeDisplayName_Impl() { @@ -199,6 +195,7 @@ void SfxApplication::InitializeDisplayName_Impl() } //-------------------------------------------------------------------- +>>>>>>> other SfxProgress* SfxApplication::GetProgress() const /* [Beschreibung] @@ -333,3 +330,71 @@ SfxSlotPool& SfxApplication::GetAppSlotPool_Impl() const { return *pAppData_Impl //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; +} + |