diff options
author | Mathias Bauer <mba@openoffice.org> | 2000-12-08 07:45:22 +0000 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2000-12-08 07:45:22 +0000 |
commit | a828e87d88b885cbec454a3d1aa342484f770433 (patch) | |
tree | 2152a56e090618ae038f8bc1d3653381bd5bf690 /desktop | |
parent | 10772e05c1ba17440e3868da74264fa7ab075c36 (diff) |
#79541#: ResourceHook for Strings
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/app/app.cxx | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 2351ce48c01b..774ca380d5b7 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -2,9 +2,9 @@ * * $RCSfile: app.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: mba $ $Date: 2000-11-30 08:47:40 $ + * last change: $Author: mba $ $Date: 2000-12-08 08:45:22 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -77,12 +77,27 @@ #include <setup2/installer.hxx> #include <svtools/pathoptions.hxx> +#include <unotools/configmgr.hxx> #define DEFINE_CONST_UNICODE(CONSTASCII) UniString(RTL_CONSTASCII_USTRINGPARAM(CONSTASCII##)) using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; +void ReplaceStringHookProc( UniString& rStr ) +{ + static String aBrandName; + if ( !aBrandName.Len() ) + { + Any aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME ); + rtl::OUString aTmp; + aRet >>= aTmp; + aBrandName = aTmp; + } + + rStr.SearchAndReplaceAscii( "%PRODUCTNAME", aBrandName ); +} + Desktop aDesktop; Desktop::Desktop() @@ -91,6 +106,7 @@ Desktop::Desktop() void Desktop::Main() { + ResMgr::SetReadStringHook( ReplaceStringHookProc ); SetAppName( DEFINE_CONST_UNICODE("soffice") ); Installer* pInstaller = new Installer; |