Kaydet (Commit) c9d037c3 authored tarafından Julien Nabet's avatar Julien Nabet Kaydeden (comit) Fridrich Strba

fdo#46037: no more comphelper/configurationhelper.hxx in filter

Change-Id: I8b839dcf1f1a6247800f0bf054b2872b1acf800a
Reviewed-on: https://gerrit.libreoffice.org/5082Reviewed-by: 's avatarFridrich Strba <fridrich@documentfoundation.org>
Tested-by: 's avatarFridrich Strba <fridrich@documentfoundation.org>
üst ec52a20e
...@@ -23,6 +23,8 @@ $(eval $(call gb_Library_set_componentfile,filterconfig,filter/source/config/cac ...@@ -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_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_use_sdk_api,filterconfig))
$(eval $(call gb_Library_set_include,filterconfig,\ $(eval $(call gb_Library_set_include,filterconfig,\
......
...@@ -165,9 +165,7 @@ ...@@ -165,9 +165,7 @@
#define CFGPACKAGE_TD_TYPES _FILTER_CONFIG_FROM_ASCII_("/org.openoffice.TypeDetection.Types" ) #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_FILTERS _FILTER_CONFIG_FROM_ASCII_("/org.openoffice.TypeDetection.Filter")
#define CFGPACKAGE_TD_OTHERS _FILTER_CONFIG_FROM_ASCII_("/org.openoffice.TypeDetection.Misc" ) #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_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. /** @short some default values.
*/ */
......
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
#include <tools/wldcrd.hxx> #include <tools/wldcrd.hxx>
#include <i18nlangtag/languagetag.hxx> #include <i18nlangtag/languagetag.hxx>
#include <comphelper/configurationhelper.hxx> #include <officecfg/Setup.hxx>
namespace filter{ namespace filter{
...@@ -2404,12 +2404,7 @@ sal_Bool FilterCache::impl_isModuleInstalled(const OUString& sModule) ...@@ -2404,12 +2404,7 @@ sal_Bool FilterCache::impl_isModuleInstalled(const OUString& sModule)
::osl::ResettableMutexGuard aLock(m_aLock); ::osl::ResettableMutexGuard aLock(m_aLock);
if (! m_xModuleCfg.is()) if (! m_xModuleCfg.is())
{ {
m_xModuleCfg = css::uno::Reference< css::container::XNameAccess >( m_xModuleCfg = officecfg::Setup::Office::Factories::get();
::comphelper::ConfigurationHelper::openConfig(
comphelper::getProcessComponentContext(),
"org.openoffice.Setup/Office/Factories",
::comphelper::ConfigurationHelper::E_READONLY),
css::uno::UNO_QUERY_THROW);
} }
xCfg = m_xModuleCfg; xCfg = m_xModuleCfg;
......
...@@ -26,8 +26,9 @@ ...@@ -26,8 +26,9 @@
#include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/lang/XInitialization.hpp>
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
#include <comphelper/enumhelper.hxx> #include <comphelper/enumhelper.hxx>
#include <comphelper/configurationhelper.hxx>
#include <rtl/ustrbuf.hxx> #include <rtl/ustrbuf.hxx>
#include <officecfg/Setup.hxx>
#include <officecfg/TypeDetection/UISort.hxx>
namespace filter{ namespace filter{
...@@ -475,22 +476,9 @@ OUStringList FilterFactory::impl_getListOfInstalledModules() const ...@@ -475,22 +476,9 @@ OUStringList FilterFactory::impl_getListOfInstalledModules() const
aLock.clear(); aLock.clear();
// <- SAFE ---------------------- // <- SAFE ----------------------
try css::uno::Reference< css::container::XNameAccess > xModuleConfig = officecfg::Setup::Office::Factories::get(xContext);
{ OUStringList lModules(xModuleConfig->getElementNames());
css::uno::Reference< css::container::XNameAccess > xModuleConfig( return lModules;
::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();
} }
...@@ -560,13 +548,8 @@ OUStringList FilterFactory::impl_readSortedFilterListFromConfig(const OUString& ...@@ -560,13 +548,8 @@ OUStringList FilterFactory::impl_readSortedFilterListFromConfig(const OUString&
try try
{ {
css::uno::Reference< css::container::XNameAccess > xUISortConfig( css::uno::Reference< css::container::XNameAccess > xUISortConfig = officecfg::TypeDetection::UISort::ModuleDependendFilterOrder::get(xContext);
::comphelper::ConfigurationHelper::openConfig( xContext, // dont check the module name here. If it does not exists, an exception is thrown and catched below.
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.
// We return an empty list as result then. // We return an empty list as result then.
css::uno::Reference< css::container::XNameAccess > xModule; css::uno::Reference< css::container::XNameAccess > xModule;
xUISortConfig->getByName(sModule) >>= xModule; xUISortConfig->getByName(sModule) >>= xModule;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment