[Libreoffice-commits] core.git: xmloff/source
Mohammed Abdul Azeem
azeemmysore at gmail.com
Mon Aug 14 08:37:58 UTC 2017
xmloff/source/core/xmlimp.cxx | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
New commits:
commit eee6d1a90dd74808fb7825102c4ee38ea4919cbf
Author: Mohammed Abdul Azeem <azeemmysore at gmail.com>
Date: Sat Aug 12 00:02:32 2017 +0530
Using static_cast instead of dynamic_cast:
This is just a downcast and the object is always expected
to be SvXMLImportContext.
Change-Id: I755b6b366144d86104b1284fabe3dba74fb54452
Reviewed-on: https://gerrit.libreoffice.org/41063
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Michael Stahl <mstahl at redhat.com>
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index c502d0d7e67e..d58cb4216139 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -843,8 +843,9 @@ void SAL_CALL SvXMLImport::startFastElement (sal_Int32 Element,
maNamespaceHandler->addNSDeclAttributes( maNamespaceAttrList );
std::unique_ptr<SvXMLNamespaceMap> pRewindMap(
processNSAttributes( maNamespaceAttrList.get() ));
- SvXMLImportContext *pContext = dynamic_cast<SvXMLImportContext*>( xContext.get() );
- if( pContext && pRewindMap )
+ assert( dynamic_cast<SvXMLImportContext*>( xContext.get() ) != nullptr );
+ SvXMLImportContext *pContext = static_cast<SvXMLImportContext*>( xContext.get() );
+ if (pRewindMap)
pContext->PutRewindMap(std::move(pRewindMap));
maContexts.push(pContext);
}
More information about the Libreoffice-commits
mailing list