diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2011-11-11 22:48:37 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2011-11-11 22:49:21 +0100 |
commit | c1758889cbd5e8e4afb1044425c908715eb3e1cd (patch) | |
tree | ff58b017da12c009f0b17c067787d1dbbd52eb7a /sw/source/ui | |
parent | 4ffcc73fa25f174c2d1e161f02cce2d7afc15e3b (diff) |
Heavily simplified utl::ConfigManager.
Diffstat (limited to 'sw/source/ui')
-rw-r--r-- | sw/source/ui/config/optcomp.cxx | 30 | ||||
-rw-r--r-- | sw/source/ui/config/optload.cxx | 27 | ||||
-rw-r--r-- | sw/source/ui/misc/outline.cxx | 18 |
3 files changed, 21 insertions, 54 deletions
diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx index 9b4de6e12634..acd941f902aa 100644 --- a/sw/source/ui/config/optcomp.cxx +++ b/sw/source/ui/config/optcomp.cxx @@ -191,24 +191,18 @@ void SwCompatibilityOptPage::ReplaceFormatName( String& rEntry ) static const String sOpenOfficeName = String::CreateFromAscii("OpenOffice.org"); static const String sAsianName = String::CreateFromAscii("StarSuite"); - Any aAny = ::utl::ConfigManager:: - GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME ); - rtl::OUString sTmp; - if ( aAny >>= sTmp ) - { - String sFormatName = sTmp; - String sFormatVersion; - bool bOpenOffice = ( sOpenOfficeName == sFormatName ); - if ( bOpenOffice ) - sFormatVersion = String::CreateFromAscii("1.1"); - else - sFormatVersion = String::CreateFromAscii("6.0/7"); - if ( !bOpenOffice && ( sAsianName != sFormatName ) ) - sFormatName = String::CreateFromAscii("StarOffice"); - - rEntry.SearchAndReplace( String::CreateFromAscii("%FORMATNAME"), sFormatName ); - rEntry.SearchAndReplace( String::CreateFromAscii("%FORMATVERSION"), sFormatVersion ); - } + String sFormatName( utl::ConfigManager::getProductName() ); + String sFormatVersion; + bool bOpenOffice = ( sOpenOfficeName == sFormatName ); + if ( bOpenOffice ) + sFormatVersion = String::CreateFromAscii("1.1"); + else + sFormatVersion = String::CreateFromAscii("6.0/7"); + if ( !bOpenOffice && ( sAsianName != sFormatName ) ) + sFormatName = String::CreateFromAscii("StarOffice"); + + rEntry.SearchAndReplace( String::CreateFromAscii("%FORMATNAME"), sFormatName ); + rEntry.SearchAndReplace( String::CreateFromAscii("%FORMATVERSION"), sFormatVersion ); } sal_uLong convertBools2Ulong_Impl diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx index c95cf60d6d38..2729c3ad0eef 100644 --- a/sw/source/ui/config/optload.cxx +++ b/sw/source/ui/config/optload.cxx @@ -554,29 +554,10 @@ void SwCaptionOptPage::Reset( const SfxItemSet& rSet) SetOptions(nPos++, GRAPHIC_CAP); // get Productname and -version - String sComplete, sWithoutVersion; - ::rtl::OUString sTemp; - uno::Any aAny = - ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME ); - if ( aAny >>= sTemp ) - { - sComplete = sTemp; - sWithoutVersion = sTemp; - aAny = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTVERSION ); - if ( !( aAny >>= sTemp ) ) - { - OSL_FAIL("Couldn't get PRODUCTVERSION variable" ); - } - else - { - sComplete += ' '; - sComplete += String( sTemp ); - } - } - else - { - OSL_FAIL("Couldn't get PRODUCTNAME variable" ); - } + rtl::OUString sWithoutVersion( utl::ConfigManager::getProductName() ); + rtl::OUString sComplete( + sWithoutVersion + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ")) + + utl::ConfigManager::getProductVersion() ); SvObjectServerList aObjS; aObjS.FillInsertObjects(); diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx index d4e734ed53fd..01a55219d7e9 100644 --- a/sw/source/ui/misc/outline.cxx +++ b/sw/source/ui/misc/outline.cxx @@ -1153,19 +1153,11 @@ void NumberingPreview::Paint( const Rectangle& /*rRect*/ ) nPreNum++; } pVDev->SetFont(aStdFont); - - // Changed as per BugID 79541 Branding/Configuration - uno::Any MyAny = ::utl::ConfigManager::GetConfigManager(). - GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME ); - ::rtl::OUString aProductName; - - MyAny >>= aProductName; - String sMsg(C2S("%PRODUCTNAME")); - sMsg.SearchAndReplaceAscii( "%PRODUCTNAME" , aProductName ); - - if(pOutlineNames) - sMsg = pOutlineNames[nLevel]; - pVDev->DrawText( Point(nXStart + nTextOffset, nYStart), sMsg ); + pVDev->DrawText( + Point(nXStart + nTextOffset, nYStart), + (pOutlineNames == 0 + ? utl::ConfigManager::getProductName() + : rtl::OUString(pOutlineNames[nLevel]))); } } } |