Bug 140342 - FILEOPEN DOCX border with position from text is wrong, if gutter present
Summary: FILEOPEN DOCX border with position from text is wrong, if gutter present
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.2.0.0.alpha0+
Hardware: x86-64 (AMD64) All
: medium enhancement
Assignee: Miklos Vajna
URL:
Whiteboard: target:7.2.0
Keywords:
Depends on:
Blocks: Gutter-Margins
  Show dependency treegraph
 
Reported: 2021-02-11 15:12 UTC by Regina Henschel
Modified: 2021-03-05 15:40 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
DOCX to reproduce the error (16.66 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2021-02-11 15:12 UTC, Regina Henschel
Details
Border together with Gutter, Screenshot left Word, right LibreOffice (193.67 KB, image/png)
2021-02-11 15:19 UTC, Regina Henschel
Details
the same with a new odt with gutter different than zero (22.35 KB, application/vnd.oasis.opendocument.text)
2021-02-22 07:21 UTC, BogdanB
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2021-02-11 15:12:06 UTC
Created attachment 169675 [details]
DOCX to reproduce the error

If the document has a gutter specified and the page border is given relative to text edge, then the border is wrongly drawn.
The border is correct, if gutter is set to 0 in Word.
Comment 1 Regina Henschel 2021-02-11 15:19:31 UTC
Created attachment 169678 [details]
Border together with Gutter, Screenshot left Word, right LibreOffice
Comment 2 BogdanB 2021-02-22 07:18:32 UTC
Confirm with
Version: 7.2.0.0.alpha0+ / LibreOffice Community
Build ID: 7b649f835cc00ed76927c6821a135605609bed4e
CPU threads: 4; OS: Linux 5.8; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 3 BogdanB 2021-02-22 07:21:34 UTC
Created attachment 169958 [details]
the same with a new odt with gutter different than zero
Comment 4 Miklos Vajna 2021-02-26 10:32:44 UTC
Regina: thanks for this sample, very useful one. So Word has 2 modes for border description, the distance can be measured "form text" or "from page". I was aware of this, but I was not aware that my simple sw/qa/extras/ooxmlexport/data/gutter-top.docx sample accidentally used the "from page" mode. The reason your sample is broken is because it uses "from text".

So it points out an important problem: similar to how normal borders are handled (when there is no gutter), the "from page" part of the gutter handling should happen at DOCX import/export time and Writer layout should continue to measure borders "from text". I'll look into this.
Comment 5 Commit Notification 2021-03-01 19:56:42 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/ebceee31d92f04b58e795d02a26f62b717c47737

tdf#140342 sw layout: remove explicit gutter handling when positioning borders

It will be available in 7.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Miklos Vajna 2021-03-02 08:52:03 UTC
No backport, gutter margin is master-only.
Comment 7 Regina Henschel 2021-03-05 15:40:53 UTC
Import is OK now in Version: 7.2.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 8e49505fa7352023c252bf794ae84c9082d7264e
CPU threads: 8; OS: Windows 10.0 Build 19041; UI render: Skia/Raster; VCL: win
Locale: de-DE (en_US); UI: en-US
Calc: CL