Bug 125657 - DOCX Export Document with a picture and page break doesn't open in MS Word when saved as DOCX
Summary: DOCX Export Document with a picture and page break doesn't open in MS Word wh...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.3.0.0.alpha1+
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:6.4.0 target:6.3.0.1
Keywords: bibisected, bisected, regression
Depends on:
Blocks: DOCX-Images
  Show dependency treegraph
 
Reported: 2019-06-03 14:12 UTC by NISZ LibreOffice Team
Modified: 2019-06-05 15:11 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
The original file created with Microsoft Word. (55.07 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2019-06-03 14:12 UTC, NISZ LibreOffice Team
Details
The document exported with LibreOffice 6.4 master (Version: 6.4.0.0.alpha0+ (x64), Build ID: 02bee5f5d846f40f244c5acab044177576a6d869, Time: 2019-06-02_21:57:08) (38.60 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2019-06-03 14:13 UTC, NISZ LibreOffice Team
Details
The document exported with LibreOffice 6.2.4 (Version: 6.2.4.2 (x64), Build ID: 2412653d852ce75f65fbfa83fb7e7b669a126d64) (38.31 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2019-06-03 14:14 UTC, NISZ LibreOffice Team
Details
Screenshot showcasing the issue (114.35 KB, image/png)
2019-06-03 14:16 UTC, NISZ LibreOffice Team
Details

Note You need to log in before you can comment on or make changes to this bug.
Description NISZ LibreOffice Team 2019-06-03 14:12:56 UTC
Created attachment 151872 [details]
The original file created with Microsoft Word.

This is a simple document with a picture and a page break. When the document is saved as DOCX with LibreOffice 6.4 master (Version: 6.4.0.0.alpha0+ (x64), Build ID: 02bee5f5d846f40f244c5acab044177576a6d869, Time: 2019-06-02_21:57:08) the exported document doesn't open with Microsoft Word and the following error message is shown:
The file Picture-pagebreak-export-issue-lo64.docx cannot be opened because there are problems with the contents.

The same DOCX file opens without any problems when exported with LibreOffice 6.2.4 (Build ID: 2412653d852ce75f65fbfa83fb7e7b669a126d64).

The issue is caused by this part in the word/document.xml file:
<a:srcRect l="-350.08752188047" t="-622.153094100656" r="-350.08752188047" b="-622.153094100656"/>

If we change the values to integers the document opens in Microsoft Word without any issue:
<a:srcRect l="-350" t="-622" r="-350" b="-622"/>

Steps to reproduce:
    1. Open the attached Picture-pagebreak-export-issue.docx file with LibreOffice Writer.
    2. Save the file as DOCX.
    3. Try to open the resulted file with Microsoft Word.

Actual results:
The file doesn't open in Microsoft Word and the following error message is shown:
The file Picture-pagebreak-export-issue.docx cannot be opened because there are problems with the contents.

Expected results:
The file should open without any problems.

LibreOffice details:
Version: 6.4.0.0.alpha0+ (x64)
Build ID: 02bee5f5d846f40f244c5acab044177576a6d869
CPU threads: 4; OS: Windows 6.3; UI render: GL; VCL: win; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2019-06-02_21:57:08
Locale: hu-HU (hu_HU); UI-Language: en-US
Calc: threaded

Version: 6.2.4.2 (x64)
Build ID: 2412653d852ce75f65fbfa83fb7e7b669a126d64
CPU threads: 4; OS: Windows 6.3; UI render: GL; VCL: win; 
Locale: hu-HU (hu_HU); UI-Language: en-US
Calc: threaded
Comment 1 NISZ LibreOffice Team 2019-06-03 14:13:57 UTC
Created attachment 151873 [details]
The document exported with LibreOffice 6.4 master (Version: 6.4.0.0.alpha0+ (x64), Build ID: 02bee5f5d846f40f244c5acab044177576a6d869, Time: 2019-06-02_21:57:08)
Comment 2 NISZ LibreOffice Team 2019-06-03 14:14:36 UTC
Created attachment 151874 [details]
The document exported with LibreOffice 6.2.4 (Version: 6.2.4.2 (x64), Build ID: 2412653d852ce75f65fbfa83fb7e7b669a126d64)
Comment 3 NISZ LibreOffice Team 2019-06-03 14:16:33 UTC
Created attachment 151875 [details]
Screenshot showcasing the issue
Comment 4 Dieter 2019-06-03 14:30:53 UTC
I confirm the bug

Can't open file in Word 2016, when it is saved with

Version: 6.3.0.0.beta1 (x64)
Build ID: a187af327633f5f00363be5131bd21a13e0f1a7b
CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win; 
Locale: en-US (de_DE); UI-Language: en-GB
Calc: threaded

I can open file in Word 2016, when it is saved with

Version: 6.2.4.2 (x64)
Build-ID: 2412653d852ce75f65fbfa83fb7e7b669a126d64
CPU-Threads: 4; BS: Windows 10.0; UI-Render: Standard; VCL: win; 
Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE
Calc: threaded
Comment 5 Gabor Kelemen (allotropia) 2019-06-03 21:49:05 UTC
Bibisected using bibisect-linux-64-6.3 to: 

https://cgit.freedesktop.org/libreoffice/core/commit/?id=1fe24bb1e2fbe44a4bf2c03297e259b3a18b1235

author	Mike Kaganski <mike.kaganski@collabora.com>	2019-04-19 02:24:00 +0300
committer	Mike Kaganski <mike.kaganski@collabora.com>	2019-04-19 21:20:46 +0200

Further cleanup of FastSerializerHelper's startElement/singleElement[NS]
Drop FSEND_t: C-style varargs code was replaced since version 6.0 in commit d43fc40718217d89cc95cc3c0bc0b8e7926abcc0, so it's time to remove the last bits.

Drop int-to-string macros that are simple wrappers over OString::number.

Avoid unnecessary string type conversions.

Adding Cc: to Mike Kaganski
Comment 6 Mike Kaganski 2019-06-04 07:21:31 UTC
https://gerrit.libreoffice.org/73430
Comment 7 Commit Notification 2019-06-04 11:07:23 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/166aafde5b716dfeb5325e7d1bee1c163ab56b12%5E%21

tdf#125657: restore conversion of a:srcRect attributes to integers

It will be available in 6.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 8 Commit Notification 2019-06-04 21:32:10 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-6-3":

https://git.libreoffice.org/core/+/66a5ab79b0a67e67ce196557ae4e768460807d98%5E%21

tdf#125657: restore conversion of a:srcRect attributes to integers

It will be available in 6.3.0.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 9 Xisco Faulí 2019-06-05 15:11:14 UTC
Verified in

Version: 6.4.0.0.alpha0+
Build ID: 0d6ec494f83fb26524bf3a5fc7af27c225293e87
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); UI-Language: en-US
Calc: threaded

@Mike Kaganski, thanks for fixing this issue!