Created attachment 204682 [details] checkbox.ods LO hangs (or crashes in debug mode) when saving a file after a form control has moved. Steps to reproduce: -Open checkbox.ods -Tools - Forms - Design Mode -right click on checkbox - Control Properties - Anchor - To Cell -Save as checkboxRT.ods => works fine -drag one of the earlier rows larger or smaller (so that the checkbox moves) -save => infinite loop The loop happens because of an invalid -1 col/row address from ScMyShapesContainer::GetFirstAddress This crash started with 7.1 commit 1f0b3c7a40edfa81bbc7a58d123a6a2dfd83e4ca Author: Regina Henschel on Sat Oct 31 15:36:00 2020 +0100 Improve 'resize with cell' handling Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104643
Cell-anchored shapes have two anchor points. The one that is saved to XML is from GetNonRotatedObjData (i.e. the "second" one). ScXMLExport::CollectSharedData if (ScDrawObjData *pAnchor = ScDrawLayer::GetNonRotatedObjData(pSdrObj)) The first anchor point is used for the layout, and is based on the final rotated/transformed object's position. So this is the one that the "application" uses. ScDrawLayer::GetObjData( SdrObject* pObj, bool bCreate ) The problem here is that the first anchor point is created when we -right click on checkbox - Control Properties - Anchor - To Cell but the second one was not created. So at export time, we get nothing for GetNonRotatedObjData, and thus it gets written out as a SCA_PAGE item. By moving one of the lines, RecalcPos calls GetNonRotatedObjData with bCreate, and thus now we DO have something (with an invalid address for aMyShape.aAddress = pAnchor->maStart; and that results in the crash. It looks like there are a lot of ways to fix this "wrongly". But how to fix it correctly means you need to really understand exactly what is happening in all of this craziness. Good luck to me - bring on the regressions I guess.
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/cbd9d23b7b953fdf53d66aaa072bab17db7905d3 tdf#170012 sc drwlayer: avoid crash on ODS save It will be available in 26.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Justin Luth committed a patch related to this issue. It has been pushed to "libreoffice-26-2": https://git.libreoffice.org/core/commit/02b31fcca378551a6a9e58b06aeb7b33c7e28f68 tdf#170012 sc drwlayer: avoid crash on ODS save It will be available in 26.2.0.2. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/c1820235a4d5ace6b395dac889a4dc0dae5d5a68 tdf#170012 sc: never SetCellAnchored without SetNonRotatedAnchored It will be available in 26.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Justin Luth committed a patch related to this issue. It has been pushed to "libreoffice-25-8": https://git.libreoffice.org/core/commit/791bdef1573d7f5bb36e41aebb73436ac2ea2e14 tdf#170012 sc drwlayer: avoid crash on ODS save It will be available in 25.8.5. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Justin Luth committed a patch related to this issue. It has been pushed to "libreoffice-26-2": https://git.libreoffice.org/core/commit/e13a571afe02daf18fc9af117d2d581d3f76dbdd tdf#170012 sc: never SetCellAnchored without SetNonRotatedAnchored It will be available in 26.2.0.2. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
(In reply to Commit Notification from comment #6) > Affected users are encouraged to test the fix and report feedback. Regina - you worked on this extensively 6 years ago. If you remember this stuff well, your evaluation of the changes will be appreciated.
(In reply to Justin L from comment #7) > (In reply to Commit Notification from comment #6) > > Affected users are encouraged to test the fix and report feedback. > > Regina - you worked on this extensively 6 years ago. If you remember this > stuff well, your evaluation of the changes will be appreciated. Its long ago, so I do not really remember "well". Nevertheless some comments: I have tested the behavior with Version: 25.8.3.2 (X86_64) Build ID: 8ca8d55c161d602844f5428fa4b58097424e324e CPU threads: 32; OS: Windows 11 X86_64 (build 26100); UI render: Skia/Vulkan; VCL: win Locale: de-DE (de_DE); UI: en-US Calc: threaded It seems, that the problem only occurs, it the anchor is set in the control properties. I cannot reproduce the problem, if I set the anchor in the shape property, e.g. from context menu. Please try it; can you reproduce my observation? There had already been problems with the anchor setting in the control properties, https://bugs.documentfoundation.org/show_bug.cgi?id=147561#c12. Bug 158592 might be related as well. An additional problem is, that the setting in the control properties has only "page" and "cell", whereas the shape has in addition "resize with cell". Thus I think, that the problem is not in the anchoring itself, but in the way the anchor inside the control properties is handled.