Created attachment 188431 [details] Floating table on one page open attached file. Set cursor into table. From context menu call Insert Caption. Add caption "Numbers English-German" with position _below_. => LibreOffice hangs Tested with Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: fcbae818b793a9ee97a1b5ddc53902be7a2376f5 CPU threads: 8; OS: Windows 10.0 Build 19045; UI render: default; VCL: win Locale: en-US (en_US); UI: en-US Calc: CL threaded
Yes, I can reproduce, SwFrame::GetNextFlyLeaf() never finishes. An additional problem is the limits of the DOCX format here, because that doesn't support captions on floating tables. Two fixes I can think of: 1) if the frame only contains one table and is allowed to split, then hide the UI to insert a caption because the resulting document won't be something you can save back to DOCX, because of the limits of the format. (We'll save it as a shape, containing the table + the caption, but won't be able to split across pages.) or 2) if the frame contains more than just a table and the user marks it as "split across pages", then ignore this request during rendering and still keep the table on a single page. I believe any of these would fix your problem; perhaps 1) is better? I guess it's annoying if our UI allows creating documents that you can't save back later.
Miklos beat me to it, but for what it's worth: Confirmed with same steps in: Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 77fca616e0bd79e0b405fd0b3543cf8e94e15df3 CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3 Locale: en-AU (en_AU.UTF-8); UI: en-US Calc: threaded and: Version: 7.6.0.1 (X86_64) / LibreOffice Community Build ID: 776eaf34564cbf3f034a0ba1fd1d5c32ff9ccf1c CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3 Locale: en-AU (en_AU.UTF-8); UI: en-US Calc: threaded No hang if caption text is empty. Seems dependent on the string length, and only hangs when it needs to wrap over more than on line. No hang in: Version: 7.5.4.2 (X86_64) / LibreOffice Community Build ID: 36ccfdc35048b057fd9854c757a8b67ec53977b6 CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3 Locale: en-AU (en_AU.UTF-8); UI: en-US Flatpak Calc: threaded
(note also the following undo issue: if the short caption is successfully added, a Ctrl + Z won't remove the frame)
Miklos Vajna committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/107de1a2c6882213cf0ef6783417302f43cdada0 tdf#156349 sw floattable: fix caption insert for tables inside split fly frames It will be available in 24.2.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.
Miklos Vajna committed a patch related to this issue. It has been pushed to "libreoffice-7-6": https://git.libreoffice.org/core/commit/41060a937c529247c0d4f815228bb1e21803de60 tdf#156349 sw floattable: fix caption insert for tables inside split fly frames It will be available in 7.6.1. 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.
Thanks Michael, fix verified in: Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 42364fbfafaa95773c073cc080142b64ec1786fb CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3 Locale: en-AU (en_AU.UTF-8); UI: en-US Calc: threaded