Bug 89377

Summary: TABLE, FORMATTING: .doc page breaks between tables lost when saved in Word
Product: LibreOffice Reporter: Rik Shaw <rikshaw76>
Component: WriterAssignee: Justin L <jluth>
Status: VERIFIED FIXED    
Severity: normal CC: ilmari.lauhakangas, jluth, rikshaw76
Priority: medium    
Version: Inherited From OOo   
Hardware: All   
OS: All   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=108233
Whiteboard: target:5.3.0 target:5.2.4
Crash report or crash signature: Regression By:
Attachments: This .dot was last saved in LibreOffice, so when opened in LO, page break exists. Open in Word, save, open in LibreOffice, page break is gone. Page break still exists when viewed again in Word.
simple.doc: minimal test duplicating the problem

Description Rik Shaw 2015-02-14 17:30:47 UTC
Created attachment 113382 [details]
This .dot was last saved in LibreOffice, so when opened in LO, page break exists. Open in Word, save, open in LibreOffice, page break is gone.  Page break still exists when viewed again in Word.

Existing .doc documents (from Word) with page breaks between Tables have the page breaks "lost" when opening in LibreOffice.

Adding the breaks manually in LibreOffice works fine when opening again in LibreOffice or Word.  However, the page breaks between tables are once again "lost" in LibreOffice after the document is re-edited and saved in MS Word.

Again, re-opening in Word the page breaks still exist, but re-opening in LibreOffice the page breaks are lost.

It seems to only be breaks between tables that are lost.  Unfortunately we have many documents using tables as formatting guides.
Comment 1 Buovjaga 2015-02-22 13:52:10 UTC
What versions of LibreOffice and Microsoft Word are you using?

Set to NEEDINFO.
Change back to UNCONFIRMED after you have provided the information.
Comment 2 Rik Shaw 2015-02-22 18:00:30 UTC
LibreOffice 3.5, 3.6, 4.0, 4.1, 4.2, 4.3, 4.4 in Windows and Linux.

MS Word 2003 (in Windows obviously).  I will need to confirm if the same for MS Word 2007 (and newer) but I believe it is so.  Maybe someone else could test if they have 2010 or 2013?  Follow the steps from the original Description, using the attachment (with the unfortunately very long name).
Comment 3 Buovjaga 2015-02-23 17:02:49 UTC
Reproduced.
Opened the .dot file through "Open" in MSO to edit it as a template.
"Saved as", opened new file in LibreOffice and the break was gone.

Win 8.1 32-bit
MSO 2013

LibreOffice:
Version: 4.5.0.0.alpha0+
Build ID: a2fa9e2468aa5c4fd4b610c5d0ebc8959e87a072
TinderBox: Win-x86@39, Branch:master, Time: 2015-02-23_02:10:01
Locale: fi_FI
Comment 4 tommy27 2016-04-16 07:23:34 UTC Comment hidden (obsolete)
Comment 5 Justin L 2016-10-20 08:54:10 UTC
Created attachment 128089 [details]
simple.doc: minimal test duplicating the problem

The problem is related to Paragraph styles with page-break enabled.  Word seems to throw away the "duplicate" page break (sprm 0x2407) that comes from the table-properties text-flow break-before, and uses only the paragraph style setting.

Word honors the paragraph page-break for each row.  Writer ignores all paragraph page-breaks that are inside of a table.

A work-around for OP's LostTableBreaks.dot is to remove the page-break on the "Unit title" paragraph style.
Comment 6 Justin L 2016-10-21 10:45:32 UTC
proposed fix:  https://gerrit.libreoffice.org/#/c/30127
Comment 7 Commit Notification 2016-10-24 10:05:27 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

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

tdf#89377 ww8import: table honors ParaStyle break-before-page

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 8 Commit Notification 2016-10-24 11:05:54 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

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

tdf#89377 writerfilter: table honors ParaStyle break-before-page

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 Commit Notification 2016-10-25 07:42:14 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "libreoffice-5-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=55840d90c43d0ba6db4a9cda4af648df0776749b&h=libreoffice-5-2

tdf#89377 ww8import: table honors ParaStyle break-before-page

It will be available in 5.2.4.

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.