Estimated read time: 3 minutes
Writer now has a set of improvements to better render Word-style borders around pages, tables and paragaphs. This required adjusting how we perform automatic mirroring and also to make sure that clipping is done the Word way.
Motivation
Word users expect to able to import their documents to Writer and experience high fidelity rendering: this means Writer has to support the way page / table / paragraph borders are painted according to the OOXML model as well. This is all done conditionally, so existing ODF documents are left unchanged.
This is a set of 5 bugfixes, requested by multiple of our customers.
Results
First let’s look at the new render result for page borders:
And this is how it used to look like:
Finally you can compare that with the reference:
What you can see here is that the page has a double border: the outer line is thick and the inner line is thin. The right and bottom border was incorrect as our result was the opposite of the reference.
Second, let’s look at the new render result for table borders:
And this is how it used to look like:
Finally you can compare that with the reference:
You can notice a number of problems here:
-
the inner horizontal line at the top table was overrunning, it was even painted between the two lines of the outer double border
-
the middle table shows how the vertical thick and thin lines of the outer double border was reversed
-
the bottom table shows how the horizontal tick inner border was not consistent
The new render result properly clips the inner border lines, so they don’t intersect outer borders, and the border mirroring (similar to the page borders) is now correct for table borders as well.
Third, let’s look at the new render result for paragraph borders:
And this is how it used to look like:
Finally you can compare that with the reference:
What’s visible here is that some paragraph inside the table cell had borders defined, but due to how the reference clips these borders, this border was not visible. That unexpected border is now also omitted in Writer.
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 bugfix changes.
For the page border:
-
https://gerrit.libreoffice.org/c/core/+/129281 sw: fix swapped inner vs outer border for Word-style right/bottom page borders
For the table border:
-
https://gerrit.libreoffice.org/c/core/+/128053 sw: fix too long inner borders intersecting with outer borders for Word cells
-
https://gerrit.libreoffice.org/c/core/+/128289 sw: fix swapped inner vs outer border for Word-style left table borders
-
https://gerrit.libreoffice.org/c/core/+/128383 sw: fix swapped inner vs outer border for Word-style bottom table borders
For the paragraph border:
-
https://gerrit.libreoffice.org/c/core/+/128569 sw: fix unexpected paragraph border inside table cells
Want to start using this?
You can get a snapshot / demo of Collabora Office and try it out yourself right now: try 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 (7.4).