Created attachment 159625 [details] Example base document with closing empty paragraph When a multiple page mailmerge document is saved as a single DOCX, the last empty paragraph of the source document disappears. If there is no such paragraph the delimiter page break between individual documents is misplaced. Steps to reproduce: 1. Open attached mail merge document MM-basedoc.odt and set up attached data source MM-datasource.xlsx 2. Use the Save Merged Documents button on the MM toolbar, save as odt, then do it again as docx. 3. Open the other attached mail merge document MM-basedoc-N.odt, it is the same as the MM-basedoc.odt except for the closing empty paragraph. 4. Use the Save Merged Documents button on the MM toolbar, save as odt, then do it again as docx. Actual results: The unified docx documents do not have the last empty paragraph of the base document, while the odt documents do. The docx document unified from the MM-basedoc-N.odt file looks terrible: there is a very misplaced page break between individual documents and all pages have the first page header and footer. Expected results: Similar to the unified odt files. LibreOffice details: Version: 7.0.0.0.alpha0+ (x64) Build ID: 94a7ceae287a7967e8f013d012673e26637c6bb5 CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win; Locale: hu-HU (hu_HU); UI-Language: en-US Calc: CL Also happens in: Verzió: 6.1.0.3 Build az.: efb621ed25068d70781dc026f7e9c5187a4decd1 CPU szálak: 4; OS: Windows 6.3; Felületmegjelenítés: GL; Területi beállítások: hu-HU (hu_HU); Calc: CL Does not happen in: Verzió: 6.0.0.3 Build az.: 64a0f66915f38c6217de274f0aa8e15618924765 CPU szálak: 4; OS: Windows 6.3; Felületmegjelenítés: GL; Területi beállítások: hu-HU (hu_HU); Calc: CL (page breaks here are correct, only the first page header is present on the second pages)
Created attachment 159626 [details] Example base document without closing empty paragraph
Created attachment 159627 [details] Very simple data source for the base documents
Created attachment 159628 [details] ODT merged from the base document with closing empty paragraph
Created attachment 159629 [details] DOCX merged from the base document with closing empty paragraph
Created attachment 159630 [details] Screenshot of the two documents merged from the base document with closing empty paragraph
Created attachment 159631 [details] ODT merged from the base document without closing empty paragraph
Created attachment 159632 [details] DOCX merged from the base document without closing empty paragraph
Created attachment 159633 [details] Screenshot of the two documents merged from the base document without closing empty paragraph
Bug report says bisected, but I'm not seeing any commit references.
Bibisected using bibisect-win32-6.1 to: URL: https://cgit.freedesktop.org/libreoffice/core/commit/?id=c1d58c46eec5081576979f584151c7e9a4f67fe0 author Tamas Bunth <tamas.bunth@collabora.co.uk> Fri Dec 01 14:58:17 2017 +0100 committer Tamás Bunth <btomi96@gmail.com> Fri Dec 08 16:14:59 2017 +0100 tdf#41650 DOCX export: split para on section break
Created attachment 164672 [details] MM.odt: 4 letters combined into one document. Tweaked endings to prove point. This doesn't really have anything to do with mail merges. That was just the way this particular document was generated. Attached here is a modified output from the mail-merge. On the first two letters I removed the extra paragraph at the end. There are several very different parts to the is bug report. The "loss" of the very last, empty paragraph marker does NOT connect to Tamas' patch. That is already true in 5.2 at least. I'm sure that is connected to bRemove. I wouldn't consider that a bug, is basically irrelevant to this bug report. The bibisect was watching the loss of the page break between the four letters. However, it is worth noting that before Tamas' commit, all DOCX pages also contained the first page header. So Tamas' fix solved the problem of MM-basedoc.odt (which now properly excludes the header on the second page). However, for MM-basedoc-N.odt it looks like it swallowed the page break on the paragraph that spanned the two pages.
A draft fix for this can be found at http://gerrit.libreoffice.org/c/core/+/101344. I'd like to understand this area a bit better before proposing it though.
Created attachment 164711 [details] 132149_pgBreak3.odt: a stress test against Tamas' patch
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/e538c63c0d55b581332f4146dab26e26eb611dce related tdf#132149 ww8 export: unit test to prevent bad fix It will be available in 7.1.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.
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/a0da393cac0a44c648238b815970245684173c99 tdf#132149 ww8export: nextNode has nothing to do with pageDesc It will be available in 7.1.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.
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/d08bbf4a1b1a62ef1f52665f52ed8880792c64ef tdf#132149 ww8export: always check for break at end of paragraph It will be available in 7.1.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.
Created attachment 165766 [details] tdf132149_pgBreakB.odt: a second stress test -focusing on Page::BreakAfter
(In reply to Justin L from comment #17) > tdf132149_pgBreakB.odt: a second stress test -focusing on Page::BreakAfter I spun this off into bug 136952.
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/5a234ba7f02660ab770f2744d0b936e5607ddafe tdf#132149 ww8export: use left page properties for left style It will be available in 7.1.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.
Justin Luth committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/28dddd4f7e255c74c17c0c6b263303f4567b5678 tdf#132149 ww8export: respect ginormous paragraphs It will be available in 7.1.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.