From a828e87d88b885cbec454a3d1aa342484f770433 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Fri, 8 Dec 2000 07:45:22 +0000 Subject: #79541#: ResourceHook for Strings --- desktop/source/app/app.cxx | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'desktop') 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 #include +#include #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; -- cgit