Collabora Productivity LibreOffice Conference 2021, Virtual | Miklos Vajna 2 / 20 About Miklos From Hungary ● More details: https://www.collaboraoffice.com/about-us/ Google Summer of Code 2010 / 2011 ● Rewrite of the Writer RTF import/export Then a full-time LibreOffice developer for SUSE Now a contractor at Collabora
Collabora Productivity LibreOffice Conference 2021, Virtual | Miklos Vajna 4 / 20 Motivation One of the missing last section properties which are in each & every Word document ● Use-case: book ● Binding consumes a known amount of space on the left ● Want to have equal amount of remaining horizontal space on the left & on the right after that ● Can be also at the top, also RTL is to be considered (via wikipedia.org)
Collabora Productivity LibreOffice Conference 2021, Virtual | Miklos Vajna 13 / 20 UNO API Public, stable representation: ● Writer document: com.sun.star.text.TextDocument ● Writer page styles: com.sun.star.style.PageStyle ● Other margins are named like LeftMargin, RightMargin ● New property: GutterMargin ● New property: RtlGutter ● Second property is inferred from the writing direction for ODT, set explicitly by the Word formats (via wikipedia.org)
Collabora Productivity LibreOffice Conference 2021, Virtual | Miklos Vajna 14 / 20 Layout Just an increased left margin… except: ● Take page border into account (gutter + left margin is outside the border, except for the border spacing ● Mirrored page margins ● RTL ● On the left or on the right
Collabora Productivity LibreOffice Conference 2021, Virtual | Miklos Vajna 15 / 20 Filters ODF and the rest: ● A new ODF extension: loext:margin-gutter="…"> ● Proposal at https://issues.oasis-open.org/browse/OFFICE-4105 ● Position is just a per-document setting: GutterAtTop=false ● Similar serialization and parsing for DOCX, DOC and RTF
Collabora Productivity LibreOffice Conference 2021, Virtual | Miklos Vajna 16 / 20 User interface Not just a spin-button: ● Combo box for the position ● Preview widget accurately takes gutter space into account
Collabora Productivity LibreOffice Conference 2021, Virtual | Miklos Vajna 17 / 20 Testing At various levels: ● Layout is covered in CppunitTest_sw_core_layout ● Also the mirrored margins case ● DOCX filter is covered in CppunitTest_sw_ooxmlexport ● The “from page” margin case and the “from text” one ● ODT filter is covered in CppunitTest_sw_odfexport ● DOC filter is covered in CppunitTest_sw_ww8export ● RTF filter is covered in CppunitTest_sw_rtfexport ● And then all the same for the “from top” case ● And then all the same for the RTL case (via wikipedia.org)
Collabora Productivity LibreOffice Conference 2021, Virtual | Miklos Vajna 18 / 20 Help content The content that ends up on https://help.libreoffice.org/:
Collabora Productivity LibreOffice Conference 2021, Virtual | Miklos Vajna 19 / 20 Thanks Collabora is an open source consulting and product company ● What we do and share with the community has to be paid by someone There is an exception to every rule ● Most of this work was done as a Collabora Hackweek project
Collabora Productivity LibreOffice Conference 2021, Virtual | Miklos Vajna 20 / 20 Summary Writer now has full support for gutter margins ● Not only not loosing this formatting setting ● Also rendering it properly ● Integrates correctly with the rest of the layout: borders, mirroring, RTL ● Imports from / exports to all major file formats Thanks for listening! :-) ● Slides: https://people.collabora.com/~vmiklos/slides/