[Libreoffice-commits] core.git: svx/source

Mohammed Abdul Azeem azeemmysore at gmail.com
Tue Mar 20 21:28:56 UTC 2018


 svx/source/xml/xmlexport.cxx |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit 2dadf90aa7bb03d895abc05ec93ca116eb9bacbd
Author: Mohammed Abdul Azeem <azeemmysore at gmail.com>
Date:   Tue Mar 20 23:52:47 2018 +0530

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

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;
         }


More information about the Libreoffice-commits mailing list