Bug 104420 - FILEOPEN: DOCX: missing page and paragraph
Summary: FILEOPEN: DOCX: missing page and paragraph
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.3 all versions
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:5.4.0 target:5.3.0.1
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2016-12-05 15:15 UTC by Justin L
Modified: 2017-05-18 18:47 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
lostParagraph.docx: example document which should be two pages long. (102.25 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2016-12-05 15:15 UTC, Justin L
Details
lostParagraph.docx: replaces the original test - the header/table on page one is critical for producing the failure. (101.04 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2016-12-05 17:01 UTC, Justin L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Justin L 2016-12-05 15:15:15 UTC
Created attachment 129327 [details]
lostParagraph.docx: example document which should be two pages long.

In trying to reduce attachment 114439 [details] from bug 90317 to a minimal test, I stumbled across this bug which is related to tables and section breaks.

It should be a two page document, the first portrait-oriented page has a single paragraph stating "This text is lost in LibreOffice." A section break creates a second, landscape-orientated page without any content except a header containing a table.

Regression in LibreOffice 43.  bibisect 43max points to:
-----------------------
   commit 2e8aad6d45c53d554ccaf26de998ede708cfc289
    Author:     Vinaya Mandke <vinaya.mandke@synerzip.com>
    CommitDate: Thu Apr 24 12:57:51 2014 +0200
    
fdo#39056 fdo#75431 Section Properties if section starts with table

Section properties are not imported if the section starts with a table for DOCX,
and also for a few RTF files with combination of tables and section breaks.
SwXBodyText::createTextCursorByRange is not able to find the start of section
and hence section properties are not applied.
   As a workaround added an empty paragraph at the beginning of every section
which has the the first element as a table. And then removed it when the
section ends ( DomainMapper::lcl_endSectionGroup is called).
   Also handled to add the paragraph earlier, if there is a bookmark
so that the bookmark is not attached to the dummy paragraph.
-----------------------
Comment 1 Xisco Faulí 2016-12-05 15:42:28 UTC
I can reproduce it using attachment 114439 [details] in

Version: 5.4.0.0.alpha0+
Build ID: 18b3138a7ac4da823e41640bed8a4707029b8fb0
CPU Threads: 4; OS Version: Linux 4.8; UI Render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group

but not if I use the attached document.
@Justin, could you please check you attached the correct file?
Meanwhile, moving it to NEW as it can be reproduced with attachment 114439 [details].
Bug 103781 seems to be related as both are introduced by the same commit 

Adding Cc: to Vinaya Mandke
Comment 2 Xisco Faulí 2016-12-05 16:19:45 UTC
*** Bug 104394 has been marked as a duplicate of this bug. ***
Comment 3 Justin L 2016-12-05 17:01:46 UTC
Created attachment 129331 [details]
lostParagraph.docx: replaces the original test - the header/table on page one is critical for producing the failure.
Comment 4 Commit Notification 2016-12-07 04:58:02 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

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

tdf#104420 writerfilter: no dummy para in headers

It will be available in 5.4.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 5 Commit Notification 2016-12-14 05:17:50 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "libreoffice-5-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=cc2824e3ab600e1863f52899bc2149694bd44972&h=libreoffice-5-3

tdf#104420 writerfilter: no dummy para in headers

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