[Libreoffice-commits] core.git: xmloff/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Sat Oct 17 14:40:55 UTC 2020
xmloff/source/transform/TransformerBase.cxx | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
New commits:
commit 49ba005c111b50c2d7b6c8c68d0a09d4eafa7288
Author: Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sat Oct 17 15:46:00 2020 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Oct 17 16:40:14 2020 +0200
TransformerBase: use the fastparser API when possible
part of the process of making SvXMLImport fastparser-only
Change-Id: Ie93e846e745b4388b891a68740c17742bbd62e82
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104465
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/xmloff/source/transform/TransformerBase.cxx b/xmloff/source/transform/TransformerBase.cxx
index 1b9e43fc9c19..c55e29562558 100644
--- a/xmloff/source/transform/TransformerBase.cxx
+++ b/xmloff/source/transform/TransformerBase.cxx
@@ -19,6 +19,7 @@
#include <rtl/ref.hxx>
#include <rtl/ustrbuf.hxx>
+#include <sal/log.hxx>
#include <osl/diagnose.h>
#include <com/sun/star/i18n/CharacterClassification.hpp>
#include <com/sun/star/i18n/UnicodeType.hpp>
@@ -382,22 +383,23 @@ void SAL_CALL XMLTransformerBase::initialize( const Sequence< Any >& aArguments
// The Any shift operator can't be used to query the type because it
// uses queryInterface, and the model also has a XPropertySet interface.
+ css::uno::Reference< XFastDocumentHandler > xFastHandler;
+ if( (rArgument >>= xFastHandler) && xFastHandler )
+ {
+ SvXMLImport *pFastHandler = dynamic_cast<SvXMLImport*>( xFastHandler.get() );
+ assert(pFastHandler);
+ m_xHandler.set( new SvXMLLegacyToFastDocHandler( pFastHandler ) );
+ }
// document handler
- if( cppu::UnoType<XDocumentHandler>::get().isAssignableFrom( rArgument.getValueType() ) )
+ else if( cppu::UnoType<XDocumentHandler>::get().isAssignableFrom( rArgument.getValueType() ) )
{
m_xHandler.set( rArgument, UNO_QUERY );
- // Type change to avoid crashing of dynamic_cast
- if (SvXMLImport *pFastHandler = dynamic_cast<SvXMLImport*>(
- uno::Reference< XFastDocumentHandler >( m_xHandler, uno::UNO_QUERY ).get() ) )
- m_xHandler.set( new SvXMLLegacyToFastDocHandler( pFastHandler ) );
}
-
// property set to transport data across
- if( cppu::UnoType<XPropertySet>::get().isAssignableFrom( rArgument.getValueType() ) )
+ else if( cppu::UnoType<XPropertySet>::get().isAssignableFrom( rArgument.getValueType() ) )
m_xPropSet.set( rArgument, UNO_QUERY );
-
// xmodel
- if( cppu::UnoType<css::frame::XModel>::get().isAssignableFrom( rArgument.getValueType() ) )
+ else if( cppu::UnoType<css::frame::XModel>::get().isAssignableFrom( rArgument.getValueType() ) )
mxModel.set( rArgument, UNO_QUERY );
}
More information about the Libreoffice-commits
mailing list