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 /desktop/source/pkgchk | |
parent | 4ffcc73fa25f174c2d1e161f02cce2d7afc15e3b (diff) |
Heavily simplified utl::ConfigManager.
Diffstat (limited to 'desktop/source/pkgchk')
-rw-r--r-- | desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx | 15 | ||||
-rw-r--r-- | desktop/source/pkgchk/unopkg/unopkg_misc.cxx | 3 | ||||
-rw-r--r-- | desktop/source/pkgchk/unopkg/unopkg_shared.h | 17 |
3 files changed, 5 insertions, 30 deletions
diff --git a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx index 1732b3fb5f88..4c9bd17b9f3c 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx @@ -66,18 +66,6 @@ using ::rtl::OUString; namespace { //============================================================================== -struct OfficeLocale : - public rtl::StaticWithInit<lang::Locale, OfficeLocale> { - const lang::Locale operator () () { - OUString slang; - if (! (::utl::ConfigManager::GetDirectConfigProperty( - ::utl::ConfigManager::LOCALE ) >>= slang)) - throw RuntimeException( OUSTR("Cannot determine language!"), 0 ); - return toLocale(slang); - } -}; - -//============================================================================== class CommandEnvironmentImpl : public ::cppu::WeakImplHelper3< XCommandEnvironment, task::XInteractionHandler, @@ -189,7 +177,8 @@ void CommandEnvironmentImpl::printLicense( ->createInstanceWithContext( OUSTR("com.sun.star.i18n.Collator"),m_xComponentContext), UNO_QUERY_THROW ); - xCollator->loadDefaultCollator(OfficeLocale::get(), + xCollator->loadDefaultCollator( + toLocale(utl::ConfigManager::getLocale()), css::i18n::CollatorOptions::CollatorOptions_IGNORE_CASE); do diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx index a2c9baf4986e..84b0b0ae09e9 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx @@ -511,8 +511,7 @@ Reference<XComponentContext> getUNO( NULL ); { WarningBox warn(NULL, WB_OK | WB_DEF_OK, sMsg); - warn.SetText(::utl::ConfigManager::GetDirectConfigProperty( - ::utl::ConfigManager::PRODUCTNAME).get<OUString>()); + warn.SetText(utl::ConfigManager::getProductName()); warn.SetIcon(0); warn.Execute(); } diff --git a/desktop/source/pkgchk/unopkg/unopkg_shared.h b/desktop/source/pkgchk/unopkg/unopkg_shared.h index feffd892a27e..c8de646b12ce 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_shared.h +++ b/desktop/source/pkgchk/unopkg/unopkg_shared.h @@ -54,24 +54,11 @@ namespace unopkg { return locale; } - - struct OfficeLocale : - public rtl::StaticWithInit<css::lang::Locale, OfficeLocale> { - const css::lang::Locale operator () () { - ::rtl::OUString slang; - if (! (::utl::ConfigManager::GetDirectConfigProperty( - ::utl::ConfigManager::LOCALE ) >>= slang)) - throw css::uno::RuntimeException( OUSTR("Cannot determine language!"), 0 ); - if (slang.getLength() == 0) - slang = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("en-US")); - return toLocale(slang); - } -}; - struct DeploymentResMgr : public rtl::StaticWithInit< ResMgr *, DeploymentResMgr > { ResMgr * operator () () { - return ResMgr::CreateResMgr( "deployment", OfficeLocale::get()); + return ResMgr::CreateResMgr( + "deployment", toLocale( utl::ConfigManager::getLocale() ) ); } }; |