Bug 64372 - Section Breaks in .DOCX not handled similarly between LibO and Word
Summary: Section Breaks in .DOCX not handled similarly between LibO and Word
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.0.0.3 release
Hardware: All All
: highest major
Assignee: Justin L
URL:
Whiteboard: target:5.3.0
Keywords: bibisected, regression
: 59799 82194 85728 92724 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-05-09 00:19 UTC by Jared
Modified: 2020-12-30 20:13 UTC (History)
13 users (show)

See Also:
Crash report or crash signature:


Attachments
Word 2013 file with continuous section breaks (11.39 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2013-05-09 00:19 UTC, Jared
Details
Word 2013 .docx file with section break issue (18.08 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2013-07-31 15:30 UTC, AdamL.
Details
Attachment from Bug 91384 reduced to 1 page (122.27 KB, application/wps-office.docx)
2016-06-23 18:01 UTC, Timur
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jared 2013-05-09 00:19:18 UTC
Created attachment 79035 [details]
Word 2013 file with continuous section breaks

When creating a docx file in Word 2013 with three lines, with two "continuous section breaks" between the 2nd and 3rd line it does not render the same from LibreOffice 4.0.3.1 (also tested in LO-dev4.1alpha1).

The three lines all appear at the first few lines in Word, but in LibreOffice the 3rd line moves to a second page.  I have found other section break issues which make Word and Writer non-interoperable, but this is the most simple and reproducible right now.

The Word 2013 created docx file is attached.
Comment 1 Thomas van der Meulen [retired] 2013-05-09 08:13:22 UTC
Thank you for your bug report, I can confirm this bug running LibreOffice 4.0.3.3 on Mac os x 10.8.3.
Comment 2 AdamL. 2013-07-31 15:30:30 UTC
Created attachment 83377 [details]
Word 2013 .docx file with section break issue

You can open this file in word and in libreoffice to see the formatting issue with the final page break
Comment 3 AdamL. 2013-07-31 15:32:33 UTC
This issue still exists as of 4.1.0.4 Release
Comment 4 Jared 2013-07-31 17:30:59 UTC
(In reply to comment #2)
> Created attachment 83377 [details]
> Word 2013 .docx file with section break issue
> 
> You can open this file in word and in libreoffice to see the formatting
> issue with the final page break

This attachment matches the bug and discontinuity I've been seeing.  Thanks for the example too.
Comment 5 Jared 2013-11-12 03:37:14 UTC
This still an issue in Version 4.1.3.2 for me.
Comment 6 Cor Nouws 2014-02-03 21:40:12 UTC
So if I go to the first paragraph on page two, do Format > Paragraph .. tab Text Flow and un check the page break there .. obviously the  break disappears ;)
Comment 7 Cor Nouws 2014-02-03 21:42:02 UTC
(In reply to comment #2)
> Created attachment 83377 [details]
> Word 2013 .docx file with section break issue
> 
> You can open this file in word and in libreoffice to see the formatting
> issue with the final page break

Can you pls open a separate issue for this (if it stil exists in 4.2.0) and describe what looks different (or give a screen print)?
thanks a lot,
Cor
Comment 8 Timur 2015-02-13 13:07:29 UTC
Version changed from 4.0.3.1 to 3.5.0 where bug / the other page can be reproduced for the first time. Marked as Regression. 
Added Bug 85728 to See Also, because it's also a problem with Section break in DOCX. I didn't mark as duplicate because that started in 3.6.0 (was OK in 3.5.7).
Comment 9 Timur 2015-07-15 10:13:00 UTC
Bug 92724 possibly a duplicate.
Comment 10 Jack 2015-07-15 13:50:42 UTC
*** Bug 92724 has been marked as a duplicate of this bug. ***
Comment 11 Jack 2015-07-15 13:53:17 UTC
The bug is triggered somwhere in this xml-code(inside word/document.xml)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<w:document xmlns:wpc="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" xmlns:w15="http://schemas.microsoft.com/office/word/2012/wordml" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:wpi="http://schemas.microsoft.com/office/word/2010/wordprocessingInk" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" mc:Ignorable="w14 w15 wp14">
  <w:body>
    <w:p w:rsidR="00BC17B0" w:rsidRDefault="00BC17B0">
      <w:pPr>
        <w:sectPr w:rsidR="00BC17B0" w:rsidSect="00BC17B0">
          <w:type w:val="continuous"/>
          <w:pgSz w:w="12240" w:h="15840"/>
        </w:sectPr>
      </w:pPr>
    </w:p>
    <w:p w:rsidR="00BC17B0" w:rsidRDefault="00BC17B0" w:rsidP="004F6845"/>
    <w:sectPr w:rsidR="00BC17B0" w:rsidSect="00BC17B0">
      <w:type w:val="continuous"/>
      <w:pgSz w:w="12240" w:h="15840"/>
    </w:sectPr>
  </w:body>
</w:document>
Comment 12 Jack 2015-07-20 13:04:20 UTC
*** Bug 85728 has been marked as a duplicate of this bug. ***
Comment 13 Jack 2015-07-23 06:46:17 UTC
Changed priority due the fact that the bug affects multiple users and prevents users from using a lot of document productively e.g. if someone creates a PDF for a company.
Comment 14 Timur 2015-08-13 17:44:27 UTC
Very annoying. Bug 51127 probably a duplicate.
Comment 15 Timur 2015-10-06 08:40:43 UTC
Similar problem with attachment 115706 [details] in Bug 91384, as noted by Oliver Specht:
> - The section properties contain a "<w:type w:val="continuous"/". But they
> are wrongly interpreted as page break
Comment 16 Timur 2015-10-23 07:19:26 UTC
(In reply to Timur from comment #9)
> Bug 92724 possibly a duplicate.

Stripped down examples from Bug 92724: docx attachment 117245 [details] and xml attachment 117248 [details]
Comment 17 Justin L 2016-06-14 15:05:20 UTC
Changing earliest version to 4.0.  I can't reproduce the problem in bibisect-43all - oldest.  Confirmed first bad commit 1fdd61db155cf63d5dd55cc2bfb45af33796e131

Author: Miklos Vajna <vmiklos@suse.cz>
Date:   Wed Jun 27 16:59:24 2012 +0200

    n#693238 dmapper: fix margin values vs SBkc = 0 at the end of the doc
    
    The problem was that a continous section break at the end of the
    document caused the section margins to be ignored. Just ignoring the
    continous section break (only in case it's at the end of the document)
    makes the problem go away.
    
    The original fix was commit cd1c434c4bd4756fa1355e906cb2e8de4aae0618,
    but it got reverted in commit 2dee7d6205832a1212790ac1ab168a6b6fce686d,
    as it caused fdo#44292. This second attempt fixes the original bug
    again, without introducing the "4 columns" bug.
    
    Change-Id: I75d612430a5cd631dec0d224127cba580070900d
Comment 18 Justin L 2016-06-23 06:57:49 UTC
Proposed fix: gerrit.libreoffice.org/26567

Description:  WordSectionsTest.docx - fixed
Comment2:     test_template.docx - fixed
Comment12:    bug 85728 - PriceList3.docx - fixed
Comment14:    bug 51127 is not a duplicate (.doc, not .docx import)
Comment15:    UP5_Umfrage.docx - too complicated of a test document
Comment10,16: bug 92724 - Dok2.docx - fixed
Comment10,16: bug 92724 - bug_lo.docx - fixed
Comment 19 Justin L 2016-06-23 15:22:58 UTC
*** Bug 59799 has been marked as a duplicate of this bug. ***
Comment 20 Justin L 2016-06-23 17:40:25 UTC
*** Bug 82194 has been marked as a duplicate of this bug. ***
Comment 21 Timur 2016-06-23 18:01:10 UTC
Created attachment 125865 [details]
Attachment from Bug 91384 reduced to 1 page

Justin, thank you and congratulations if you managed to solve this. I'll test when new build is available. 


(In reply to Timur from comment #15)
> Similar problem with attachment 115706 [details] in Bug 91384, as noted by
> Oliver Specht:
> > - The section properties contain a "<w:type w:val="continuous"/". But they
> > are wrongly interpreted as page break

(In reply to Justin L from comment #18)
> Comment15:    UP5_Umfrage.docx - too complicated of a test document

Following previous comments, I add attachment from Bug 91384 reduced to 1 page which LO opens as 2 pages. It has a complex header. If it's removed, LO opens also 1 page.


PS I hope you'll be able to check also those bugs with .doc.
Comment 22 Cor Nouws 2016-07-04 15:06:49 UTC
(In reply to Timur from comment #21)
> Created attachment 125865 [details]
> Attachment from Bug 91384 reduced to 1 page
> 
> Justin, thank you and congratulations if you managed to solve this. I'll
> test when new build is available. 

AFAICS there is no fix yet in a daily from July 4. 
Some problem in Version: 5.3.0.0.alpha0+
Build ID: cc503abb860c33a54a188640a5962dbdf7052284
CPU Threads: 2; OS Version: Linux 4.4; UI Render: default; 
TinderBox: Linux-rpm_deb-x86@71-TDF, Branch:master, Time: 2016-07-04_00:55:33
Locale: nl-NL (nl_NL.UTF-8)
Comment 23 Commit Notification 2016-07-08 07:25:28 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

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

tdf#64372 docx import: don't ignore continuous section break

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 24 Timur 2016-07-13 10:56:11 UTC
Examples from Comment15/Comment21 are OK now with breaks. I guess this is fixed.