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 | |
parent | 4ffcc73fa25f174c2d1e161f02cce2d7afc15e3b (diff) |
Heavily simplified utl::ConfigManager.
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/app/app.cxx | 96 | ||||
-rw-r--r-- | desktop/source/app/officeipcthread.cxx | 5 | ||||
-rw-r--r-- | desktop/source/deployment/gui/dp_gui_dialog2.cxx | 15 | ||||
-rw-r--r-- | desktop/source/deployment/gui/dp_gui_service.cxx | 54 | ||||
-rw-r--r-- | desktop/source/deployment/gui/dp_gui_shared.hxx | 8 | ||||
-rw-r--r-- | desktop/source/deployment/gui/dp_gui_updatedialog.cxx | 5 | ||||
-rw-r--r-- | desktop/source/deployment/misc/dp_resource.cxx | 17 | ||||
-rw-r--r-- | desktop/source/migration/migration.cxx | 12 | ||||
-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 |
11 files changed, 73 insertions, 174 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 1555510efab7..38ba4db1caa5 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -133,7 +133,6 @@ #include <rtl/strbuf.hxx> #include <rtl/bootstrap.hxx> #include <rtl/instance.hxx> -#include <unotools/configmgr.hxx> #include <vcl/help.hxx> #include <vcl/msgbox.hxx> #include <vcl/bitmap.hxx> @@ -359,41 +358,24 @@ void ReplaceStringHookProc( UniString& rStr ) nAll++; if ( rStr.SearchAscii( "%PRODUCT" ) != STRING_NOTFOUND ) { - String &rBrandName = BrandName::get(); - String &rVersion = Version::get(); - String &rAboutBoxVersion = AboutBoxVersion::get(); - String &rExtension = Extension::get(); - String &rXMLFileFormatName = XMLFileFormatName::get(); - String &rXMLFileFormatVersion = XMLFileFormatVersion::get(); + String rBrandName = BrandName::get(); + String rVersion = Version::get(); + String rAboutBoxVersion = AboutBoxVersion::get(); + String rExtension = Extension::get(); + String rXMLFileFormatName = XMLFileFormatName::get(); + String rXMLFileFormatVersion = XMLFileFormatVersion::get(); if ( !rBrandName.Len() ) { - rtl::OUString aTmp; - Any aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME ); - aRet >>= aTmp; - rBrandName = aTmp; - - aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTXMLFILEFORMATNAME ); - aRet >>= aTmp; - rXMLFileFormatName = aTmp; - - aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTXMLFILEFORMATVERSION ); - aRet >>= aTmp; - rXMLFileFormatVersion = aTmp; - - aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTVERSION ); - aRet >>= aTmp; - rVersion = aTmp; - - aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::ABOUTBOXPRODUCTVERSION ); - aRet >>= aTmp; - rAboutBoxVersion = aTmp; - + rBrandName = utl::ConfigManager::getProductName(); + rXMLFileFormatName = utl::ConfigManager::getProductXmlFileFormat(); + rXMLFileFormatVersion = + utl::ConfigManager::getProductXmlFileFormatVersion(); + rVersion = utl::ConfigManager::getProductVersion(); + rAboutBoxVersion = utl::ConfigManager::getAboutBoxProductVersion(); if ( !rExtension.Len() ) { - aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTEXTENSION ); - aRet >>= aTmp; - rExtension = aTmp; + rExtension = utl::ConfigManager::getProductExtension(); } } @@ -407,30 +389,22 @@ void ReplaceStringHookProc( UniString& rStr ) } if ( rStr.SearchAscii( "%OOOVENDOR" ) != STRING_NOTFOUND ) { - String &rOOOVendor = OOOVendor::get(); + String rOOOVendor = OOOVendor::get(); if ( !rOOOVendor.Len() ) { - rtl::OUString aTmp; - Any aRet = ::utl::ConfigManager::GetDirectConfigProperty( - ::utl::ConfigManager::OOOVENDOR ); - aRet >>= aTmp; - rOOOVendor = aTmp; - + rOOOVendor = utl::ConfigManager::getVendor(); } rStr.SearchAndReplaceAllAscii( "%OOOVENDOR" ,rOOOVendor ); } if ( rStr.SearchAscii( "%WRITERCOMPATIBILITYVERSIONOOO11" ) != STRING_NOTFOUND ) { - String &rWriterCompatibilityVersionOOo11 = WriterCompatibilityVersionOOo11::get(); + String rWriterCompatibilityVersionOOo11 = WriterCompatibilityVersionOOo11::get(); if ( !rWriterCompatibilityVersionOOo11.Len() ) { - rtl::OUString aTmp; - Any aRet = ::utl::ConfigManager::GetDirectConfigProperty( - ::utl::ConfigManager::WRITERCOMPATIBILITYVERSIONOOO11 ); - aRet >>= aTmp; - rWriterCompatibilityVersionOOo11 = aTmp; + rWriterCompatibilityVersionOOo11 = + utl::ConfigManager::getWriterCompatibilityVersionOOo_1_1(); } rStr.SearchAndReplaceAllAscii( "%WRITERCOMPATIBILITYVERSIONOOO11", @@ -792,7 +766,7 @@ void Desktop::DeInit() try { // instead of removing of the configManager just let it commit all the changes RTL_LOGFILE_CONTEXT_TRACE( aLog, "<- store config items" ); - utl::ConfigManager::GetConfigManager().StoreConfigItems(); + utl::ConfigManager::storeConfigItems(); FlushConfiguration(); RTL_LOGFILE_CONTEXT_TRACE( aLog, "<- store config items" ); @@ -822,7 +796,7 @@ sal_Bool Desktop::QueryExit() try { RTL_LOGFILE_CONTEXT_TRACE( aLog, "<- store config items" ); - utl::ConfigManager::GetConfigManager().StoreConfigItems(); + utl::ConfigManager::storeConfigItems(); RTL_LOGFILE_CONTEXT_TRACE( aLog, "<- store config items" ); } catch ( RuntimeException& ) @@ -2065,18 +2039,14 @@ sal_Bool Desktop::InitializeConfiguration() void Desktop::FlushConfiguration() { - Reference < XFlushable > xCFGFlush( ::utl::ConfigManager::GetConfigManager().GetConfigurationProvider(), UNO_QUERY ); - if (xCFGFlush.is()) - { - xCFGFlush->flush(); - } - else - { - // because there is no method to flush the condiguration data, we must dispose the ConfigManager - Reference < XComponent > xCFGDispose( ::utl::ConfigManager::GetConfigManager().GetConfigurationProvider(), UNO_QUERY ); - if (xCFGDispose.is()) - xCFGDispose->dispose(); - } + css::uno::Reference< css::util::XFlushable >( + (css::uno::Reference< css::lang::XMultiServiceFactory >( + comphelper::getProcessServiceFactory(), css::uno::UNO_SET_THROW)-> + createInstance( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.configuration.ConfigurationProvider")))), + css::uno::UNO_QUERY_THROW)->flush(); } sal_Bool Desktop::shouldLaunchQuickstart() @@ -2620,19 +2590,15 @@ void Desktop::OpenClients() aHelpURLBuffer.appendAscii("vnd.sun.star.help://smath/start"); } if (bShowHelp) { - Help *pHelp = Application::GetHelp(); - - Any aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::LOCALE ); - rtl::OUString aTmp; - aRet >>= aTmp; aHelpURLBuffer.appendAscii("?Language="); - aHelpURLBuffer.append(aTmp); + aHelpURLBuffer.append(utl::ConfigManager::getLocale()); #if defined UNX aHelpURLBuffer.appendAscii("&System=UNX"); #elif defined WNT aHelpURLBuffer.appendAscii("&System=WIN"); #endif - pHelp->Start(aHelpURLBuffer.makeStringAndClear(), NULL); + Application::GetHelp()->Start( + aHelpURLBuffer.makeStringAndClear(), NULL); return; } } diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx index d9273c029eb3..6d42f7b2df2b 100644 --- a/desktop/source/app/officeipcthread.cxx +++ b/desktop/source/app/officeipcthread.cxx @@ -826,11 +826,8 @@ void SAL_CALL OfficeIPCThread::run() aHelpURLBuffer.appendAscii("vnd.sun.star.help://smath/start"); } if (bShowHelp) { - Any aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::LOCALE ); - rtl::OUString aTmp; - aRet >>= aTmp; aHelpURLBuffer.appendAscii("?Language="); - aHelpURLBuffer.append(aTmp); + aHelpURLBuffer.append(utl::ConfigManager::getLocale()); #if defined UNX aHelpURLBuffer.appendAscii("&System=UNX"); #elif defined WNT diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx index a0768dd0806c..1cc397b629cf 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -64,6 +64,7 @@ #include "comphelper/processfactory.hxx" #include "ucbhelper/content.hxx" #include "unotools/collatorwrapper.hxx" +#include "unotools/configmgr.hxx" #include "com/sun/star/beans/StringPair.hpp" @@ -577,12 +578,11 @@ ResId DialogHelper::getResId( sal_uInt16 nId ) //------------------------------------------------------------------------------ String DialogHelper::getResourceString( sal_uInt16 id ) { - // init with non-acquired solar mutex: - BrandName::get(); const SolarMutexGuard guard; String ret( ResId( id, *DeploymentGuiResMgr::get() ) ); if (ret.SearchAscii( "%PRODUCTNAME" ) != STRING_NOTFOUND) { - ret.SearchAndReplaceAllAscii( "%PRODUCTNAME", BrandName::get() ); + ret.SearchAndReplaceAllAscii( + "%PRODUCTNAME", utl::ConfigManager::getProductName() ); } return ret; } @@ -607,7 +607,8 @@ bool DialogHelper::continueOnSharedExtension( const uno::Reference< deployment:: const SolarMutexGuard guard; WarningBox aInfoBox( pParent, getResId( nResID ) ); String aMsgText = aInfoBox.GetMessText(); - aMsgText.SearchAndReplaceAllAscii( "%PRODUCTNAME", BrandName::get() ); + aMsgText.SearchAndReplaceAllAscii( + "%PRODUCTNAME", utl::ConfigManager::getProductName() ); aInfoBox.SetMessText( aMsgText ); bHadWarning = true; @@ -665,7 +666,8 @@ bool DialogHelper::installForAllUsers( bool &bInstallForAll ) const QueryBox aQuery( m_pVCLWindow, getResId( RID_QUERYBOX_INSTALL_FOR_ALL ) ); String sMsgText = aQuery.GetMessText(); - sMsgText.SearchAndReplaceAllAscii( "%PRODUCTNAME", BrandName::get() ); + sMsgText.SearchAndReplaceAllAscii( + "%PRODUCTNAME", utl::ConfigManager::getProductName() ); aQuery.SetMessText( sMsgText ); sal_uInt16 nYesBtnID = aQuery.GetButtonId( 0 ); @@ -1279,7 +1281,8 @@ UpdateRequiredDialog::UpdateRequiredDialog( Window *pParent, TheExtensionManager m_aCancelBtn.SetClickHdl( LINK( this, UpdateRequiredDialog, HandleCancelBtn ) ); String aText = m_aUpdateNeeded.GetText(); - aText.SearchAndReplaceAllAscii( "%PRODUCTNAME", BrandName::get() ); + aText.SearchAndReplaceAllAscii( + "%PRODUCTNAME", utl::ConfigManager::getProductName() ); m_aUpdateNeeded.SetText( aText ); // resize update button diff --git a/desktop/source/deployment/gui/dp_gui_service.cxx b/desktop/source/deployment/gui/dp_gui_service.cxx index 38c081b1c3fc..71ee6c466b8a 100644 --- a/desktop/source/deployment/gui/dp_gui_service.cxx +++ b/desktop/source/deployment/gui/dp_gui_service.cxx @@ -107,36 +107,21 @@ void ReplaceProductNameHookProc( String& rStr ) nAll++; if ( rStr.SearchAscii( "%PRODUCT" ) != STRING_NOTFOUND ) { - String &rProductName = ProductName::get(); - String &rVersion = Version::get(); - String &rAboutBoxVersion = AboutBoxVersion::get(); - String &rExtension = Extension::get(); - String &rOOOVendor = OOOVendor::get(); + String rProductName = ProductName::get(); + String rVersion = Version::get(); + String rAboutBoxVersion = AboutBoxVersion::get(); + String rExtension = Extension::get(); + String rOOOVendor = OOOVendor::get(); if ( !rProductName.Len() ) { - rtl::OUString aTmp; - Any aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME ); - aRet >>= aTmp; - rProductName = aTmp; - - aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTVERSION ); - aRet >>= aTmp; - rVersion = aTmp; - - aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::ABOUTBOXPRODUCTVERSION ); - aRet >>= aTmp; - rAboutBoxVersion = aTmp; - - aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::OOOVENDOR ); - aRet >>= aTmp; - rOOOVendor = aTmp; - + rProductName = utl::ConfigManager::getProductName(); + rVersion = utl::ConfigManager::getProductVersion(); + rAboutBoxVersion = utl::ConfigManager::getAboutBoxProductVersion(); + rOOOVendor = utl::ConfigManager::getVendor(); if ( !rExtension.Len() ) { - aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTEXTENSION ); - aRet >>= aTmp; - rExtension = aTmp; + rExtension = utl::ConfigManager::getProductExtension(); } } @@ -253,19 +238,14 @@ void ServiceImpl::startExecuteModal( throw RuntimeException( OUSTR("Cannot initialize VCL!"), static_cast<OWeakObject *>(this) ); AllSettings as = app->GetSettings(); - OUString slang; - if (! (::utl::ConfigManager::GetDirectConfigProperty( - ::utl::ConfigManager::LOCALE ) >>= slang)) - throw RuntimeException( OUSTR("Cannot determine language!"), - static_cast<OWeakObject *>(this) ); - as.SetUILanguage( MsLangId::convertIsoStringToLanguage( slang ) ); + as.SetUILanguage( + MsLangId::convertIsoStringToLanguage( + utl::ConfigManager::getLocale() ) ); app->SetSettings( as ); - String sTitle = ::utl::ConfigManager::GetDirectConfigProperty( - ::utl::ConfigManager::PRODUCTNAME).get<OUString>() - + String(static_cast<sal_Unicode>(' ')) - + ::utl::ConfigManager::GetDirectConfigProperty( - ::utl::ConfigManager::PRODUCTVERSION).get<OUString>(); - app->SetDisplayName(sTitle); + app->SetDisplayName( + utl::ConfigManager::getProductName() + + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" ")) + + utl::ConfigManager::getProductVersion()); ExtensionCmdQueue::syncRepositories( m_xComponentContext ); } } diff --git a/desktop/source/deployment/gui/dp_gui_shared.hxx b/desktop/source/deployment/gui/dp_gui_shared.hxx index 3e2db45bfdd7..bc2e08e57039 100644 --- a/desktop/source/deployment/gui/dp_gui_shared.hxx +++ b/desktop/source/deployment/gui/dp_gui_shared.hxx @@ -29,7 +29,6 @@ #if !defined INCLUDED_DP_GUI_SHARED_HXX #define INCLUDED_DP_GUI_SHARED_HXX -#include "unotools/configmgr.hxx" #include "rtl/instance.hxx" #include "tools/resmgr.hxx" @@ -45,13 +44,6 @@ struct DeploymentGuiResMgr : } }; -struct BrandName : public ::rtl::StaticWithInit< ::rtl::OUString, BrandName > { - const ::rtl::OUString operator () () { - return ::utl::ConfigManager::GetDirectConfigProperty( - ::utl::ConfigManager::PRODUCTNAME ).get< ::rtl::OUString >(); - } -}; - class DpGuiResId : public ResId { public: diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx index f0b3f41d9e09..bf31cf195ed1 100644 --- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx +++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx @@ -101,6 +101,7 @@ #include "tools/resmgr.hxx" #include "tools/solar.h" #include "tools/string.hxx" +#include "unotools/configmgr.hxx" #include "vcl/button.hxx" #include "vcl/dialog.hxx" #include "vcl/fixed.hxx" @@ -1288,12 +1289,12 @@ IMPL_LINK(UpdateDialog, selectionHandler, void *, EMPTYARG) nPos = m_noDependencyCurVer.indexOf( sProductName ); if ( nPos >= 0 ) { - m_noDependencyCurVer = m_noDependencyCurVer.replaceAt( nPos, sProductName.getLength(), BrandName::get() ); + m_noDependencyCurVer = m_noDependencyCurVer.replaceAt( nPos, sProductName.getLength(), utl::ConfigManager::getProductName() ); } nPos = m_noDependency.indexOf( sProductName ); if ( nPos >= 0 ) { - m_noDependency = m_noDependency.replaceAt( nPos, sProductName.getLength(), BrandName::get() ); + m_noDependency = m_noDependency.replaceAt( nPos, sProductName.getLength(), utl::ConfigManager::getProductName() ); } b.append(m_noInstall); diff --git a/desktop/source/deployment/misc/dp_resource.cxx b/desktop/source/deployment/misc/dp_resource.cxx index a20f1b3c56d8..89d3de3ef0fb 100644 --- a/desktop/source/deployment/misc/dp_resource.cxx +++ b/desktop/source/deployment/misc/dp_resource.cxx @@ -48,10 +48,7 @@ namespace { struct OfficeLocale : public rtl::StaticWithInit<OUString, OfficeLocale> { const OUString operator () () { - OUString slang; - if (! (::utl::ConfigManager::GetDirectConfigProperty( - ::utl::ConfigManager::LOCALE ) >>= slang)) - throw RuntimeException( OUSTR("Cannot determine language!"), 0 ); + OUString slang(utl::ConfigManager::getLocale()); //fallback, the locale is currently only set when the user starts the //office for the first time. if (slang.getLength() == 0) @@ -83,16 +80,8 @@ String getResourceString( sal_uInt16 id ) { const osl::MutexGuard guard( s_mutex ); String ret( ResId( id, *DeploymentResMgr::get() ) ); - if (ret.SearchAscii( "%PRODUCTNAME" ) != STRING_NOTFOUND) { - static String s_brandName; - if (s_brandName.Len() == 0) { - OUString brandName( - ::utl::ConfigManager::GetDirectConfigProperty( - ::utl::ConfigManager::PRODUCTNAME ).get<OUString>() ); - s_brandName = brandName; - } - ret.SearchAndReplaceAllAscii( "%PRODUCTNAME", s_brandName ); - } + ret.SearchAndReplaceAllAscii( + "%PRODUCTNAME", utl::ConfigManager::getProductName() ); return ret; } diff --git a/desktop/source/migration/migration.cxx b/desktop/source/migration/migration.cxx index 906f034a1acd..f242c3449282 100644 --- a/desktop/source/migration/migration.cxx +++ b/desktop/source/migration/migration.cxx @@ -539,11 +539,6 @@ static FileBase::RC _checkAndCreateDirectory(INetURLObject& dirURL) install_info MigrationImpl::findInstallation(const strings_v& rVersions) { - rtl::OUString aProductName; - uno::Any aRet = ::utl::ConfigManager::GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME ); - aRet >>= aProductName; - aProductName = aProductName.toAsciiLowerCase(); - install_info aInfo; strings_v::const_iterator i_ver = rVersions.begin(); while (i_ver != rVersions.end()) @@ -556,9 +551,10 @@ install_info MigrationImpl::findInstallation(const strings_v& rVersions) aProfileName = (*i_ver).copy( nSeparatorIndex+1 ); } - if ( aVersion.getLength() && aProfileName.getLength() && - ( !aInfo.userdata.getLength() || !aProfileName.toAsciiLowerCase().compareTo( aProductName, aProductName.getLength() ) ) - ) + if ( !aVersion.isEmpty() && !aProfileName.isEmpty() && + ( aInfo.userdata.isEmpty() || + aProfileName.equalsIgnoreAsciiCase( + utl::ConfigManager::getProductName() ) ) ) { ::rtl::OUString aUserInst; osl::Security().getConfigDir( aUserInst ); 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() ) ); } }; |