[Libreoffice-commits] core.git: reportdesign/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Tue Jan 14 06:11:14 UTC 2020
reportdesign/source/filter/xml/xmlfilter.cxx | 25 +++++++++++++++----------
1 file changed, 15 insertions(+), 10 deletions(-)
New commits:
commit 7ae61449ccbeaf6a0b2aa8e81aad394b18565943
Author: Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Mon Jan 13 19:08:39 2020 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Jan 14 07:10:37 2020 +0100
use FastParser in reportdesign
Change-Id: Ib012e7c814184eaeaab57200107e8bf4887058f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86707
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/reportdesign/source/filter/xml/xmlfilter.cxx b/reportdesign/source/filter/xml/xmlfilter.cxx
index 2a510dee12af..917dd5209411 100644
--- a/reportdesign/source/filter/xml/xmlfilter.cxx
+++ b/reportdesign/source/filter/xml/xmlfilter.cxx
@@ -130,21 +130,15 @@ static ErrCode ReadThroughComponent(
OSL_ENSURE(xModelComponent.is(), "document missing");
OSL_ENSURE(rContext.is(), "factory missing");
- // prepare ParserInputSrouce
+ // prepare Parser InputSource
InputSource aParserInput;
aParserInput.aInputStream = xInputStream;
- // get parser
- uno::Reference< XParser > xParser = xml::sax::Parser::create(rContext);
- SAL_INFO( "reportdesign", "parser created" );
// get filter
- OSL_ENSURE( _xFilter.is(), "Can't instantiate filter component." );
+ SAL_WARN_IF( !_xFilter.is(), "reportdesign", "Can't instantiate filter component." );
if( !_xFilter.is() )
return ErrCode(1);
- // connect parser and filter
- xParser->setDocumentHandler( _xFilter );
-
// connect model and filter
uno::Reference < XImporter > xImporter( _xFilter, UNO_QUERY );
xImporter->setTargetDocument( xModelComponent );
@@ -152,11 +146,20 @@ static ErrCode ReadThroughComponent(
// finally, parser the stream
try
{
- xParser->parseStream( aParserInput );
+ uno::Reference < XFastParser > xFastParser( _xFilter, UNO_QUERY );\
+ if (xFastParser.is())
+ xFastParser->parseStream( aParserInput );
+ else
+ {
+ uno::Reference< XParser > xParser = xml::sax::Parser::create(rContext);
+ // connect parser and filter
+ xParser->setDocumentHandler( _xFilter );
+ xParser->parseStream( aParserInput );
+ }
}
catch (const SAXParseException&)
{
- TOOLS_WARN_EXCEPTION( "reportdesign", "SAX parse exception caught while importing");
+ TOOLS_WARN_EXCEPTION( "reportdesign", "");
return ErrCode(1);
}
catch (const SAXException&)
@@ -169,10 +172,12 @@ static ErrCode ReadThroughComponent(
}
catch (const IOException&)
{
+ TOOLS_WARN_EXCEPTION( "reportdesign", "");
return ErrCode(1);
}
catch (const Exception&)
{
+ TOOLS_WARN_EXCEPTION( "reportdesign", "");
return ErrCode(1);
}
More information about the Libreoffice-commits
mailing list