Bug 112342 - FILEOPEN DOCX Page breaks are before the images in Microsoft Word, but after images in LibreOffice Writer
Summary: FILEOPEN DOCX Page breaks are before the images in Microsoft Word, but after ...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Attila Bakos (NISZ)
URL:
Whiteboard: target:7.1.0 target:7.0.2
Keywords: filter:docx
Depends on:
Blocks: DOCX-Page
  Show dependency treegraph
 
Reported: 2017-09-12 08:00 UTC by Gabor Kelemen (allotropia)
Modified: 2023-02-15 00:58 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
The problematic document (32.27 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2017-09-12 08:00 UTC, Gabor Kelemen (allotropia)
Details
Screenshot of the document in LO 5.4 and Word 2013 (228.18 KB, image/png)
2017-09-12 08:05 UTC, Gabor Kelemen (allotropia)
Details
This_Is_The_Reason_Of_The_Bug (35.76 KB, image/png)
2020-02-07 11:06 UTC, Attila Bakos (NISZ)
Details
The_modified_document (31.07 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-02-07 11:08 UTC, Attila Bakos (NISZ)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen (allotropia) 2017-09-12 08:00:54 UTC
Created attachment 136190 [details]
The problematic document

This DOCX document was originally created in Microsoft Office. The document contains text, images (anchored as characters) and page breaks. If we open the document in Microsoft Office 2013, the page breaks are before the images. In LibreOffice Writer the pages breaks are after the images.

Steps to reproduce:
1. Open the document (pagebreak-bug.docx) both in LibreOffice and Microsoft Office.

Actual results:
The page break is at a different location in Writer and Word.

Expected results:
The document should look identical both in Writer and Word.
Comment 1 Gabor Kelemen (allotropia) 2017-09-12 08:05:39 UTC
Created attachment 136191 [details]
Screenshot of the document in LO 5.4 and Word 2013
Comment 2 Xisco Faulí 2017-09-12 23:12:50 UTC
Confirmed in

- Version: 6.0.0.0.alpha0+
Build ID: 383aab7ed63bf30931c1cf89138707d2228b5dce
CPU threads: 4; OS: Linux 4.10; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group

- Version: 4.3.0.0.alpha1+
Build ID: c15927f20d4727c3b8de68497b6949e72f9e6e9e

- Version 4.1.0.0.alpha0+ (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)

- LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4
Comment 3 QA Administrators 2018-09-13 02:40:53 UTC Comment hidden (obsolete)
Comment 4 Roman Kuznetsov 2018-09-13 07:06:31 UTC
still repro in

Версия: 6.1.1.1
ID сборки: 2718b4a18dfcc6a54ebe5f7b801ee7a47fa81e0c
Потоков ЦП: 4; ОС:Windows 6.1; Отрисовка ИП: по умолчанию; 
Локаль: ru-RU (ru_RU); Calc: group threaded
Comment 5 Attila Bakos (NISZ) 2020-02-07 11:06:52 UTC
Created attachment 157728 [details]
This_Is_The_Reason_Of_The_Bug

In this picture on left there is the original document on right I put an enter symbol at the marked location. This is the key for the solution, because the problem is that the newpage "symbol" in the MSWord and the picture is in the "same" line (yes, I see, they are in different pages but tecnically in one line, and the picture wrapped to the next page, but just because there is not enough space for it, and that is the problem). So the LO removes the newpage symbol and places a new page instead of it. But the picture is in that line what is in the last section. This is the problem. Later, I will try to solve it later, with a dummy symbol maybe...
Comment 6 Attila Bakos (NISZ) 2020-02-07 11:08:05 UTC
Created attachment 157729 [details]
The_modified_document
Comment 7 Commit Notification 2020-08-07 09:49:01 UTC
Attila Bakos committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/e520a4f988bf0ff81e75e37588182af92fed7631

tdf#112342 DOCX import: fix page break before image-only 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.
Comment 8 Xisco Faulí 2020-09-08 16:30:42 UTC
Verified in

Version: 7.1.0.0.alpha0+
Build ID: 6b2eff7d69c6e14d89dd33eaa58c01d82c541266
CPU threads: 4; OS: Linux 5.7; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

@Attila Bakos, thanks for fixing this issue!!
Comment 9 Commit Notification 2020-09-08 16:37:54 UTC
Attila Bakos committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/75f291ff075c4e4106a1f652e8bab629e4edcff7

tdf#112342 DOCX import: fix page break before image-only paragraphs

It will be available in 7.0.2.

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.