Kaydet (Commit) d5903802 authored tarafından Mohammed Abdul Azeem's avatar Mohammed Abdul Azeem Kaydeden (comit) Michael Meeks

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/51815Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
üst 863ff42c
......@@ -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 )
{
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment