Estimated read time: 3 minutes
Writer now supports legal numbering for two more formats: DOC and RTF (ODT and DOCX were working already.)
This work is primarily for Collabora Online, done as a HackWeek project, but the feature is fully available in desktop Writer as well.
Motivation¶
Legal numbering is a way to influence the number format of values inherited in a multi-level numbering. Say, the outer numbering uses Roman numerals and the inner numbering uses X.Y as the number format, but the inner level wants to display the outer values as Arabic numerals. If this is wanted (and guessing from the name, sometimes lawyers do want this), then the inner number portion will expand to values like "2.01" instead of "II.01", while the outer number portions will remain values like "II".
Mike did 80% of the work, what you can see here is just the RTF/DOC filters.
Picking a smaller feature task like this looked like a good idea, since I wanted to spend some of the time on regression fixing around last year's multi-page floating table project.
Results so far¶
For (binary) DOC, the relevant detail is the fLegal
bit in the LVLF
structure. Here is the
result:
It shows how the outer "II" gets turned into "2", while it remained "II" in the past. This works for both loading and saving.
The same feature is now handled in the RTF filter as well. There the relevant detail is the
\levellegal
control word, which has an odd 1 default value (the default is usually 0). Here is the
result:
It shows that the RTF filter is up to speed with the DOC one by now.
As for the multi-page floating tables, I looked at tdf#158986 and tdf#158801.
How is this implemented?¶
If you would like to know a bit more about how this works, continue reading... :-)
As usual, the high-level problem was addressed by a series of small changes:
- Related: tdf#158986 sw floattable: fix unexpected page break with sections
- tdf#158986 sw floattable: fix RTF import of table followed by \sect
- Related: tdf#150408 DOC filter: handle legal numbering
- Related: tdf#150408 RTF filter: handle legal numbering
- Related: tdf#158986 sw floattable, RTF import: use more setNeedPar()
- tdf#158801 sw floattable: fix crash with headers and interactive editing
Want to start using this?¶
You can get a snapshot / demo of Collabora Office 24.04 and try it out yourself right now: try the unstable snapshot. Collabora intends to continue supporting and contributing to LibreOffice, the code is merged so we expect all of this work will be available in TDF's next release too (24.8).