Download it now!
Bug 97517 - FILEOPEN: DOCX import flips line incorrectly
Summary: FILEOPEN: DOCX import flips line incorrectly
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.1.0.3 release
Hardware: All All
: medium normal
Assignee: Balázs Regényi
URL:
Whiteboard: target:7.1.0
Keywords: filter:docx
Depends on:
Blocks: VML-Shapes
  Show dependency treegraph
 
Reported: 2016-02-02 22:23 UTC by Tim van der Meij
Modified: 2020-11-11 12:44 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
Reduced test case (line) (11.27 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2016-02-02 22:24 UTC, Tim van der Meij
Details
Reduced test case (arrow head) (13.82 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2016-02-02 22:31 UTC, Tim van der Meij
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tim van der Meij 2016-02-02 22:23:37 UTC
LibreOffice Writer fails to correctly import a DOCX document with a line in it. The line is flipped incorrectly.

Steps to reproduce:
- Open the attached reduced test case with LibreOffice Writer.

Expected behavior:
- The line is drawn from the bottom left to the top right.

Actual behavior:
- The line is drawn from the top left to the bottom right.

Initial research:
- The `document.xml` file inside the DOCX file contains a `v:line` element. I noticed that this has `style="flip:x"`, which might explain why this is imported incorrectly. LibreOffice Writer probably does not take this property into account, as the line is not flipped in the x-axis in LibreOffice Writer. Hopefully this makes triaging and fixing this issue a bit easier.

You have my permission to use the attached reduced test case in any of your test suites.
Comment 1 Tim van der Meij 2016-02-02 22:24:28 UTC
Created attachment 122338 [details]
Reduced test case (line)
Comment 2 Tim van der Meij 2016-02-02 22:31:35 UTC
Created attachment 122339 [details]
Reduced test case (arrow head)

I'm attaching another reduced test case, this time an arrow head, that is also flipped incorrectly, this time in the y-axis. And again, there is `style="flip:y"` in the file's `document.xml`, which might confirm my thought about this property being ignored by LibreOffice Writer. Taking this into account will resolve both reduced test cases and probably some more files I have.

Of course you also have my full permission to use this file in any way you want for any test suite.
Comment 3 Tim van der Meij 2016-02-02 22:37:30 UTC
Hm, looking at https://www.mail-archive.com/libreoffice-commits@lists.freedesktop.org/msg06787.html the "flip" option seems implemented, also with "x" and "y" options. So either there is a bug there or something else is causing this effect. I'll leave further triage to you; you know the codebase much better than I do!
Comment 4 raal 2016-02-03 09:28:22 UTC
I can confirm with Version: 5.2.0.0.alpha0+  for "Reduced test case (line)"

Miklos, maybe you're interested ..
Comment 5 Oliver Specht (CIB) 2016-03-10 13:13:13 UTC
Import of flip X/Y at custom shapes has been implemented to fix issue 67737
It sets the property "CustomShapeGeometry"
This property is also set here but the line shape is no custom shape and the 'Normal' shapes do not support that property.
Comment 6 Xisco Faulí 2017-11-07 23:34:47 UTC
The Arrow head is correctly displayed in

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

but the line in the first document is still incorrect...

[Improvement found by office-interoperability-tools]
Comment 7 QA Administrators 2018-11-08 04:07:20 UTC Comment hidden (obsolete)
Comment 8 Roman Kuznetsov 2018-11-08 06:17:32 UTC
still repro (case with line) in

Version: 6.2.0.0.alpha1+
Build ID: 6896f39ffd8a6c4b32b8f601a6a93678247456bd
CPU threads: 4; OS: Windows 6.1; UI render: default; VCL: win; 
TinderBox: Win-x86@42, Branch:master, Time: 2018-11-05_22:40:18
Locale: ru-RU (ru_RU); Calc: threaded

arrow head looks fine
Comment 9 NISZ LibreOffice Team 2020-04-02 07:29:58 UTC
With nightly build:

Version: 7.0.0.0.alpha0+ (x86)
Build ID: d6969976b51b92813a8770b10c0bacfd4ce67642
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

Still happens, even after fixing bug #100751

@Szabolcs Tóth I think this may interest you: a single flip:x attribute is not being considered
Comment 10 Commit Notification 2020-10-26 17:23:18 UTC
Regényi Balázs committed a patch related to this issue.
It has been pushed to "master":

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

tdf#97517 DOCX VML shape import: fix missing vertical mirroring

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 11 NISZ LibreOffice Team 2020-11-11 12:44:15 UTC
Verified in 

Version: 7.1.0.0.alpha1+ (x64)
Build ID: a689cf1672e89cb78fbcfa14c505850927e71f58
CPU threads: 4; OS: Windows 10.0 Build 17134; UI render: Skia/Raster; VCL: win
Locale: hu-HU (hu_HU); UI: hu-HU
Calc: threaded

Thanks, Balázs!