Bug Hunting Session
Bug 123702 - FILEOPEN RTF Size of page margins is different in Word and Writer
Summary: FILEOPEN RTF Size of page margins is different in Word and Writer
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.5.0 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:6.4.0 target:6.3.1 target:6.2.7
Keywords: filter:rtf
Depends on:
Blocks: RTF
  Show dependency treegraph
 
Reported: 2019-02-25 12:52 UTC by NISZ LibreOffice Team
Modified: 2019-09-16 07:06 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot of the original document side by side in Word and Writer. (222.96 KB, image/png)
2019-02-25 12:54 UTC, NISZ LibreOffice Team
Details
The original file. (189 bytes, application/msword)
2019-02-25 12:54 UTC, NISZ LibreOffice Team
Details

Note You need to log in before you can comment on or make changes to this bug.
Description NISZ LibreOffice Team 2019-02-25 12:52:28 UTC
Description:
Size of page margins changes when the attached file is opened in LibreOffice Writer.

Steps to Reproduce:
    1. Open the attached RTF file in LibreOffice Writer.
    2. Open a copy in Microsoft Word.
    3. Compare the original file opened in Writer and Word.
    4. View the attached screenshot.

Actual Results:
Left, right, top, bottom margins are 2,5 cm in Word.
Left and right margins are 3,18 cm; top and bottom margins are 2,54 cm in Writer.

Expected Results:
Size of page margins should be same in Word and Writer.


Reproducible: Always


User Profile Reset: No



Additional Info:
LibreOffice details:
Version: 6.3.0.0.alpha0+
Build ID: f22ce685260b8b7b792f1f132472c88c6b655589
CPU threads: 4; OS: Windows 10.0; UI render: GL; VCL: win; 
Locale: hu-HU (hu_HU); UI-Language: en-US
Calc: threaded

Reproduciable with:
LibreOffice 3.5.0rc3 
Build ID: 7e68ba2-a744ebf-1f241b7-c506db1-7d53735
Comment 1 NISZ LibreOffice Team 2019-02-25 12:54:06 UTC
Created attachment 149574 [details]
Screenshot of the original document side by side in Word and Writer.
Comment 2 NISZ LibreOffice Team 2019-02-25 12:54:47 UTC
Created attachment 149575 [details]
The original file.
Comment 3 Dieter Praas 2019-02-28 08:22:08 UTC
My result in Word 2016:
left, right and top: 2,5
bottom: 2

Anyway, there's a difference between LO and MSO. But what margins are the original? How did you created the rtf-file?

=> NEEDINFO
Comment 4 Gabor Kelemen 2019-02-28 08:39:52 UTC
In Word 2013 I see Letter paper size and 2.5 cm margins in all directions.

The document is used by a closed source third party application as a template, I have no idea how they created it.

Creating a new document in Word with the above settings and saving it in RTF gives correct results in LO 6.1.4.
Comment 5 Dieter Praas 2019-02-28 08:53:20 UTC
(In reply to Gabor Kelemen from comment #4)
> In Word 2013 I see Letter paper size and 2.5 cm margins in all directions.
> 
> The document is used by a closed source third party application as a
> template, I have no idea how they created it.
> 
> Creating a new document in Word with the above settings and saving it in RTF
> gives correct results in LO 6.1.4.

So what is the "right" size? What is the expected result, if it works with documents created in Word? I don't know. I'm not an expert, but I would close it as RESOLVED INSUFFICIENTDATA. What do you think, Gabor?
Comment 6 Gabor Kelemen 2019-02-28 13:08:21 UTC
(In reply to Dieter Praas from comment #5)
> (In reply to Gabor Kelemen from comment #4)
> > In Word 2013 I see Letter paper size and 2.5 cm margins in all directions.
> > 
> > The document is used by a closed source third party application as a
> > template, I have no idea how they created it.
> > 
> > Creating a new document in Word with the above settings and saving it in RTF
> > gives correct results in LO 6.1.4.
> 
> So what is the "right" size? What is the expected result, if it works with
> documents created in Word? I don't know. I'm not an expert, but I would
> close it as RESOLVED INSUFFICIENTDATA. What do you think, Gabor?

We dug into the file a bit, and it seems that the file does not have explicit settings for margin (which would work fine), so some default values kick in - which are different between the applications, apparently.

I guess we can close this as wontfix, and ask the developers of said third party app to provide sensible default page settings in their templates.

@vmiklos: does that make sense to you?
Comment 7 Miklos Vajna 2019-02-28 13:32:38 UTC
We try to handle set the correct page margin default in writerfilter/source/dmapper/PropertyMap.cxx:388 to values which Word has to overwrite the Writer default for RTF/DOCX import.

I don't plan to look at this bug right now, but keeping it open would probably make sense.
Comment 8 Dieter Praas 2019-02-28 16:24:17 UTC
(In reply to Miklos Vajna from comment #7)
 
> I don't plan to look at this bug right now, but keeping it open would
> probably make sense.

=> SET to NEW, bacause I think more confirmation is not possible. Miklos, Gabor, if you don't agree, feel free to change it back to UNCONFIRMED
Comment 9 László Németh 2019-08-01 15:14:09 UTC
It seems, new default left/right margin values were introduced in MSO 2007: 

https://www.quora.com/What-are-the-standard-margins-for-a-Word-document
Comment 10 László Németh 2019-08-02 08:22:14 UTC
@Miklós, thanks for the code pointer! Laci
Comment 11 Commit Notification 2019-08-02 08:22:32 UTC
László Németh committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/2550b380e8f81528aa2dde5790c3b607c068ee1a%5E%21

tdf#123702 RTF/DOCX default 1" left/right page margins

It will be available in 6.4.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 12 Commit Notification 2019-08-06 12:54:10 UTC
László Németh committed a patch related to this issue.
It has been pushed to "libreoffice-6-3":

https://git.libreoffice.org/core/+/c54d3e3f0800273e2e7e865a6f873f1635af43af%5E%21

tdf#123702 RTF/DOCX default 1" left/right page margins

It will be available in 6.3.1.

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 13 Commit Notification 2019-08-06 12:55:34 UTC
László Németh committed a patch related to this issue.
It has been pushed to "libreoffice-6-2":

https://git.libreoffice.org/core/+/6bd00c3be811f2f786b4acd035ee0bfed4328b88%5E%21

tdf#123702 RTF/DOCX default 1" left/right page margins

It will be available in 6.2.7.

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 14 Dieter Praas 2019-09-15 14:29:20 UTC
(In reply to László Németh from comment #9)
> It seems, new default left/right margin values were introduced in MSO 2007: 
> 
> https://www.quora.com/What-are-the-standard-margins-for-a-Word-document

Default margins(regarding to that link): 1 inch(2.54 cm)

When I open attachment from comment 2 in master margins have that size (2.54 cm)

Version: 6.4.0.0.alpha0+ (x64)
Build ID: f0c832acb53326ccc9a8c1a47401fbc9e1081feb
CPU threads: 4; OS: Windows 10.0; UI render: GL; VCL: win; 
TinderBox: Win-x86_64@62-TDF, Branch:master, Time: 2019-09-11_05:46:53
Locale: en-GB (de_DE); UI-Language: en-US
Calc: threaded

László, thanks for fixing it => VERIFIED FIXED
Comment 15 László Németh 2019-09-16 07:06:35 UTC
(In reply to Dieter Praas from comment #14)

> László, thanks for fixing it => VERIFIED FIXED

@Dieter, thanks for the verification.