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

Mohammed Abdul Azeem azeemmysore at gmail.com
Mon Mar 26 08:04:44 UTC 2018


 filter/inc/svgreader.hxx        |    7 +++++++
 filter/source/svg/svgreader.cxx |   10 +++++++++-
 2 files changed, 16 insertions(+), 1 deletion(-)

New commits:
commit d5903802e2c40d6fccbc322c49b5f9a311551b9b
Author: Mohammed Abdul Azeem <azeemmysore at gmail.com>
Date:   Sun Mar 25 12:50:34 2018 +0530

    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 at libreoffice.org>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>

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 )
 {
 }
 


More information about the Libreoffice-commits mailing list