Bug 126287 - Writer: DOCX export from ODT: Header/Footer is missing on second page
Summary: Writer: DOCX export from ODT: Header/Footer is missing on second page
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
3.3.0 release
Hardware: All All
: medium normal
Assignee: Vasily Melenchuk (CIB)
URL:
Whiteboard: target:7.4.0 target:7.3.1
Keywords: filter:docx
Depends on:
Blocks: DOCX-Header-Footer
  Show dependency treegraph
 
Reported: 2019-07-08 15:48 UTC by Serge Krot (CIB)
Modified: 2022-03-10 11:46 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Header on 2nd page is missing when exported into DOCX (20.66 KB, application/vnd.oasis.opendocument.text)
2019-07-08 15:48 UTC, Serge Krot (CIB)
Details
extended_test_cases.zip (28.44 KB, application/x-zip-compressed)
2020-03-19 10:00 UTC, Serge Krot (CIB)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Serge Krot (CIB) 2019-07-08 15:48:17 UTC
Created attachment 152645 [details]
Header on 2nd page is missing when exported into DOCX

Header on 2nd page is missing when exported into DOCX.
Comment 1 Dieter 2019-07-08 15:56:45 UTC
I confirm it with

Version: 6.4.0.0.alpha0+ (x64)
Build ID: ae823e4633a76d13cebc6432b9e44b9b2862326b
CPU threads: 4; OS: Windows 10.0; UI render: GL; VCL: win; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2019-06-26_23:06:07
Locale: de-DE (de_DE); UI-Language: en-US
Calc: threaded
Comment 2 Xisco Faulí 2019-07-09 14:55:13 UTC
Reproduced in

Version: 5.2.0.0.alpha1+
Build ID: 5b168b3fa568e48e795234dc5fa454bf24c9805e
CPU Threads: 4; OS Version: Linux 4.15; UI Render: default; 
Locale: ca-ES (ca_ES.UTF-8

and

Version 4.1.0.0.alpha0+ (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)
Comment 3 Serge Krot (CIB) 2020-03-19 09:57:39 UTC
Here is a set of the same test cases (style, page setup, etc) with only one difference at the end of the FODT XML file (which was modified directly in XML-text editor). In spite of the structure of the documents is the same (it always finished on first page with P1 style and second page starts with P1 style) the second page could have header (correct) or not (wrong).

See attached extended_test_cases.zip

case_1_big.fodt
- document ends with:
     <text:p text:style-name="Weisse_5f_Schrift"/>
     <text:p text:style-name="Weisse_5f_Schrift"/>
    </text:section>
   </text:section>
   <text:p text:style-name="P1">Lorem ipsum dolor sit amet ....</text:p>
  </office:text>
- header on second page = yes (CORRECT)
  
case_2_several_small.fodt
- document ends with:
     <text:p text:style-name="Weisse_5f_Schrift"/>
     <text:p text:style-name="Weisse_5f_Schrift"/>
    </text:section>
   </text:section>
   <text:p text:style-name="P1">Lorem</text:p>
   <text:p text:style-name="P1">Lorem</text:p>
   <text:p text:style-name="P1">Lorem</text:p>
   ...
   <text:p text:style-name="P1">Lorem</text:p>
  </office:text>
- header on second page = yes (CORRECT)

case_3_big_plus_empty.fodt
- the same as case_1_big.fodt but with one additional empty P1 paragraph at the end.
- document ends with:
     <text:p text:style-name="Weisse_5f_Schrift"/>
     <text:p text:style-name="Weisse_5f_Schrift"/>
    </text:section>
   </text:section>
   <text:p text:style-name="P1">Lorem ipsum dolor sit amet ....</text:p>
   <text:p text:style-name="P1"/>
  </office:text>
- header on second page = no (WRONG)

case_3b_big_plus_empty.fodt
- The same as case_3_big_plus_empty.fodt but with text in last paragraph in prev section
- document ends with:
     <text:p text:style-name="Weisse_5f_Schrift"/>
     <text:p text:style-name="Weisse_5f_Schrift">Weisse_5f_Schrift</text:p>
    </text:section>
   </text:section>
   <text:p text:style-name="P1">Lorem ipsum dolor sit amet ....</text:p>
   <text:p text:style-name="P1"/>
  </office:text>
- header on second page = yes (CORRECT)

case_4_big_plus_small.fodt
- the same as case_1_big.fodt but with one additional non empty P1 paragraph at the end.
- document ends with:
     <text:p text:style-name="Weisse_5f_Schrift"/>
     <text:p text:style-name="Weisse_5f_Schrift"/>
    </text:section>
   </text:section>
   <text:p text:style-name="P1">Lorem ipsum dolor sit amet ....</text:p>
   <text:p text:style-name="P1">Lorem</text:p>
  </office:text>
- header on second page = no (WRONG)

case_4b_big_plus_small.fodt
- The same as case_4_big_plus_small.fodt but with text in last paragraph in prev section
- document ends with:
     <text:p text:style-name="Weisse_5f_Schrift"/>
     <text:p text:style-name="Weisse_5f_Schrift">Weisse_5f_Schrift</text:p>
    </text:section>
   </text:section>
   <text:p text:style-name="P1">Lorem ipsum dolor sit amet ....</text:p>
   <text:p text:style-name="P1">Lorem</text:p>
  </office:text>
- header on second page = yes (CORRECT)
Comment 4 Serge Krot (CIB) 2020-03-19 10:00:08 UTC
Created attachment 158794 [details]
extended_test_cases.zip
Comment 5 Commit Notification 2022-02-07 20:20:57 UTC
Vasily Melenchuk committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/19bca24486315cc35f873486e6a2dd18394d0614

tdf#126287: docx import: use defered linebreak

It will be available in 7.4.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 6 Commit Notification 2022-02-09 09:16:58 UTC
Vasily Melenchuk committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/2b1826a0078fc43b0f0f9078561cec7df1dd92df

tdf#126287: docx import: use defered linebreak

It will be available in 7.3.1.

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

Affected users are encouraged to test the fix and report feedback.
Comment 7 Dieter 2022-03-10 11:46:12 UTC
VERIFIED with

Version: 7.3.1.3 (x64) / LibreOffice Community
Build ID: a69ca51ded25f3eefd52d7bf9a5fad8c90b87951
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: de-DE
Calc: CL

Vasily, thank you for fixing it!