Index ¦ Archives ¦ RSS

Split sections inside tables for LibreOffice Writer

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:

https://farm5.staticflickr.com/4430/35957293074_cfeabe6a51_o.png
https://farm5.staticflickr.com/4393/35957293014_ae8f210542_o.png

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:

https://farm5.staticflickr.com/4360/35957292924_2af502ffc7_o.png
https://farm5.staticflickr.com/4399/35957292834_dc2ce35f85_o.png

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:

https://farm5.staticflickr.com/4432/35982835413_99a65febe2_o.png

After commit tdf#108524 sw: handle sections inside tables in SwFrame::GetPrevSctLeaf() the paragraph is moved back properly:

https://farm5.staticflickr.com/4408/35982835283_1c2002254b_o.png

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:

https://farm5.staticflickr.com/4342/35982835353_25d609548d_o.png

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. :-)

© Miklos Vajna. Built using Pelican. Theme by Giulio Fidente on github.