sc/source/filter/xml/xmlexprt.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
New commits: commit 791bdef1573d7f5bb36e41aebb73436ac2ea2e14 Author: Justin Luth <[email protected]> AuthorDate: Wed Dec 17 14:17:31 2025 -0500 Commit: Xisco Fauli <[email protected]> CommitDate: Fri Dec 19 10:07:58 2025 +0100 tdf#170012 sc drwlayer: avoid crash on ODS save This fixes a crash since 7.1 commit 1f0b3c7a40edfa81bbc7a58d123a6a2dfd83e4ca Instead of trying to save as a broken SCA_CELL_RESIZE it will save as a SCA_PAGE anchored object. The crash was occuring when saving to ODS format. It would loop forever because of the invalid address that GetNonRotatedObjData got during RecalcPos when it had been created but never "initialized". (An earlier patchset tried to force initialization and assert that, but I got tons of asserts in unit tests because of detfunc's bCreate without ScDrawLayer::InitializeCellAnchoredObj). Plus, doing initialization correctly sounds incomprehensible based on a code read. [Unit test removed because it depends on xlsx importing correctly - which doesn't work in 25.8.] Change-Id: Ief717c8742d712bf2edec90f492fd258f9fd7741 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195807 Tested-by: Jenkins Reviewed-by: Justin Luth <[email protected]> (cherry picked from commit cbd9d23b7b953fdf53d66aaa072bab17db7905d3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195861 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195873 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 1d2f86cdb4aa..b9ec718a7271 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -544,7 +544,8 @@ void ScXMLExport::CollectSharedData(SCTAB& nTableCount, sal_Int32& nShapesCount) if (!pSdrObj) continue; - if (ScDrawObjData *pAnchor = ScDrawLayer::GetNonRotatedObjData(pSdrObj)) + ScDrawObjData* pAnchor = ScDrawLayer::GetNonRotatedObjData(pSdrObj); + if (pAnchor && pAnchor->maStart.IsValid()) { ScMyShape aMyShape; aMyShape.aAddress = pAnchor->maStart;
