summaryrefslogtreecommitdiff
path: root/svx/source/xml
diff options
context:
space:
mode:
authorMohammed Abdul Azeem <azeemmysore@gmail.com>2018-03-20 23:52:47 +0530
committerMichael Meeks <michael.meeks@collabora.com>2018-03-20 22:28:34 +0100
commit2dadf90aa7bb03d895abc05ec93ca116eb9bacbd (patch)
tree31f75fb453570c49087b15443ad34e4260f3b2cc /svx/source/xml
parent82aab78ccd0aab7502260124d330155a569c170e (diff)
tdf#116482: Fix for Crash on drawing
Making the drawing layer import to use fastParser. Change-Id: I4ff05d65de525aef3e50676072a79c9c329e6afc Reviewed-on: https://gerrit.libreoffice.org/51673 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'svx/source/xml')
-rw-r--r--svx/source/xml/xmlexport.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/svx/source/xml/xmlexport.cxx b/svx/source/xml/xmlexport.cxx
index 5af7d92cb36d..26574eb02c09 100644
--- a/svx/source/xml/xmlexport.cxx
+++ b/svx/source/xml/xmlexport.cxx
@@ -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;
}