use more officecfg in DefaultNumberingProvider

Change-Id: I3b11bed579ec2ea86cac7fef57049a2279567a37
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167642
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2024-05-14 19:42:37 +02:00 committed by Noel Grandin
parent 6555238fc6
commit 0cf10e8669
2 changed files with 7 additions and 17 deletions

View file

@ -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 \

View file

@ -32,6 +32,7 @@
#include <string.h>
#include <comphelper/propertysequence.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <officecfg/Office/Common.hxx>
// 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<uno::Any> aArgs(comphelper::InitAnyPropertySequence(
{
{"nodepath", uno::Any(u"/org.openoffice.Office.Common/I18N"_ustr)}
}));
Reference<XInterface> 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);