Estimated read time: 2 minutes
Tables and sections in LibreOffice Writer are both containers, and in some cases it makes sense to have sections inside tables or tables inside sections. (For example you can mark a group of paragraphs as read-only by including them in a read-only section.) Tables in sections, split over multiple pages was already working, but now it’s possible to have sections in tables split over multiple pages as well.
First, thanks Escriba who made this work possible.
There were 3 parts of this work, you can read some details about them below.
Split of multi-line paragraphs
The first goal was to handle the split of multi-line paragraphs inside sections inside tables. Initially this looked like this:
After commit tdf#108524 sw: attempt to split section frames inside table cells it looks like this:
Split of one-liner paragraphs
Technically this is a situation different to the previous one, as split paragraphs have a master (first) frame and one or more follow (non-first) frames; and the previous stage only addressed the move of follow frames to next pages. Initially such a document looked like this:
After commit tdf#108524 sw: split section frames inside table cells, non-split text frames it is laid out as expected:
Merge a split section
The last piece was moving paragraphs back to previous pages when there is again space for them. Initially we did not use the newly available space:
After commit tdf#108524 sw: handle sections inside tables in SwFrame::GetPrevSctLeaf() the paragraph is moved back properly:
One more thing…
Given that all code changes affect how sections in tables are handled in a parent frame in general (which is a body frame in all the above pictures), the same changes are also usable for other parent containers as well, e.g. linked text frames. Here is how that looks like:
That’s it for now — as usual the commits are in master, so you can try this right now with a 6.0 daily build. :-)