summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-11-03 18:42:44 +0100
committerStephan Bergmann <sbergman@redhat.com>2017-11-03 18:45:09 +0100
commita5c4b406a8ff80aaa2df96ce455d3b080b77a9a4 (patch)
treea2a0da24ae6a25d98d114891d7d2ef4bfed4fe28 /writerfilter
parent45780815b2ae9d07a249a7d84d332c8b402317a5 (diff)
Only downcast to OOXMLFastContextHandlerShape when actually necessary
After bd3c5c4c234e3dc6b89cd235321945a41a08d562 "[API CHANGE] tdf#65393 Import signature line images from ooxml", UBSan CppunitTest_chart2_export had started to fail with > writerfilter/source/ooxml/OOXMLFastContextHandler.cxx:1898:25: runtime error: downcast of address 0x61200070a440 which does not point to an object of type 'writerfilter::ooxml::OOXMLFastContextHandlerShape' > 0x61200070a440: note: object is of type 'writerfilter::ooxml::OOXMLFastContextHandlerWrapper' > 0e 10 00 20 50 86 4a 00 a2 7f 00 00 01 00 00 00 be be be be 00 00 00 00 00 00 00 00 00 00 00 00 > ^~~~~~~~~~~~~~~~~~~~~~~ > vptr for 'writerfilter::ooxml::OOXMLFastContextHandlerWrapper' Change-Id: I028ef619766466e8cd9bb0ca09174b926fc6d23c
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/ooxml/OOXMLFastContextHandler.cxx3
1 files changed, 1 insertions, 2 deletions
diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
index e25e7bc40fae..138954023f89 100644
--- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
+++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
@@ -1895,11 +1895,10 @@ OOXMLFastContextHandlerWrapper::lcl_createFastChildContext
// here until we need a more generic solution.
bool bIsWrap = Element == static_cast<sal_Int32>(NMSP_vmlWord | XML_wrap);
bool bIsSignatureLine = Element == static_cast<sal_Int32>(NMSP_vmlOffice | XML_signatureline);
- bool bIsShapeSent = static_cast<OOXMLFastContextHandlerShape*>(mpParent)->isShapeSent();
bool bSkipImages = getDocument()->IsSkipImages() && oox::getNamespace(Element) == static_cast<sal_Int32>(NMSP_dml) &&
!((oox::getBaseToken(Element) == XML_linkedTxbx) || (oox::getBaseToken(Element) == XML_txbx));
- if ( bInNamespaces && ((!bIsWrap && !bIsSignatureLine) || bIsShapeSent) )
+ if ( bInNamespaces && ((!bIsWrap && !bIsSignatureLine) || static_cast<OOXMLFastContextHandlerShape*>(mpParent)->isShapeSent()) )
xResult.set(OOXMLFactory::createFastChildContextFromStart(this, Element));
else if (mxContext.is() && !bSkipImages)
{