Bug 117885 - FILEOPEN: LibreOffice Incorrectly Calculating Page Size in .doc
Summary: FILEOPEN: LibreOffice Incorrectly Calculating Page Size in .doc
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.3.7.2 release
Hardware: All All
: medium normal
Assignee: Luke Deller
URL:
Whiteboard: target:6.2.0 target:6.1.0.1 target:6.0.6
Keywords: bibisected, bisected, filter:doc, regression
Depends on:
Blocks: DOC-Page
  Show dependency treegraph
 
Reported: 2018-05-29 17:31 UTC by Luke
Modified: 2018-07-09 09:14 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Simple reproducer (49.50 KB, application/msword)
2018-05-29 17:31 UTC, Luke
Details
LO vs AOO comparison (173.00 KB, image/png)
2018-05-29 17:32 UTC, Luke
Details
how it looks in MS2010 (4.43 KB, image/png)
2018-05-30 10:50 UTC, Xisco Faulí
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Luke 2018-05-29 17:31:01 UTC
Created attachment 142388 [details]
Simple reproducer

In certain .doc documents the columns are not lining up in Writer like they do in MS Word or Apache OpenOffice. 

Steps to reproduce:
1. Open AlignmentBug.doc in Writer 
2. Compare to MS Word or AOO
Comment 1 Luke 2018-05-29 17:32:08 UTC
Created attachment 142389 [details]
LO vs AOO comparison
Comment 2 Luke 2018-05-30 03:14:06 UTC
Version: 4.1.0.1
Build ID: 1b3956717a60d6ac35b133d7b0a0f5eb55e9155
GOOD
Comment 3 Dieter 2018-05-30 08:35:24 UTC
I can't compare it with MS Word, but for me it seems, that the page margins have changed. Luke, can you confirm this?
Comment 4 Xisco Faulí 2018-05-30 10:50:24 UTC
Created attachment 142402 [details]
how it looks in MS2010
Comment 5 Xisco Faulí 2018-05-30 10:57:42 UTC
Ouch, you found your own regression ;-)

Regression introduced by:

author	Luke Deller <luke@deller.id.au>	2014-07-06 23:19:18 +1000
committer	Michael Stahl <mstahl@redhat.com>	2014-07-09 10:58:31 +0000
commit f312ef98de57a5926be67421395544bb9d41b809 (patch)
tree 4292737b838068de2520340d5e4af20e21b7a679
parent c1b562139a2e87cce2f189c50a242cf057970551 (diff)
fix fdo#77844: header wrongly enabled from .doc
The LO page style needs page headers to be turned on if the
corresponding .doc file section has a left (=even) page header or a
first page header.

However this should not be triggered in the case where a first page
header is present but hidden due to the "different first page" header
option being disabled. This case is fixed by this commit.

Bisected with: bibisect-44max

Adding Cc: to Luke Deller
Comment 6 Xisco Faulí 2018-05-30 10:58:39 UTC
Actually, you're different Lukes...

Adding Cc: to Luke Deller
Comment 7 Luke Deller 2018-05-30 13:44:06 UTC
LOL thanks Xisco & Luke.

I see the problem: it is calculating the top margin as if there were a header, but there isn't a header.  If you manually edit the top margin to match the other margins (2.54cm) then it looks good again.

The document section actually contains a first page header with the text "Hayden Management", but this is not shown because the "Different first page" header setting is disabled.  The doc import code to calculate the top margin is confused by the presence of this header.
Comment 8 Commit Notification 2018-06-06 07:43:18 UTC
Luke Deller committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=6c68e52532d45c97a83b2396bd40c98ade9b5bb4

Fix top margin in DOC import for tdf#117885

It will be available in 6.2.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 9 Luke 2018-06-07 02:54:55 UTC
Verified FIXED in Version: 6.2.0.0.alpha0+
Build ID: 18a8cac57d5450fef9111fa356839f07c7593ad0

Thanks for taking care of this Luke Deller!
Comment 10 Xisco Faulí 2018-06-08 10:58:31 UTC
Verified in

Version: 6.2.0.0.alpha0+
Build ID: 2a7f74900fb646235b74d4c9bd4690e44edc3ed4
CPU threads: 4; OS: Linux 4.13; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group threaded

@Luke ( both of you ), thanks for reporting and fixing this!! ;-)
Comment 11 Xisco Faulí 2018-06-08 10:59:43 UTC
Cherry-picked:
6.1: https://gerrit.libreoffice.org/#/c/55465/1
6.0: https://gerrit.libreoffice.org/#/c/55466/
Comment 12 Commit Notification 2018-06-14 16:49:04 UTC
Luke Deller committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=294725dd76e6c5288d2e96f47c730a94c9b09037&h=libreoffice-6-1

Fix top margin in DOC import for tdf#117885

It will be available in 6.1.0.1.

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

Affected users are encouraged to test the fix and report feedback.
Comment 13 Xisco Faulí 2018-07-06 10:00:11 UTC
Hi Luke Deller,
Please check the comment from Michael Stahl in https://gerrit.libreoffice.org/#/c/55466/

Regards
Comment 14 Luke Deller 2018-07-06 11:07:46 UTC
(In reply to Xisco Faulí from comment #13)
> Please check the comment from Michael Stahl in
> https://gerrit.libreoffice.org/#/c/55466/

Yes sorry Xisco, Michael is right.  This is the same issue that you reported already in bug 118412, which I fixed in https://gerrit.libreoffice.org/#/c/56602/

I guess we should squash these two together for the backport.
Comment 15 Xisco Faulí 2018-07-06 11:10:02 UTC
(In reply to Luke Deller from comment #14)
> (In reply to Xisco Faulí from comment #13)
> > Please check the comment from Michael Stahl in
> > https://gerrit.libreoffice.org/#/c/55466/
> 
> Yes sorry Xisco, Michael is right.  This is the same issue that you reported
> already in bug 118412, which I fixed in
> https://gerrit.libreoffice.org/#/c/56602/
> 
> I guess we should squash these two together for the backport.

Ouch you're right! I missed it
Yep, it's a good idea to put both of them together
Comment 16 Commit Notification 2018-07-09 09:14:27 UTC
Luke Deller committed a patch related to this issue.
It has been pushed to "libreoffice-6-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=3db1874044c24dadfb2f273d0e57e15bdcada1f5&h=libreoffice-6-0

Fix top margin in DOC import for tdf#117885

It will be available in 6.0.6.

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

Affected users are encouraged to test the fix and report feedback.