[Libreoffice-commits] core.git: filter/Library_filterconfig.mk filter/source

Julien Nabet serval2412 at yahoo.fr
Wed Jul 24 13:19:44 PDT 2013


 filter/Library_filterconfig.mk               |    2 +
 filter/source/config/cache/constant.hxx      |    2 -
 filter/source/config/cache/filtercache.cxx   |    9 +------
 filter/source/config/cache/filterfactory.cxx |   31 ++++++---------------------
 4 files changed, 11 insertions(+), 33 deletions(-)

New commits:
commit c9d037c3e814eafb6db1fbafa2d3f9d097886873
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Wed Jul 24 21:18:13 2013 +0200

    fdo#46037: no more comphelper/configurationhelper.hxx in filter
    
    Change-Id: I8b839dcf1f1a6247800f0bf054b2872b1acf800a
    Reviewed-on: https://gerrit.libreoffice.org/5082
    Reviewed-by: Fridrich Strba <fridrich at documentfoundation.org>
    Tested-by: Fridrich Strba <fridrich at documentfoundation.org>

diff --git a/filter/Library_filterconfig.mk b/filter/Library_filterconfig.mk
index 1fb2648..ce4475b 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 3e5692f..6e34cee 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 f5d7e69..d69897d 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 2193300..07559b1 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;


More information about the Libreoffice-commits mailing list