Bug 136814 - Border padding of 0,10 cm becomes 0,07 cm on doc/x export
Summary: Border padding of 0,10 cm becomes 0,07 cm on doc/x export
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Sven Lüppken
URL:
Whiteboard: target:7.1.0
Keywords: difficultyBeginner, easyHack, skillCpp
Depends on: DOCX-Page
Blocks: Page-Borders
  Show dependency treegraph
 
Reported: 2020-09-16 12:56 UTC by Telesto
Modified: 2020-11-01 19:41 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file (8.06 KB, application/vnd.oasis.opendocument.text)
2020-09-16 12:56 UTC, Telesto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2020-09-16 12:56:22 UTC
Description:
Border padding of 0,10 cm becomes 0,07 on doc/x export

Steps to Reproduce:
1. open the attached file
2. Save as DOCX
3. File reload
4. Format -> Page Styles -> Border

Actual Results:
Padding changes from 0,10cm to 0,07cm

Expected Results:
0,10? or something in that area?


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.1.0.0.alpha0+ (x64)
Build ID: abcc4eb907661e07ad850ccce7eb06f129da4286
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL
Comment 1 Telesto 2020-09-16 12:56:40 UTC
Created attachment 165571 [details]
Example file
Comment 2 Telesto 2020-09-16 13:00:08 UTC
@Justin
Me asking questions ;-). Please notify me if you get bored of annoyed by it.

The border padding is always 'off'. Does MSO calculate it differently; so compatibility? Or is this some rounding difference between pt and cm?
Comment 3 BogdanB 2020-09-16 13:31:03 UTC
Confirm on
Version: 7.0.1.2 (x64)
Build ID: 7cbcfc562f6eb6708b5ff7d7397325de9e764452
CPU threads: 4; OS: Windows 10.0 Build 19041; UI render: Skia/Raster; VCL: win
Locale: ro-RO (ro_RO); UI: en-US
Calc: threaded

Spacing 0.07 cm
Comment 4 Mike Kaganski 2020-09-16 13:37:44 UTC
Generally speaking, this should be NAB and dupe of tdf#126567. In OOXML, the padding (as in LO; it's called "spacing" in OOXML) is measured in whole pt - i.e., it may only be 1, 2, 3, ... pt. So there's no flexibility that ODF provides for this attribute there.

However, in this specific case, the stored value of 2 pt (=0.7056mm) is not a good value; it should had been 3 pt (=1.0583mm), which is much closer to the original value. Looks like the value is created by truncation, not by rounding. (There might be good reasons to do that, but that needs investigation.)
Comment 6 Mike Kaganski 2020-09-16 15:00:25 UTC
Code pointer: impl_borderLine in sw/source/filter/ww8/docxattributeoutput.cxx
Comment 7 Mike Kaganski 2020-09-16 15:34:36 UTC
And ww8 counderpart: WW8Export::TranslateBorderLine in sw/source/filter/ww8/ww8atr.cxx
Comment 8 Xisco Faulí 2020-09-17 08:43:13 UTC
Hi Telesto,
Would you like to give it a try to this issue and fix it ?
Comment 9 Sven Lüppken 2020-10-31 16:42:05 UTC
Hi all,

is someone actively working on this bug? :) Because I might have a solution.

Thanks,
Sven
Comment 10 Telesto 2020-10-31 16:45:24 UTC
(In reply to Sven Lüppken from comment #9)
> Hi all,
> 
> is someone actively working on this bug? :) Because I might have a solution.
> 
> Thanks,
> Sven

They bug isn't assigned. And not seen a commit in gerrit point to this bug.. so you're free to go..
Comment 11 Sven Lüppken 2020-10-31 22:32:12 UTC
I pushed a change to Gerrit (here: https://gerrit.libreoffice.org/c/core/+/105128) which includes a unittest for the docx export, but I need a pointer how to create an appropriate unittest for the doc export, as I'm not familiar with the Word binary format. Can you help me? :)
Comment 12 Mike Kaganski 2020-11-01 08:17:54 UTC
(In reply to Sven Lüppken from comment #11)

It's nice to see your patch! Very good; I only have formatting nitpicks there - please see my comments on Gerrit.

Also please make sure you send your license statement - see https://wiki.documentfoundation.org/Development/Developers. Thank you! Great to have you here with us! :-)
Comment 13 Sven Lüppken 2020-11-01 11:46:16 UTC
Thank you! :)

I just pushed a second version of the patch to Gerrit. Thanks to your hints and the excellent README and xray-tool I also wrote a test for the binary export filter now.

I already sent the license statement on Friday when I submitted a patch for a different bug. :)
Comment 14 Commit Notification 2020-11-01 13:07:46 UTC
Sven Lüppken committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/5cbdda84ff4c0b1b5e22bc8965fb5c4c275c365c

tdf#136814 Fix border padding in Word export

It will be available in 7.1.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 15 Sven Lüppken 2020-11-01 13:18:34 UTC
Thank you Mike for your patience and your help! Looking forward to the next bug. :)
Comment 16 Roman Kuznetsov 2020-11-01 19:09:03 UTC
(In reply to Commit Notification from comment #14)
> Sven Lüppken committed a patch related to this issue.
> It has been pushed to "master":
> 
> https://git.libreoffice.org/core/commit/
> 5cbdda84ff4c0b1b5e22bc8965fb5c4c275c365c
> 
> tdf#136814 Fix border padding in Word export
> 
> It will be available in 7.1.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.

Sven, if your patch fixes the bug then please close it as RESOLVED FIXED. Thanks for your work.