diff options
-rw-r--r-- | unotools/source/config/configmgr.cxx | 52 |
1 files changed, 10 insertions, 42 deletions
diff --git a/unotools/source/config/configmgr.cxx b/unotools/source/config/configmgr.cxx index 05b1e5874643..610246295d55 100644 --- a/unotools/source/config/configmgr.cxx +++ b/unotools/source/config/configmgr.cxx @@ -27,6 +27,7 @@ #include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/uno/Sequence.hxx> #include <i18nlangtag/languagetag.hxx> +#include <officecfg/Setup.hxx> #include <rtl/instance.hxx> #include <rtl/ustring.hxx> #include <sal/log.hxx> @@ -66,21 +67,6 @@ getConfigurationProvider() { return css::configuration::theDefaultProvider::get( comphelper::getProcessComponentContext() ); } -OUString getConfigurationString(OUString const & module, OUString const & path) -{ - css::uno::Sequence< css::uno::Any > args(1); - args[0] <<= css::beans::NamedValue( - "nodepath", - css::uno::makeAny(module)); - return - css::uno::Reference< css::container::XHierarchicalNameAccess >( - getConfigurationProvider()->createInstanceWithArguments( - "com.sun.star.configuration.ConfigurationAccess", - args), - css::uno::UNO_QUERY_THROW)-> - getByHierarchicalName(path).get< OUString >(); -} - struct theConfigManager: public rtl::Static< utl::ConfigManager, theConfigManager > {}; @@ -88,57 +74,39 @@ struct theConfigManager: } OUString utl::ConfigManager::getAboutBoxProductVersion() { - return getConfigurationString( - "/org.openoffice.Setup", - "Product/ooSetupVersionAboutBox"); + return officecfg::Setup::Product::ooSetupVersionAboutBox::get(); } OUString utl::ConfigManager::getAboutBoxProductVersionSuffix() { - return getConfigurationString( - "/org.openoffice.Setup", - "Product/ooSetupVersionAboutBoxSuffix"); + return officecfg::Setup::Product::ooSetupVersionAboutBoxSuffix::get(); } OUString utl::ConfigManager::getDefaultCurrency() { - return getConfigurationString( - "/org.openoffice.Setup", - "L10N/ooSetupCurrency"); + return officecfg::Setup::L10N::ooSetupCurrency::get(); } OUString utl::ConfigManager::getUILocale() { - return getConfigurationString( - "/org.openoffice.Setup", - "L10N/ooLocale"); + return officecfg::Setup::L10N::ooLocale::get(); } OUString utl::ConfigManager::getWorkLocale() { - return getConfigurationString( - "/org.openoffice.Setup", - "L10N/ooSetupSystemLocale"); + return officecfg::Setup::L10N::ooSetupSystemLocale::get(); } OUString utl::ConfigManager::getProductExtension() { - return getConfigurationString( - "/org.openoffice.Setup", - "Product/ooSetupExtension"); + return officecfg::Setup::Product::ooSetupExtension::get(); } OUString utl::ConfigManager::getProductName() { - return getConfigurationString( - "/org.openoffice.Setup", - "Product/ooName"); + return officecfg::Setup::Product::ooName::get(); } OUString utl::ConfigManager::getProductVersion() { - return getConfigurationString( - "/org.openoffice.Setup", - "Product/ooSetupVersion"); + return officecfg::Setup::Product::ooSetupVersion::get(); } OUString utl::ConfigManager::getVendor() { - return getConfigurationString( - "/org.openoffice.Setup", - "Product/ooVendor"); + return officecfg::Setup::Product::ooVendor::get(); } void utl::ConfigManager::storeConfigItems() { |