diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-04-18 04:28:54 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-04-18 04:28:54 +0200 |
commit | e814acbde55608c958b62888d0d2b3b2d68810fe (patch) | |
tree | 1b1ad92655a8b04f87374b40b5d1e896926cf426 | |
parent | implement loading extended tooltips (diff) | |
download | core-feature/extended-tooltips.tar.gz core-feature/extended-tooltips.zip |
replace PRODUCTVERSION and PRODUCTNAME in tooltip strings
feature/extended-tooltips
Change-Id: Id4b686636b9156c86a9677100ae181182ef16e92
-rw-r--r-- | sfx2/source/appl/sfxhelp.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
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<OUString, OUString> 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<OUString, OUString> 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" ); |