sd/source/core/CustomAnimationPreset.cxx | 37 +++++-------------------------- 1 file changed, 7 insertions(+), 30 deletions(-)
New commits: commit 1fc10944c9964e24361ea8ef87064a21446db571 Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Mon Jan 13 20:06:19 2020 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu Jan 16 07:09:11 2020 +0100 use FastParser in CustomAnimationPreset Change-Id: I587491e60543e2d0b7cb49571ba146e12bd5610a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86711 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sd/source/core/CustomAnimationPreset.cxx b/sd/source/core/CustomAnimationPreset.cxx index 1f16b3724fc4..f2358fe18bf5 100644 --- a/sd/source/core/CustomAnimationPreset.cxx +++ b/sd/source/core/CustomAnimationPreset.cxx @@ -26,7 +26,7 @@ #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/configuration/theDefaultProvider.hpp> #include <com/sun/star/xml/sax/InputSource.hpp> -#include <com/sun/star/xml/sax/Parser.hpp> +#include <com/sun/star/xml/sax/FastParser.hpp> #include <com/sun/star/xml/sax/SAXParseException.hpp> #include <com/sun/star/presentation/EffectPresetClass.hpp> #include <com/sun/star/beans/NamedValue.hpp> @@ -39,6 +39,7 @@ #include <comphelper/lok.hxx> #include <unotools/syslocaleoptions.hxx> #include <tools/stream.hxx> +#include <tools/diagnose_ex.h> #include <tools/debug.hxx> #include <vcl/svapp.hxx> @@ -231,41 +232,17 @@ Reference< XAnimationNode > implImportEffects( const Reference< XMultiServiceFac aParserInput.sSystemId = rPath; aParserInput.aInputStream = xInputStream; - // get parser - Reference< xml::sax::XParser > xParser = xml::sax::Parser::create( comphelper::getComponentContext(xServiceFactory) ); - // get filter - Reference< xml::sax::XDocumentHandler > xFilter( xServiceFactory->createInstance("com.sun.star.comp.Xmloff.AnimationsImport" ), UNO_QUERY ); - - DBG_ASSERT( xFilter.is(), "Can't instantiate filter component." ); - if( !xFilter.is() ) - return xRootNode; - - // connect parser and filter - xParser->setDocumentHandler( xFilter ); + Reference< xml::sax::XFastParser > xFilter( xServiceFactory->createInstance("com.sun.star.comp.Xmloff.AnimationsImport" ), UNO_QUERY_THROW ); - // finally, parser the stream - xParser->parseStream( aParserInput ); + xFilter->parseStream( aParserInput ); - Reference< XAnimationNodeSupplier > xAnimationNodeSupplier( xFilter, UNO_QUERY ); - if( xAnimationNodeSupplier.is() ) - xRootNode = xAnimationNodeSupplier->getAnimationNode(); - } - catch (const xml::sax::SAXParseException&) - { - OSL_FAIL( "sd::implImportEffects(), SAXParseException caught!" ); - } - catch (const xml::sax::SAXException&) - { - OSL_FAIL( "sd::implImportEffects(), SAXException caught!" ); - } - catch (const io::IOException&) - { - OSL_FAIL( "sd::implImportEffects(), IOException caught!" ); + Reference< XAnimationNodeSupplier > xAnimationNodeSupplier( xFilter, UNO_QUERY_THROW ); + xRootNode = xAnimationNodeSupplier->getAnimationNode(); } catch (const Exception&) { - OSL_FAIL( "sd::importEffects(), Exception caught!" ); + TOOLS_WARN_EXCEPTION("sd", ""); } return xRootNode; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits