summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8/docxsdrexport.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-02-05 09:18:28 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-02-06 11:00:43 +0100
commit623abd5df5e6a9932fc2a00d8790f288f19c9182 (patch)
tree17e5eeef494c0777ce1b23c9f3e63f04f0509b68 /sw/source/filter/ww8/docxsdrexport.cxx
parent7d308dbfedaadc874ff4eebddca36760ba50de86 (diff)
cid#1472784 Dereference null return value
Change-Id: Ifb6dc31b00ea170923d8cdb636185275e6877ca2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110457 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/filter/ww8/docxsdrexport.cxx')
-rw-r--r--sw/source/filter/ww8/docxsdrexport.cxx6
1 files changed, 2 insertions, 4 deletions
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx
index 27116bceb349..98f7c2d98e28 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -795,15 +795,13 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons
m_pImpl->getSerializer()->endElementNS(XML_wp, nWrapToken);
}
}
- else
+ else if (SdrObject* pSdrObj = const_cast<SdrObject*>(pFrameFormat->FindRealSdrObject()))
{
// In this case we likely had an odt document to be exported to docx.
// There is no grab-bag or something else so for a workaround,
// let's export the geometry of the shape...
// First get the UNO-shape
- uno::Reference<drawing::XShape> xShape(
- const_cast<SdrObject*>(pFrameFormat->FindRealSdrObject())->getUnoShape(),
- uno::UNO_QUERY);
+ uno::Reference<drawing::XShape> xShape(pSdrObj->getUnoShape(), uno::UNO_QUERY);
if (xShape && xShape->getShapeType() == u"com.sun.star.drawing.CustomShape")
{