From 0cf10e8669c6f40a2187624469682c5bbc0bfb4d Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 14 May 2024 19:42:37 +0200 Subject: [PATCH] use more officecfg in DefaultNumberingProvider Change-Id: I3b11bed579ec2ea86cac7fef57049a2279567a37 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167642 Tested-by: Jenkins Reviewed-by: Noel Grandin --- i18npool/Library_i18npool.mk | 4 ++++ .../defaultnumberingprovider.cxx | 20 +++---------------- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/i18npool/Library_i18npool.mk b/i18npool/Library_i18npool.mk index 0b72164bbf96..984137ebcf78 100644 --- a/i18npool/Library_i18npool.mk +++ b/i18npool/Library_i18npool.mk @@ -41,6 +41,10 @@ $(eval $(call gb_Library_use_externals,i18npool,\ icu_headers \ )) +$(eval $(call gb_Library_use_custom_headers,i18npool,\ + officecfg/registry \ +)) + ifeq ($(DISABLE_DYNLOADING),TRUE) $(eval $(call gb_Library_add_cxxflags,i18npool,\ -DDICT_JA_ZH_IN_DATAFILE \ diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx index a1630a1cc2bd..1ba942ca3b51 100644 --- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx +++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx @@ -32,6 +32,7 @@ #include #include #include +#include // Cyrillic upper case #define C_CYR_A "\xD0\x90" @@ -1201,23 +1202,8 @@ OUString DefaultNumberingProvider::makeNumberingIdentifier(sal_Int16 index) bool DefaultNumberingProvider::isScriptFlagEnabled(const OUString& aName) { - if (! xHierarchicalNameAccess.is()) { - Reference< XMultiServiceFactory > xConfigProvider = - configuration::theDefaultProvider::get(m_xContext); - - if (! xConfigProvider.is()) - throw RuntimeException(); - - uno::Sequence aArgs(comphelper::InitAnyPropertySequence( - { - {"nodepath", uno::Any(u"/org.openoffice.Office.Common/I18N"_ustr)} - })); - - Reference xInterface = xConfigProvider->createInstanceWithArguments( - u"com.sun.star.configuration.ConfigurationAccess"_ustr, aArgs); - - xHierarchicalNameAccess.set(xInterface, UNO_QUERY_THROW); - } + if (! xHierarchicalNameAccess.is()) + xHierarchicalNameAccess = officecfg::Office::Common::I18N::get(); Any aEnabled = xHierarchicalNameAccess->getByHierarchicalName(aName);