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

tdf#116482: Fix for Crash on drawing

Making the drawing layer import to use fastParser.

Change-Id: I4ff05d65de525aef3e50676072a79c9c329e6afc
Reviewed-on: https://gerrit.libreoffice.org/51673Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
üst 82aab78c
......@@ -27,6 +27,7 @@
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/io/XActiveDataSource.hpp>
#include <com/sun/star/xml/sax/SAXParseException.hpp>
#include <com/sun/star/xml/sax/XFastParser.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
#include <com/sun/star/document/XFilter.hpp>
#include <com/sun/star/document/XExporter.hpp>
......@@ -204,6 +205,8 @@ bool SvxDrawingLayerImport( SdrModel* pModel, const uno::Reference<io::XInputStr
// get filter
Reference< xml::sax::XDocumentHandler > xFilter( xContext->getServiceManager()->createInstanceWithArgumentsAndContext( OUString::createFromAscii( pImportService ), aFilterArgs, xContext), UNO_QUERY );
uno::Reference< xml::sax::XFastParser > xFastParser = dynamic_cast<
xml::sax::XFastParser* >( xFilter.get() );
DBG_ASSERT( xFilter.is(), "Can't instantiate filter component." );
bRet = false;
......@@ -217,7 +220,10 @@ bool SvxDrawingLayerImport( SdrModel* pModel, const uno::Reference<io::XInputStr
xImporter->setTargetDocument( xTargetDocument );
// finally, parser the stream
xParser->parseStream( aParserInput );
if( xFastParser.is() )
xFastParser->parseStream( aParserInput );
else
xParser->parseStream( aParserInput );
bRet = true;
}
......
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