summaryrefslogtreecommitdiff
path: root/xmlhelp
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2024-05-15 18:57:09 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-05-16 10:57:12 +0200
commitbab6d9c44ba39d08bbee43bca4a461bca52c07e1 (patch)
tree0ea9cd29e8dfafeea8d3b504ede74aba724d68b0 /xmlhelp
parent86dcdfd097b0fdd91d69ecb8be0e72a84112a514 (diff)
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.grandin@collabora.co.uk>
Diffstat (limited to 'xmlhelp')
-rw-r--r--xmlhelp/source/cxxhelp/provider/databases.cxx23
-rw-r--r--xmlhelp/source/cxxhelp/provider/databases.hxx2
-rw-r--r--xmlhelp/source/cxxhelp/provider/urlparameter.cxx2
3 files changed, 6 insertions, 21 deletions
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" ) + "'";