Bug 96750 - Docx import loses landscape after first page
Summary: Docx import loses landscape after first page
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.1.6.2 release
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:5.3.0 target:6.0.0
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-28 16:39 UTC by Stephanie Miller
Modified: 2019-05-15 09:35 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Bad landscape (34.36 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2015-12-28 16:39 UTC, Stephanie Miller
Details
PDF of correct layout (48.24 KB, application/pdf)
2015-12-28 16:41 UTC, Stephanie Miller
Details
working patch that makes the provided test document work correctly. (1.91 KB, patch)
2016-06-25 08:18 UTC, Justin L
Details
reproduceme.docx - wrong header or margin size (80.06 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2016-07-21 12:13 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stephanie Miller 2015-12-28 16:39:32 UTC
Created attachment 121583 [details]
Bad landscape

Opening the attached docx file shows the first page correctly but then returns the pages to landscape after that.  It still tries (and fails) to render the table landscape.  Other documents with similar formatting exhibit the same behavior.

I tested this on a LibreOffice Fresh (win 64) install downloaded today.  Version 5.0.4.2 build id 2b9802c1994aa0b7dc6079e128979269cf95bc78 .  It is also broken, in a slightly different way, in the latest version in the fedora repo 4.4.6.3 build id 4.4.6.3-2.fc22.
Comment 1 Stephanie Miller 2015-12-28 16:41:19 UTC
Created attachment 121584 [details]
PDF of correct layout

The attached pdf is an export from word of what the document should look like.
Comment 2 Julien Nabet 2015-12-28 19:22:53 UTC
On pc Debian x86-64 with master sources updated today, I could reproduce this.
Comment 3 A (Andy) 2015-12-29 09:37:51 UTC
Reproducible with LO 5.1.0.1, Win 8.1
Comment 4 Timur 2015-12-29 15:16:06 UTC
This was improved somewhere in 4.1, so I'll mark as such, no regression.
Comment 5 Cor Nouws 2016-05-03 15:27:27 UTC
FYI it can be easily resolved by setting the page style property Next page to First page too.
It looks as if the UI is fighting with the page styles.. the status bar shows 'converted1' now and then too.
Comment 6 Justin L 2016-06-25 08:18:51 UTC
Created attachment 125897 [details]
working patch that makes the provided test document work correctly.

Confirming that "NO0492-355c Office and Indus Dist Regs Part 1.doc" still switches to portrait orientation on the following pages in LO 5.3dev.

I tried to reproduce this problem in a simple test document (using Word 2003) and failed.  The problem comes because the very first breaktype encountered is a 92250 (continuous section break).  Every new document I create works because it uses the default breaktype (-1) for "First Page".

My patch is decent, but it also copies the Header to the second page, and since I can't recreate the problem from scratch I'm not proposing this as a fix.
Comment 7 Justin L 2016-07-04 15:23:27 UTC
suggested fix: gerrit.libreoffice.org/26892
Comment 8 Commit Notification 2016-07-04 15:33:04 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

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

tdf#96750 docx - ensure all styles are initialized

It will be available in 5.3.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 Justin L 2016-07-21 12:13:34 UTC
Created attachment 126342 [details]
reproduceme.docx - wrong header or margin size

Don't backport until the bug in reproduceme.docx is resolved.  I can't remember/find which bug report this docx comes from.
Comment 10 Commit Notification 2017-07-05 08:59:32 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

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

tdf#96750 make test document more minimal

It will be available in 6.0.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.