diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2019-12-22 20:21:31 +0100 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-12-23 07:41:13 +0100 |
commit | 276a90c6b3fb046df13ae85dcdec5f28f23ee527 (patch) | |
tree | 2d2d25fe72cb7604cd6f7028bedd0365efee22bc /oox | |
parent | 3f8fc1a384cafdb61a2cfc654d1641f81d58bb34 (diff) |
tdf#46037: remove configurationhelper in oox/vbaproject
Change-Id: I431216749e70f531a26432cb25909ff3c7fb3de5
Reviewed-on: https://gerrit.libreoffice.org/85715
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/Library_oox.mk | 5 | ||||
-rw-r--r-- | oox/source/ole/vbaproject.cxx | 42 |
2 files changed, 10 insertions, 37 deletions
diff --git a/oox/Library_oox.mk b/oox/Library_oox.mk index cc235b87e360..543907996687 100644 --- a/oox/Library_oox.mk +++ b/oox/Library_oox.mk @@ -11,7 +11,10 @@ $(eval $(call gb_Library_Library,oox)) $(eval $(call gb_Library_set_precompiled_header,oox,oox/inc/pch/precompiled_oox)) -$(eval $(call gb_Library_use_custom_headers,oox,oox/generated)) +$(eval $(call gb_Library_use_custom_headers,oox,\ + oox/generated \ + officecfg/registry \ +)) $(eval $(call gb_Library_set_include,oox,\ $$(INCLUDE) \ diff --git a/oox/source/ole/vbaproject.cxx b/oox/source/ole/vbaproject.cxx index bf31f2a2350f..afc787cba19d 100644 --- a/oox/source/ole/vbaproject.cxx +++ b/oox/source/ole/vbaproject.cxx @@ -30,13 +30,13 @@ #include <com/sun/star/script/vba/XVBACompatibility.hpp> #include <com/sun/star/script/vba/XVBAMacroResolver.hpp> #include <com/sun/star/uno/XComponentContext.hpp> -#include <comphelper/configurationhelper.hxx> #include <comphelper/documentinfo.hxx> #include <comphelper/storagehelper.hxx> #include <osl/diagnose.h> #include <rtl/tencinfo.h> #include <rtl/ustrbuf.h> #include <sal/log.hxx> +#include <officecfg/Office/Calc.hxx> #include <oox/helper/binaryinputstream.hxx> #include <oox/helper/containerhelper.hxx> #include <oox/helper/propertyset.hxx> @@ -62,39 +62,9 @@ using namespace ::com::sun::star::script; using namespace ::com::sun::star::script::vba; using namespace ::com::sun::star::uno; -using ::comphelper::ConfigurationHelper; - -namespace { - -bool lclReadConfigItem( const Reference< XInterface >& rxConfigAccess, const OUString& rItemName ) +VbaFilterConfig::VbaFilterConfig( const Reference< XComponentContext >& rxContext, const OUString& /* rConfigCompName */) + : mxConfigAccess(rxContext) { - // some applications do not support all configuration items, assume 'false' in this case - try - { - Any aItem = ConfigurationHelper::readRelativeKey( rxConfigAccess, "Filter/Import/VBA", rItemName ); - return aItem.has< bool >() && aItem.get< bool >(); - } - catch(const Exception& ) - { - } - return false; -} - -} // namespace - -VbaFilterConfig::VbaFilterConfig( const Reference< XComponentContext >& rxContext, const OUString& rConfigCompName ) -{ - OSL_ENSURE( rxContext.is(), "VbaFilterConfig::VbaFilterConfig - missing component context" ); - if( rxContext.is() ) try - { - OSL_ENSURE( !rConfigCompName.isEmpty(), "VbaFilterConfig::VbaFilterConfig - invalid configuration component name" ); - OUString aConfigPackage = "org.openoffice.Office." + rConfigCompName; - mxConfigAccess = ConfigurationHelper::openConfig( rxContext, aConfigPackage, comphelper::EConfigurationModes::ReadOnly ); - } - catch(const Exception& ) - { - } - OSL_ENSURE( mxConfigAccess.is(), "VbaFilterConfig::VbaFilterConfig - cannot open configuration" ); } VbaFilterConfig::~VbaFilterConfig() @@ -103,17 +73,17 @@ VbaFilterConfig::~VbaFilterConfig() bool VbaFilterConfig::isImportVba() const { - return lclReadConfigItem( mxConfigAccess, "Load" ); + return officecfg::Office::Calc::Filter::Import::VBA::Load::get(mxConfigAccess); } bool VbaFilterConfig::isImportVbaExecutable() const { - return lclReadConfigItem( mxConfigAccess, "Executable" ); + return officecfg::Office::Calc::Filter::Import::VBA::Executable::get(mxConfigAccess); } bool VbaFilterConfig::isExportVba() const { - return lclReadConfigItem( mxConfigAccess, "Save" ); + return officecfg::Office::Calc::Filter::Import::VBA::Save::get(mxConfigAccess); } VbaMacroAttacherBase::VbaMacroAttacherBase( const OUString& rMacroName ) : |