summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2011-11-11 22:48:37 +0100
committerStephan Bergmann <sbergman@redhat.com>2011-11-11 22:49:21 +0100
commitc1758889cbd5e8e4afb1044425c908715eb3e1cd (patch)
treeff58b017da12c009f0b17c067787d1dbbd52eb7a /framework
parent4ffcc73fa25f174c2d1e161f02cce2d7afc15e3b (diff)
Heavily simplified utl::ConfigManager.
Diffstat (limited to 'framework')
-rw-r--r--framework/source/fwe/helper/titlehelper.cxx23
-rw-r--r--framework/source/helper/titlebarupdate.cxx6
-rw-r--r--framework/source/services/autorecovery.cxx3
-rw-r--r--framework/source/services/substitutepathvars.cxx5
-rw-r--r--framework/source/uielement/uicommanddescription.cxx9
5 files changed, 16 insertions, 30 deletions
diff --git a/framework/source/fwe/helper/titlehelper.cxx b/framework/source/fwe/helper/titlehelper.cxx
index 7b39cf071a7d..2a444ddc0def 100644
--- a/framework/source/fwe/helper/titlehelper.cxx
+++ b/framework/source/fwe/helper/titlehelper.cxx
@@ -542,28 +542,23 @@ void TitleHelper::impl_appendComponentTitle ( ::rtl::OUStringBuffer&
//*****************************************************************************************************************
void TitleHelper::impl_appendProductName (::rtl::OUStringBuffer& sTitle)
{
- ::rtl::OUString sProductName;
- ::utl::ConfigManager::GetDirectConfigProperty(::utl::ConfigManager::PRODUCTNAME) >>= sProductName;
-
- if (sProductName.getLength ())
+ rtl::OUString name(utl::ConfigManager::getProductName());
+ if (!name.isEmpty())
{
- if (sTitle.getLength() > 0)
- sTitle.appendAscii (" - ");
-
- sTitle.append (sProductName);
+ if (sTitle.getLength() != 0)
+ sTitle.appendAscii(RTL_CONSTASCII_STRINGPARAM(" - "));
+ sTitle.append(name);
}
}
//*****************************************************************************************************************
void TitleHelper::impl_appendProductExtension (::rtl::OUStringBuffer& sTitle)
{
- ::rtl::OUString sProductExtension;
- ::utl::ConfigManager::GetDirectConfigProperty(::utl::ConfigManager::PRODUCTEXTENSION) >>= sProductExtension;
-
- if (sProductExtension.getLength ())
+ rtl::OUString ext(utl::ConfigManager::getProductExtension());
+ if (!ext.isEmpty())
{
- sTitle.appendAscii (" ");
- sTitle.append (sProductExtension);
+ sTitle.append(' ');
+ sTitle.append(ext);
}
}
diff --git a/framework/source/helper/titlebarupdate.cxx b/framework/source/helper/titlebarupdate.cxx
index 832c56b0d1e1..ff5914ab9bee 100644
--- a/framework/source/helper/titlebarupdate.cxx
+++ b/framework/source/helper/titlebarupdate.cxx
@@ -187,9 +187,6 @@ void TitleBarUpdate::impl_updateApplicationID(const css::uno::Reference< css::fr
::rtl::OUString sApplicationID;
try
{
- ::rtl::OUString aProductName;
- ::utl::ConfigManager::GetDirectConfigProperty(::utl::ConfigManager::PRODUCTNAME) >>= aProductName;
-
// SYNCHRONIZED ->
ReadGuard aReadLock(m_aLock);
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = m_xSMGR;
@@ -231,7 +228,8 @@ void TitleBarUpdate::impl_updateApplicationID(const css::uno::Reference< css::fr
sDesktopName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("startcenter"));
else
sDesktopName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("startcenter"));
- sApplicationID = aProductName.toAsciiLowerCase();
+ sApplicationID = utl::ConfigManager::getProductName().
+ toAsciiLowerCase();
sApplicationID += ::rtl::OUString(sal_Unicode('-'));
sApplicationID += sDesktopName;
}
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
index 3455daf1c787..7d79f407fe07 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -3621,8 +3621,7 @@ void AutoRecovery::impl_flushALLConfigChanges()
// SOLAR SAFE ->
SolarMutexGuard aGuard;
- ::utl::ConfigManager& rCfgMgr = ::utl::ConfigManager::GetConfigManager();
- rCfgMgr.StoreConfigItems();
+ ::utl::ConfigManager::storeConfigItems();
}
catch(const css::uno::Exception&)
{}
diff --git a/framework/source/services/substitutepathvars.cxx b/framework/source/services/substitutepathvars.cxx
index d7e45ef2e8b5..0958fdc2b032 100644
--- a/framework/source/services/substitutepathvars.cxx
+++ b/framework/source/services/substitutepathvars.cxx
@@ -1220,9 +1220,8 @@ void SubstitutePathVariables::SetPredefinedPathVariables( PredefinedPathVariable
// Detect the language type of the current office
aPreDefPathVariables.m_eLanguageType = LANGUAGE_ENGLISH_US;
- rtl::OUString aLocaleStr;
- if ( utl::ConfigManager::GetConfigManager().GetDirectConfigProperty( utl::ConfigManager::LOCALE ) >>= aLocaleStr )
- aPreDefPathVariables.m_eLanguageType = MsLangId::convertIsoStringToLanguage( aLocaleStr );
+ rtl::OUString aLocaleStr( utl::ConfigManager::getLocale() );
+ aPreDefPathVariables.m_eLanguageType = MsLangId::convertIsoStringToLanguage( aLocaleStr );
// We used to have an else branch here with a LOG_ERROR, but that
// always fired in some unit tests when this code was built with
// debug=t, so it seems fairly pointless, especially as
diff --git a/framework/source/uielement/uicommanddescription.cxx b/framework/source/uielement/uicommanddescription.cxx
index 6702612e8f99..a57618e55469 100644
--- a/framework/source/uielement/uicommanddescription.cxx
+++ b/framework/source/uielement/uicommanddescription.cxx
@@ -187,7 +187,6 @@ class ConfigurationAccess_UICommand : // Order is neccessary for right initializ
rtl::OUString m_aPropName;
rtl::OUString m_aPropPopup;
rtl::OUString m_aPropProperties;
- rtl::OUString m_aBrandName;
rtl::OUString m_aXMLFileFormatVersion;
rtl::OUString m_aVersion;
rtl::OUString m_aExtension;
@@ -236,10 +235,6 @@ ConfigurationAccess_UICommand::ConfigurationAccess_UICommand( const rtl::OUStrin
m_aConfigPopupAccess += aModuleName;
m_aConfigPopupAccess += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( CONFIGURATION_POP_ELEMENT_ACCESS ));
-
- rtl::OUString aTmp;
- ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME ) >>= aTmp;
- m_aBrandName = aTmp;
}
ConfigurationAccess_UICommand::~ConfigurationAccess_UICommand()
@@ -330,8 +325,8 @@ throw ( RuntimeException )
void ConfigurationAccess_UICommand::fillInfoFromResult( CmdToInfoMap& rCmdInfo, const rtl::OUString& aLabel )
{
String rStr( aLabel );
- if ( rStr.SearchAscii( "%PRODUCT" ) != STRING_NOTFOUND )
- rStr.SearchAndReplaceAllAscii( "%PRODUCTNAME", m_aBrandName );
+ rStr.SearchAndReplaceAllAscii(
+ "%PRODUCTNAME", utl::ConfigManager::getProductName() );
rCmdInfo.aLabel = ::rtl::OUString( rStr );
rStr.EraseTrailingChars( '.' ); // Remove "..." from string
rCmdInfo.aCommandName = ::rtl::OUString( MnemonicGenerator::EraseAllMnemonicChars( rStr ));