Estimated read time: 3 minutes
I posted about Writer gutter margin in general back in February, and two follow-up requests accumulated around this new feature since then.
First, the gutter margin could be on the left or at the top for non-mirrored documents, which initially sounded like a complete solution, but later it turned out that right-to-left (RTL) documents want it on the right.
Second, there was a request from the OASIS TC to to implement the ODF filter differently for gutter margin.
Neither of these is simple to do, so this hackweek was a good opportunity to address these problems.
Results so far
Here is the layout and user interface for RTL gutter looks like:
You can see how the gutter is on the right (not the left) and you can alter this behavior with a dedicated checkbox on the UI.
How is this implemented?
If you would like to know a bit more about how this works, continue reading… :-)
sw page rtl gutter margin: add doc model introduced a new RES_RTL_GUTTER page style property
sw page rtl gutter margin: add UNO API added a new public RtlGutter UNO API property
sw page rtl gutter margin: add layout was the tricky layout piece, extending
sw page rtl gutter margin: add DOCX filter mapped this to DOCX’s
sw page rtl gutter margin: add ODF import mapped this to
<style:page-layout-properties style:writing-mode="...">in case the attribute value is RTL
sw page rtl gutter margin: add DOC filter mapped this to DOC’s SFRTLGutter, amusingly that handling of that was somewhat there, but more or less broken since 2002-02-04
sw page rtl gutter margin: add RTF filter mapped this to RTF’s
sw page rtl gutter margin: add UI introduced a new checkbox on the UI to set/get this, and fixed up notifications, so that the incremental layout repaints the necessary page frames when this setting changes
Finally I had a little bit of remaining time, so I addressed a request from the OASIS ODF TC:
sw page gutter margin: reimplement ODF filter changed the ODF markup to be more compatible with readers ignoring
Want to start using this?
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 (7.2).