diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-11-27 11:58:21 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-11-27 16:10:33 +0100 |
commit | 9a01dbc8683e9114d8fd0250cac0cbc33600458a (patch) | |
tree | c83af95370d3827c6a4c2f468595a04ab04ab84d /sc | |
parent | 55858a50cfb12cb6a4207bf906df676e799c1213 (diff) |
crashtesting: null deref
on exporting fdo45102-1.ods to xlsx
presumably since
commit c4d7b9c3ec6e44b96134fdfb036be7f9fcf39f9d
Date: Wed Nov 23 12:14:31 2022 +0100
tdf#70293 XLSX export: fix lost grouping of shapes
Change-Id: I54ec34e1979d3aba5b4e2a6a64870e8f186b21cf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143342
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/filter/xcl97/xcl97rec.cxx | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx index 84718321b126..8f930c80993b 100644 --- a/sc/source/filter/xcl97/xcl97rec.cxx +++ b/sc/source/filter/xcl97/xcl97rec.cxx @@ -241,12 +241,17 @@ void SaveDrawingMLObjects( XclExpObjList& rList, XclExpXmlStream& rStrm ) else --nSkipObj; + XclObjAny* pObj = nullptr; if (rxObj->GetObjType() == 0) // group (it can be a subgroup) + pObj = dynamic_cast<XclObjAny*>(rxObj.get()); + if (pObj) { - XclObjAny* pObj = dynamic_cast<XclObjAny*>(rxObj.get()); - css::uno::Reference<css::drawing::XShapes> mXShapes(pObj->GetShape(), UNO_QUERY); - // skip (also) the objects of this group - nSkipObj += mXShapes->getCount(); + css::uno::Reference<css::drawing::XShapes> xShapes(pObj->GetShape(), UNO_QUERY); + if (xShapes) + { + // skip (also) the objects of this group + nSkipObj += xShapes->getCount(); + } } } |