diff options
author | Mohammed Abdul Azeem <azeemmysore@gmail.com> | 2018-03-25 12:50:34 +0530 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2018-03-26 10:04:20 +0200 |
commit | d5903802e2c40d6fccbc322c49b5f9a311551b9b (patch) | |
tree | 8a381bce5926d87784cbaff11e07cb822d2315d5 | |
parent | 863ff42c1372e123018d4b22a085a08680bd3793 (diff) |
tdf#116467: fix for SVG files being imported as blank
Any SAX-to-SAX transformation, like in this case should
use SvXMLLegacyToFastDocHandler on the left end, as right
end of the pipe is moved to fast Contexts.
Used delegating constructor here, since m_xDocumentHandler
is constant in SVGReader class.
Change-Id: I1fc841c96aaa618f0b566fdb0301ad48fd869f1c
Reviewed-on: https://gerrit.libreoffice.org/51815
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
-rw-r--r-- | filter/inc/svgreader.hxx | 7 | ||||
-rw-r--r-- | filter/source/svg/svgreader.cxx | 10 |
2 files changed, 16 insertions, 1 deletions
diff --git a/filter/inc/svgreader.hxx b/filter/inc/svgreader.hxx index 29ff6ab4d7e9..3149e1770158 100644 --- a/filter/inc/svgreader.hxx +++ b/filter/inc/svgreader.hxx @@ -15,16 +15,23 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/xml/sax/XDocumentHandler.hpp> #include <com/sun/star/io/XInputStream.hpp> +#include <xmloff/xmlimp.hxx> namespace svgi { class SVGReader { +private: const css::uno::Reference< css::uno::XComponentContext > m_xContext; const css::uno::Reference< css::io::XInputStream > m_xInputStream; const css::uno::Reference< css::xml::sax::XDocumentHandler > m_xDocumentHandler; + SVGReader( const css::uno::Reference<css::uno::XComponentContext>& xContext, + const css::uno::Reference< css::io::XInputStream >& xInputStream, + const css::uno::Reference< css::xml::sax::XDocumentHandler >& xDocumentHandler, + SvXMLImport *pFastHandler); + public: FILTER_DLLPUBLIC SVGReader( const css::uno::Reference<css::uno::XComponentContext>& xContext, const css::uno::Reference< css::io::XInputStream >& xInputStream, diff --git a/filter/source/svg/svgreader.cxx b/filter/source/svg/svgreader.cxx index 5227bd072b50..bc78d0cce10a 100644 --- a/filter/source/svg/svgreader.cxx +++ b/filter/source/svg/svgreader.cxx @@ -2081,9 +2081,17 @@ static void dumpTree( const uno::Reference<xml::dom::XElement> xElem ) SVGReader::SVGReader(const uno::Reference<uno::XComponentContext>& xContext, const uno::Reference<io::XInputStream>& xInputStream, const uno::Reference<xml::sax::XDocumentHandler>& xDocumentHandler) : + SVGReader(xContext, xInputStream, xDocumentHandler, dynamic_cast<SvXMLImport *>(xDocumentHandler.get())) +{ +} + +SVGReader::SVGReader(const uno::Reference<uno::XComponentContext>& xContext, + const uno::Reference<io::XInputStream>& xInputStream, + const uno::Reference<xml::sax::XDocumentHandler>& xDocumentHandler, + SvXMLImport *pFastHandler) : m_xContext( xContext ), m_xInputStream( xInputStream ), - m_xDocumentHandler( xDocumentHandler ) + m_xDocumentHandler( pFastHandler != nullptr ? new SvXMLLegacyToFastDocHandler(pFastHandler) : xDocumentHandler ) { } |