From e814acbde55608c958b62888d0d2b3b2d68810fe Mon Sep 17 00:00:00 2001 From: Markus Mohrhard Date: Thu, 18 Apr 2013 04:28:54 +0200 Subject: replace PRODUCTVERSION and PRODUCTNAME in tooltip strings Change-Id: Id4b686636b9156c86a9677100ae181182ef16e92 --- sfx2/source/appl/sfxhelp.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index 170c9454dcf3..27624ed15475 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -332,6 +332,8 @@ std::map SfxHelp_Impl::loadHelpStrings( const OUString& rMod if( pStrm->GetError() == 0 ) { bool bRead = true; + OUString aProductName = utl::ConfigManager::getProductName(); + OUString aProductVersion = utl::ConfigManager::getProductVersion(); while(bRead) { OUString aLine; @@ -344,6 +346,8 @@ std::map SfxHelp_Impl::loadHelpStrings( const OUString& rMod if(nIndex != -1) { OUString aValue = aLine.copy(nIndex); + aValue = aValue.replaceAll("%PRODUCTNAME", aProductName); + aValue = aValue.replaceAll("%PRODUCTVERSION", aProductVersion); aRet.insert( std::pair< OUString, OUString >( aId, aValue ) ); //SAL_WARN("sfx2.appl", "added help string with id: " << aId << " and value: " << aValue); } @@ -380,6 +384,9 @@ OUString SfxHelp_Impl::GetHelpText_Impl( const OUString& rCommandURL, const OUSt OUString SfxHelp_Impl::GetHelpText( const OUString& aCommandURL, const OUString& rModule ) { + if(aCommandURL.isEmpty()) + return OUString(); + OUString aHelpText = GetHelpText_Impl( aCommandURL, rModule ); if(aHelpText.isEmpty()) aHelpText = GetHelpText_Impl( aCommandURL, "shared" ); -- cgit v1.2.3