Bug 119234 - import of OOXML Shapes from DOCX shows shapes wrong or with outside text (DOC is OK if resaved in MSO)
Summary: import of OOXML Shapes from DOCX shows shapes wrong or with outside text (DOC...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.0.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Attila Bakos (NISZ)
URL:
Whiteboard: target:6.2.0 target:6.0.7 target:6.1....
Keywords: bibisected, bisected, filter:docx, regression
Depends on:
Blocks: DOCX-Grouped-Shapes
  Show dependency treegraph
 
Reported: 2018-08-12 21:10 UTC by Jens Troeger
Modified: 2022-03-04 15:14 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot with explanation of the different shape rendering. (113.04 KB, image/jpeg)
2018-08-12 21:10 UTC, Jens Troeger
Details
Original Word document. (15.99 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-08-12 21:11 UTC, Jens Troeger
Details
flat ODF text file of test file converted in LibreOffice (64.99 KB, application/vnd.oasis.opendocument.text)
2018-08-13 01:11 UTC, V Stuart Foote
Details
The example document in Word 2013 and Writer (117.11 KB, image/png)
2020-11-27 10:20 UTC, NISZ LibreOffice Team
Details
Bug is not reproducible (500.35 KB, image/jpeg)
2022-01-03 12:11 UTC, Vaibhav Malik
Details
Original DOCX resaved in MSO 2016 (32.47 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2022-01-12 10:49 UTC, Timur
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jens Troeger 2018-08-12 21:10:26 UTC
Created attachment 144128 [details]
Screenshot with explanation of the different shape rendering.

See the attached screen shot and test document.

Shapes in a DOCX document completely fail to render. Using Word to save as ODT works ok (minus different word breaks inside of the shapes).
Comment 1 Jens Troeger 2018-08-12 21:11:07 UTC
Created attachment 144129 [details]
Original Word document.
Comment 2 V Stuart Foote 2018-08-13 01:11:09 UTC
Same filter issues on Windows builds.  While the Word 2016 conversion to ODF opens cleanly on import to LibreOffice.

Attached is the Word 2016 ODF save converted to Flat ODF Text in LibreOffice

=-testing-=
Windows 10 Home 64-bit (1803) en-US with

Version: 6.1.0.3 (x64)
Build ID: efb621ed25068d70781dc026f7e9c5187a4decd1
CPU threads: 4; OS: Windows 10.0; UI render: GL; 
Locale: en-US (en_US); Calc: CL
Comment 3 V Stuart Foote 2018-08-13 01:11:57 UTC
Created attachment 144133 [details]
flat ODF text file of test file converted in LibreOffice
Comment 4 Xisco Faulí 2018-08-13 19:37:05 UTC
The are two problem here.
1. the shapes are not rendered.
2. The text doesn't fit the shapes.

The use this report to track problem 1...

Regression introduced by:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=65e4a776e8315fd61fd67ad00d28985b11f0b79e

author	Noel Grandin <noel.grandin@collabora.co.uk>	2017-07-11 10:31:38 +0200
committer	Noel Grandin <noel.grandin@collabora.co.uk>	2017-07-11 13:55:30 +0200
commit 65e4a776e8315fd61fd67ad00d28985b11f0b79e (patch)
tree 1ab7a2947d47807086e0477a8d3ad35c2e75dd48
parent a7b7614c7cab42cd0839752635db81e25e1e50a1 (diff)
simplify some OUString::copy calls

Bisected with: bibisect-linux64-6.0

Adding Cc: to Noel Grandin
Comment 5 Commit Notification 2018-08-14 14:59:29 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=df71ea1b01c3fd35d959053c84f615f661b69f8a

tdf#119234 OOXML Shapes from Word fail to render

It will be available in 6.2.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 6 Commit Notification 2018-08-15 06:39:41 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "libreoffice-6-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=a05df1744a9da71f255b9b413df59f321d81bb33&h=libreoffice-6-0

tdf#119234 OOXML Shapes from Word fail to render

It will be available in 6.0.7.

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

Affected users are encouraged to test the fix and report feedback.
Comment 7 Commit Notification 2018-08-15 08:01:38 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=85c0eedf04a0b31b0896842bbdb240abb3389076&h=libreoffice-6-1

tdf#119234 OOXML Shapes from Word fail to render

It will be available in 6.1.1.

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

Affected users are encouraged to test the fix and report feedback.
Comment 8 Xisco Faulí 2018-08-15 10:59:26 UTC
Verified in

Version: 6.2.0.0.alpha0+
Build ID: 18e20676024baecaf5719139f80f053f5f1e784a
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: ca-ES (ca_ES.UTF-8); Calc: threaded

@Noel Grandin, Thanks for fixing this!!
Comment 9 Jens Troeger 2018-08-20 03:46:59 UTC
Unable to verify in

Version: 6.2.0.0.alpha0+
Build ID: f05b0a6aaf8af5d78f9cad8bb953228cb0ce09f1
CPU threads: 8; OS: Mac OS X 10.11.6; UI render: default; 
TinderBox: MacOSX-x86_64@49-TDF, Branch:master, Time: 2018-08-20_00:51:25
Locale: en-US (en.UTF-8); Calc: threaded
Comment 10 Regina Henschel 2018-08-20 11:50:52 UTC
The problem with this document is, that it is in "compatibility" mode, see my comment #6 in bug 118139. If you use a current Word and convert the document to a current version of docx, the import is correct. Here tested with Version: 6.2.0.0.alpha0+ (x64)
Build-ID: c3554e77056b6c950fe946c7c53dd93838e17c9a
CPU-Threads: 8; BS: Windows 10.0; UI-Render: GL; 
Gebietsschema: de-DE (en_US); Calc: threaded
Comment 11 Timur 2019-11-25 07:10:33 UTC
I cannot confirm that .DOCX import is fine if I save it in MSO 2013 Windows.
I don't have 2016 or 2019 so if someone does, please save and attach.
Only DOC is opened fine if resaved in MSO.
I see that shapes are fine now but I reproduce wrong text in LO 6.5+.
Comment 12 NISZ LibreOffice Team 2020-11-27 10:20:19 UTC
Created attachment 167614 [details]
The example document in Word 2013 and Writer

Still not good in:

Version: 7.2.0.0.alpha0+ (x64)
Build ID: cb084f475db33a2cfc62bc9c8de37b8c3c87b3c7
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: en-US
Calc: CL

These are grouped shapes.

The text is packed tighter than in Word. This is because the spacing settings are not imported at all:
- Left indent of 0.2 cm becomes 0
- Right indent of 0.02 cm becomes 0
- Spacing before of 3.7 pt becomes 0
- Line spacing of proportional 1.21 becomes 0
Comment 13 Vaibhav Malik 2022-01-03 12:11:10 UTC
Created attachment 177278 [details]
Bug is not reproducible

Version: 7.2.3.2 / LibreOffice Community
Build ID: 20(Build:2)
CPU threads: 4; OS: Linux 5.11; UI render: default; VCL: gtk3
Locale: en-IN (en_IN); UI: en-US
Calc: threaded
Comment 14 Timur 2022-01-12 10:49:34 UTC
Created attachment 177484 [details]
Original DOCX resaved in MSO 2016

Comment 13 says that bug is not reproducible but that's not so, as explained in comment 12 for original older DOCX. 
If DOCX is resaved in MSO 2016 as newer, it's even worse, text is outside shapes.
Comment 15 Gabor Kelemen (allotropia) 2022-01-17 00:12:28 UTC
(In reply to Timur from comment #14)
> If DOCX is resaved in MSO 2016 as newer, it's even worse, text is outside
> shapes.

This looks very similar to the example file of bug 69648
Comment 16 Commit Notification 2022-03-02 08:12:39 UTC
Attila Bakos (NISZ) committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/9c0779cfe6a091e222a35b068e9354dce32cc2dc

tdf#69648 tdf#119234 sw: fix at-char group textbox position

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 17 Timur 2022-03-04 15:14:19 UTC
Original older DOCX attachment 144129 [details] is as in attachment 177278 [details], text slightly to close to the border. But it's acceptable. 
Original DOCX resaved in MSO 2016 as attachment 177484 [details] is OK now. 
I set Verified. Thanks Attila.