Bug 136832 - Filesave DOCX ?LAYOUT?: Blank first page in specific document if the first page starts with a table that specifies a pagebreak before, only in LO not in MSO
Summary: Filesave DOCX ?LAYOUT?: Blank first page in specific document if the first pa...
Status: RESOLVED DUPLICATE of bug 135786
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected) release
Hardware: All All
: low minor
Assignee: Not Assigned
Keywords: bibisected, bisected, regression
Depends on:
Blocks: DOCX-Tables
  Show dependency treegraph
Reported: 2020-09-17 06:37 UTC by Telesto
Modified: 2023-03-30 06:55 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:

An attempt to reproduce the same layout in Word (302.72 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2021-07-22 09:06 UTC, NISZ LibreOffice Team
another test odt (44.96 KB, application/vnd.oasis.opendocument.text)
2022-10-20 08:34 UTC, Kevin Suo

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2020-09-17 06:37:31 UTC
Blank first page after export to DOCX caused by spurious page break

Steps to Reproduce:
1. Open attachment 165535 [details]
2. Save as DOCX
3. File reload

Actual Results:
Empty first page

Expected Results:
Ideally not

Reproducible: Always

User Profile Reset: No

Additional Info:
Build ID: c01aa64b6c3d89ebe5fe69c28c7adb24eb85249c
CPU threads: 4; OS: Mac OS X 10.12.6; UI render: default; VCL: osx
Locale: nl-NL (nl_NL.UTF-8); UI: en-US
Calc: threaded
Comment 1 Telesto 2020-09-17 07:41:42 UTC
Also in

no repro with
Build ID: 3215f89-f603614-ab984f2-7348103-1225a5b
Comment 2 Telesto 2020-09-17 07:42:43 UTC
Because page breaks are a thing.. this time trigger by section I guess
Comment 3 Justin L 2020-09-17 12:07:40 UTC
The first page starts with a table, that specifies a pagebreak before the table in the text flow.
Comment 4 Telesto 2020-09-17 12:19:47 UTC Comment hidden (no-value)
Comment 5 Justin L 2020-09-18 15:03:06 UTC
Hmm. I expected this to be an export issue, but it looks like an import issue.
1.) MS Word 2003 opens without a empty first page.
2.) If I first reduce the file contents, I don't get a page break. (However, simply round-tripping as another .odt first doesn't "fix" the problem , so it isn't something goofy like that.)

The different first-page footer is causing a first/follow page-style-with-page-break situation.

I think this is probably just a layout problem (since a reduced three page version imports just fine).
Comment 6 Timur 2020-10-19 12:48:46 UTC
"no repro with, repro" is not sufficient to ask for bibisectRequest. Telesto, either do it yourself or at least find a specific version. And do not call devs before all is cleat, writing you always the same. 

No repro 4.2, repro 4.3. Only now it's clear it's from 4.3, fileopen in LO, not in MSO.

commit 310f70aedd0cb2e8d2c63dcd57f44804592f30ba
Author: Matthew Francis <mjay.francis@gmail.com>
Date:   Thu May 28 21:18:07 2015 +0800

    previous source-hash-cf058da1e5664bc8c30a5777e2c1dbf059a6304f   

    commit 2e8aad6d45c53d554ccaf26de998ede708cfc289
    Author:     Vinaya Mandke <vinaya.mandke@synerzip.com>
    AuthorDate: Fri Apr 18 15:50:51 2014 +0530
    Commit:     Miklos Vajna <vmiklos@collabora.co.uk>
    CommitDate: Thu Apr 24 12:57:51 2014 +0200
        fdo#39056 fdo#75431 Section Properties if section starts with table

Justin, can you please see and explain if this should be fixed.
Comment 7 Justin L 2020-10-19 14:45:50 UTC
It is almost guaranteed that this commit has only exposed the problem. If I am correct about it being a layout problem, then it involves different code.

Very few people should be allowed to touch the layout code, and there would need to be a compelling reason to investigate further. A fix for this would either require a lot of knowledge or a lot of time.
Comment 8 NISZ LibreOffice Team 2021-07-22 09:06:29 UTC
Created attachment 173770 [details]
An attempt to reproduce the same layout in Word

I tried to create the same problem in Word from 0.
But no luck, despite starting the document with a table and a paragraph set to start on a new page ("page break before" in Writer terms), and a few more ideas, nothing - this document appears correctly in Writer, no extra page break.

I thought Writer might handle some mix of settings incorrectly, but this looks more and more like a layout edge case.
Comment 9 Kevin Suo 2022-10-20 08:34:43 UTC
Created attachment 183157 [details]
another test odt

I have the same issue with the attached odt document. Save it as docx causes a blank first page when open in Writer. This one does not start with a table.
Comment 10 Czeber László Ádám (NISZ) 2023-03-27 12:36:27 UTC
@Kevin the file you posted has the "break-before=page" property in the "P1" header style. This is what makes it insert a page break before, if it is not in there it works correctly, just like the first test file works correctly.
Comment 11 Czeber László Ádám (NISZ) 2023-03-30 06:55:04 UTC

*** This bug has been marked as a duplicate of bug 135786 ***