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>
This commit is contained in:
committed by
Michael Meeks
parent
863ff42c13
commit
d5903802e2
@@ -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,
|
||||
|
@@ -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 )
|
||||
{
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user