summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2013-07-24 21:18:13 +0200
committerFridrich Strba <fridrich@documentfoundation.org>2013-07-24 20:19:25 +0000
commitc9d037c3e814eafb6db1fbafa2d3f9d097886873 (patch)
treecd466db9b0abe122245e9762f4f99897f4f6ed5d
parentec52a20edbd7243bba041259d93608c2dac4b39c (diff)
fdo#46037: no more comphelper/configurationhelper.hxx in filter
Change-Id: I8b839dcf1f1a6247800f0bf054b2872b1acf800a Reviewed-on: https://gerrit.libreoffice.org/5082 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
-rw-r--r--filter/Library_filterconfig.mk2
-rw-r--r--filter/source/config/cache/constant.hxx2
-rw-r--r--filter/source/config/cache/filtercache.cxx9
-rw-r--r--filter/source/config/cache/filterfactory.cxx31
4 files changed, 11 insertions, 33 deletions
diff --git a/filter/Library_filterconfig.mk b/filter/Library_filterconfig.mk
index 1fb26486541a..ce4475b44c3d 100644
--- a/filter/Library_filterconfig.mk
+++ b/filter/Library_filterconfig.mk
@@ -23,6 +23,8 @@ $(eval $(call gb_Library_set_componentfile,filterconfig,filter/source/config/cac
$(eval $(call gb_Library_use_external,filterconfig,boost_headers))
+$(eval $(call gb_Library_use_custom_headers,filterconfig,officecfg/registry))
+
$(eval $(call gb_Library_use_sdk_api,filterconfig))
$(eval $(call gb_Library_set_include,filterconfig,\
diff --git a/filter/source/config/cache/constant.hxx b/filter/source/config/cache/constant.hxx
index 3e5692f1c06a..6e34ceee2b05 100644
--- a/filter/source/config/cache/constant.hxx
+++ b/filter/source/config/cache/constant.hxx
@@ -165,9 +165,7 @@
#define CFGPACKAGE_TD_TYPES _FILTER_CONFIG_FROM_ASCII_("/org.openoffice.TypeDetection.Types" )
#define CFGPACKAGE_TD_FILTERS _FILTER_CONFIG_FROM_ASCII_("/org.openoffice.TypeDetection.Filter")
#define CFGPACKAGE_TD_OTHERS _FILTER_CONFIG_FROM_ASCII_("/org.openoffice.TypeDetection.Misc" )
-#define CFGPACKAGE_TD_UISORT _FILTER_CONFIG_FROM_ASCII_("/org.openoffice.TypeDetection.UISort/ModuleDependendFilterOrder")
#define CFGPACKAGE_TD_OLD _FILTER_CONFIG_FROM_ASCII_("/org.openoffice.Office.TypeDetection")
-#define CFGPACKAGE_OOO_MODULES _FILTER_CONFIG_FROM_ASCII_("/org.openoffice.Setup/Office/Factories")
/** @short some default values.
*/
diff --git a/filter/source/config/cache/filtercache.cxx b/filter/source/config/cache/filtercache.cxx
index f5d7e69c3b3e..d69897db7a15 100644
--- a/filter/source/config/cache/filtercache.cxx
+++ b/filter/source/config/cache/filtercache.cxx
@@ -49,7 +49,7 @@
#include <tools/wldcrd.hxx>
#include <i18nlangtag/languagetag.hxx>
-#include <comphelper/configurationhelper.hxx>
+#include <officecfg/Setup.hxx>
namespace filter{
@@ -2404,12 +2404,7 @@ sal_Bool FilterCache::impl_isModuleInstalled(const OUString& sModule)
::osl::ResettableMutexGuard aLock(m_aLock);
if (! m_xModuleCfg.is())
{
- m_xModuleCfg = css::uno::Reference< css::container::XNameAccess >(
- ::comphelper::ConfigurationHelper::openConfig(
- comphelper::getProcessComponentContext(),
- "org.openoffice.Setup/Office/Factories",
- ::comphelper::ConfigurationHelper::E_READONLY),
- css::uno::UNO_QUERY_THROW);
+ m_xModuleCfg = officecfg::Setup::Office::Factories::get();
}
xCfg = m_xModuleCfg;
diff --git a/filter/source/config/cache/filterfactory.cxx b/filter/source/config/cache/filterfactory.cxx
index 2193300030e5..07559b1cbad0 100644
--- a/filter/source/config/cache/filterfactory.cxx
+++ b/filter/source/config/cache/filterfactory.cxx
@@ -26,8 +26,9 @@
#include <com/sun/star/lang/XInitialization.hpp>
#include <comphelper/processfactory.hxx>
#include <comphelper/enumhelper.hxx>
-#include <comphelper/configurationhelper.hxx>
#include <rtl/ustrbuf.hxx>
+#include <officecfg/Setup.hxx>
+#include <officecfg/TypeDetection/UISort.hxx>
namespace filter{
@@ -475,22 +476,9 @@ OUStringList FilterFactory::impl_getListOfInstalledModules() const
aLock.clear();
// <- SAFE ----------------------
- try
- {
- css::uno::Reference< css::container::XNameAccess > xModuleConfig(
- ::comphelper::ConfigurationHelper::openConfig( xContext,
- CFGPACKAGE_OOO_MODULES,
- ::comphelper::ConfigurationHelper::E_READONLY),
- css::uno::UNO_QUERY_THROW);
- OUStringList lModules(xModuleConfig->getElementNames());
- return lModules;
- }
- catch(const css::uno::RuntimeException&)
- { throw; }
- catch(const css::uno::Exception&)
- {}
-
- return OUStringList();
+ css::uno::Reference< css::container::XNameAccess > xModuleConfig = officecfg::Setup::Office::Factories::get(xContext);
+ OUStringList lModules(xModuleConfig->getElementNames());
+ return lModules;
}
@@ -560,13 +548,8 @@ OUStringList FilterFactory::impl_readSortedFilterListFromConfig(const OUString&
try
{
- css::uno::Reference< css::container::XNameAccess > xUISortConfig(
- ::comphelper::ConfigurationHelper::openConfig( xContext,
- CFGPACKAGE_TD_UISORT,
- ::comphelper::ConfigurationHelper::E_READONLY),
- css::uno::UNO_QUERY_THROW);
-
- // dont ccheck the module name here. If it does not exists, an exception is thrown and catched below.
+ css::uno::Reference< css::container::XNameAccess > xUISortConfig = officecfg::TypeDetection::UISort::ModuleDependendFilterOrder::get(xContext);
+ // dont check the module name here. If it does not exists, an exception is thrown and catched below.
// We return an empty list as result then.
css::uno::Reference< css::container::XNameAccess > xModule;
xUISortConfig->getByName(sModule) >>= xModule;