From 70f3a94949cce612be9eff14fca94976acfc61a4 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 29 Mar 2022 20:00:09 +0100 Subject: tdf#117162 ImportDocumentHandler expected XDocumentHandler argument MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit but SvXMLImport not longer supports XDocumentHandler since commit fe2b4e7dc6533535736a8f08496f316427386179 Date: Tue Oct 6 18:27:27 2020 +0200 make SvXMLImport fast-parser only here use a SvXMLLegacyToFastDocHandler to try and glue the two parts together again. Though the use of reflection::XProxyFactory is a bit worrying here wrt this change so unforseen side effects are possible. Full change over to fast-parser only is probably advisable. Change-Id: Ie14d1d9fa8534c187efc67a6c1cc0989316c4634 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132285 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx | 8 +++++--- reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'reportdesign') diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx index 3d8b2c1be603..963264436092 100644 --- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx +++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx @@ -331,13 +331,15 @@ void SAL_CALL ImportDocumentHandler::initialize( const uno::Sequence< uno::Any > { ::osl::MutexGuard aGuard(m_aMutex); comphelper::SequenceAsHashMap aArgs(_aArguments); - m_xDelegatee = aArgs.getUnpackedValueOrDefault("DocumentHandler",m_xDelegatee); + m_xDocumentHandler = aArgs.getUnpackedValueOrDefault("DocumentHandler",m_xDocumentHandler); m_xModel = aArgs.getUnpackedValueOrDefault("Model",m_xModel); - OSL_ENSURE(m_xDelegatee.is(),"No document handler available!"); - if ( !m_xDelegatee.is() || !m_xModel.is() ) + OSL_ENSURE(m_xDocumentHandler.is(), "No document handler available!"); + if (!m_xDocumentHandler.is() || !m_xModel.is()) throw uno::Exception("no delegatee and no model", nullptr); + m_xDelegatee.set(new SvXMLLegacyToFastDocHandler(dynamic_cast(m_xDocumentHandler.get()))); + m_xDatabaseDataProvider.set(m_xModel->getDataProvider(),uno::UNO_QUERY); if ( !m_xDatabaseDataProvider.is() ) { diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx index 342194a9612a..aadea441ca62 100644 --- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx +++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.hxx @@ -23,12 +23,14 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include class SvXMLTokenMap; @@ -77,6 +79,7 @@ private: ::std::vector< OUString> m_aDetailFields; css::uno::Sequence< css::beans::PropertyValue > m_aArguments; css::uno::Reference< css::uno::XComponentContext > m_xContext; + css::uno::Reference m_xDocumentHandler; css::uno::Reference< css::xml::sax::XDocumentHandler > m_xDelegatee; css::uno::Reference< css::uno::XAggregation > m_xProxy; css::uno::Reference< css::lang::XTypeProvider > m_xTypeProvider; -- cgit v1.2.3