xmlhelp/source/cxxhelp/provider/databases.cxx | 23 ++++------------------- xmlhelp/source/cxxhelp/provider/databases.hxx | 2 +- xmlhelp/source/cxxhelp/provider/urlparameter.cxx | 2 +- 3 files changed, 6 insertions(+), 21 deletions(-)
New commits: commit bab6d9c44ba39d08bbee43bca4a461bca52c07e1 Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Wed May 15 18:57:09 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu May 16 10:57:12 2024 +0200 use more officecfg in xmlhelp::Databases Change-Id: Iba6c3d0ed3d4d029a4497f56a8412c88bde5246c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167702 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx index 69fe80d78552..83083e7d0e16 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.cxx +++ b/xmlhelp/source/cxxhelp/provider/databases.cxx @@ -57,6 +57,7 @@ #include <comphelper/propertyvalue.hxx> #include <comphelper/storagehelper.hxx> +#include <officecfg/Office/Common.hxx> #include <utility> #include "databases.hxx" @@ -176,26 +177,10 @@ Databases::~Databases() m_aKeywordInfo.clear(); } -OString Databases::getImageTheme() const +// static +OString Databases::getImageTheme() { - uno::Reference< lang::XMultiServiceFactory > xConfigProvider = - configuration::theDefaultProvider::get(m_xContext); - - // set root path - uno::Sequence<uno::Any> lParams(comphelper::InitAnyPropertySequence( - { - {"nodepath", uno::Any(u"org.openoffice.Office.Common"_ustr)} - })); - - // open it - uno::Reference< uno::XInterface > xCFG( xConfigProvider->createInstanceWithArguments( - u"com.sun.star.configuration.ConfigurationAccess"_ustr, - lParams) ); - - uno::Reference< container::XHierarchicalNameAccess > xAccess(xCFG, uno::UNO_QUERY_THROW); - uno::Any aResult = xAccess->getByHierarchicalName(u"Misc/SymbolStyle"_ustr); - OUString aSymbolsStyleName; - aResult >>= aSymbolsStyleName; + OUString aSymbolsStyleName = officecfg::Office::Common::Misc::SymbolStyle::get(); if ( aSymbolsStyleName.isEmpty() || aSymbolsStyleName == "auto" ) { diff --git a/xmlhelp/source/cxxhelp/provider/databases.hxx b/xmlhelp/source/cxxhelp/provider/databases.hxx index 448d1f92cd71..c80e2e2dfad6 100644 --- a/xmlhelp/source/cxxhelp/provider/databases.hxx +++ b/xmlhelp/source/cxxhelp/provider/databases.hxx @@ -143,7 +143,7 @@ namespace chelp { ~Databases(); - OString getImageTheme() const; + static OString getImageTheme(); OUString getInstallPathAsURL(); OUString getInstallPathAsURL(std::unique_lock<std::mutex>& rGuard); diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx index c242c74add2d..f10a4ad2fff6 100644 --- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx +++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx @@ -746,7 +746,7 @@ InputStreamTransformer::InputStreamTransformer( URLParameter* urlParam, RTL_TEXTENCODING_UTF8 ) + "'"; parString[last++] = "imgtheme"_ostr; - parString[last++] = "'" + pDatabases->getImageTheme() + "'"; + parString[last++] = "'" + chelp::Databases::getImageTheme() + "'"; parString[last++] = "hp"_ostr; parString[last++] = "'" + urlParam->getByName( "HelpPrefix" ) + "'";