sc/source/filter/xcl97/xcl97rec.cxx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
New commits: commit 9a01dbc8683e9114d8fd0250cac0cbc33600458a Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Sun Nov 27 11:58:21 2022 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Sun Nov 27 16:10:33 2022 +0100 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 <caol...@redhat.com> 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(); + } } }