diff options
author | Michael Meeks <michael.meeks@novell.com> | 2010-10-08 21:48:31 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@novell.com> | 2010-10-11 15:19:41 +0100 |
commit | 90add52b3fdfafca8fd967a119e9371ed7f3f9bd (patch) | |
tree | b2f1220de1a98ea36757156050f29bf8875b3aa4 /desktop/source/splash | |
parent | cd3cc390ec94879052aa8437ec3798268486a5fa (diff) |
add a per-language preferred name first ...
Diffstat (limited to 'desktop/source/splash')
-rw-r--r-- | desktop/source/splash/splash.cxx | 28 | ||||
-rw-r--r-- | desktop/source/splash/splash.hxx | 2 |
2 files changed, 29 insertions, 1 deletions
diff --git a/desktop/source/splash/splash.cxx b/desktop/source/splash/splash.cxx index c6a185b8e54d..80e719dff09d 100644 --- a/desktop/source/splash/splash.cxx +++ b/desktop/source/splash/splash.cxx @@ -42,6 +42,7 @@ #include <com/sun/star/registry/XRegistryKey.hpp> #include <rtl/bootstrap.hxx> #include <rtl/logfile.hxx> +#include <rtl/locale.hxx> #include <rtl/ustrbuf.hxx> #include <rtl/math.hxx> #include <vcl/graph.hxx> @@ -424,7 +425,7 @@ void SplashScreen::initBitmap() } } -bool SplashScreen::loadBitmap( +bool SplashScreen::loadOneBitmap( rtl::OUString const & path, const rtl::OUString &rBmpFileName ) { if ( rBmpFileName.getLength() == 0 ) @@ -451,6 +452,31 @@ bool SplashScreen::loadBitmap( return false; } +// Look for locale specific bitmap variants +bool SplashScreen::loadBitmap( + rtl::OUString const & path, const rtl::OUString &rBmpFileName ) +{ + sal_Int32 nExt = rBmpFileName.lastIndexOf ('.'); + if( nExt > 0 ) + { + rtl::OUString aBase = rBmpFileName.copy( 0, nExt ); + rtl::OUString aExt = rBmpFileName.copy( nExt ); + + rtl_Locale *pLoc = NULL; + osl_getProcessLocale (&pLoc); + rtl::OLocale aLoc( pLoc ); + + rtl::OUString aName; + aName = aBase + rtl::OUString::createFromAscii ("-") + + aLoc.getLanguage() + rtl::OUString::createFromAscii ("_") + + aLoc.getCountry() + aExt; + + if( loadOneBitmap( path, aName ) ) + return true; + } + return loadOneBitmap( path, rBmpFileName ); +} + bool SplashScreen::findBitmap(rtl::OUString const & path) { bool haveBitmap = false; if ( _bFullScreenSplash ) diff --git a/desktop/source/splash/splash.hxx b/desktop/source/splash/splash.hxx index 8480ed3df9ae..a0ff54ac73bf 100644 --- a/desktop/source/splash/splash.hxx +++ b/desktop/source/splash/splash.hxx @@ -78,6 +78,8 @@ private: bool findBitmap(rtl::OUString const & path); bool loadBitmap( rtl::OUString const & path, const rtl::OUString &rBmpFileName ); + bool loadOneBitmap( + rtl::OUString const & path, const rtl::OUString &rBmpFileName ); void determineProgressRatioValues( double& rXRelPos, double& rYRelPos, double& rRelWidth, double& rRelHeight ); static SplashScreen *_pINSTANCE; |