summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-05-23 13:44:10 +0200
committerStephan Bergmann <sbergman@redhat.com>2019-05-23 17:20:32 +0200
commitc2950d74b1a641ae45171143b5ea2b8acd4b0169 (patch)
treea4ee39c44ef96e37f24be5c8e953521ef877ef33 /unotools
parent3c815c9785047761eff7e2895764c81442279976 (diff)
Make utl::ConfigManager::get* use direct C++ config access internally
But some of those functions' names may be more telling than their configuration property counterparts, so there may be merit in keeping those trivial wrapper functions around. Change-Id: Ibbf4965fcefd58649920fad964b4a8d2108deaca Reviewed-on: https://gerrit.libreoffice.org/72836 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'unotools')
-rw-r--r--unotools/source/config/configmgr.cxx52
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() {