Bug 75722 - FILEOPEN: DOCX: incorrect position of DrawingML shapes
Summary: FILEOPEN: DOCX: incorrect position of DrawingML shapes
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
4.3.0.0.alpha0+ Master
Hardware: Other All
: medium normal
Assignee: Jacobo Aragunde Pérez
URL:
Whiteboard: target:4.3.0
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-03 16:48 UTC by Jacobo Aragunde Pérez
Modified: 2017-06-02 11:04 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Test case (15.68 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2014-03-03 16:48 UTC, Jacobo Aragunde Pérez
Details
Side by side comparison (136.95 KB, image/png)
2014-03-03 16:49 UTC, Jacobo Aragunde Pérez
Details
Simplified test case (positioned at [0,0]) (15.13 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2014-04-04 17:23 UTC, Jacobo Aragunde Pérez
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jacobo Aragunde Pérez 2014-03-03 16:48:11 UTC
Created attachment 95040 [details]
Test case

Open the attached file with Word and with the latest LibreOffice, you will see that the position of the shape is different. The file contains a rotated rectangle in DrawingML, and a fallback section in VML.

If you try to open the file with LibreOffice 4.2, the shape will also be placed in the proper place. I think that's because 4.2 is reading the fallback section of the shape and the VML import/export code is older and has been more deeply tested.
Comment 1 Jacobo Aragunde Pérez 2014-03-03 16:49:06 UTC
Created attachment 95041 [details]
Side by side comparison

Side by side comparison between LibreOffice and Word 2010 opening the test case document.
Comment 2 Jorendc 2014-03-03 17:55:00 UTC
Reproducible, tested using Mac OSX 10.9 with LibreOffice Version: 4.3.0.0.alpha0+
Build ID: a08136d205c8fa0be5c6b1fe4360b20360871aea

Kind regards,
Joren
Comment 3 Jacobo Aragunde Pérez 2014-04-04 17:14:02 UTC
Working on it right now.
Comment 4 Jacobo Aragunde Pérez 2014-04-04 17:23:40 UTC
Created attachment 96913 [details]
Simplified test case (positioned at [0,0])

I'm uploading this test case, that makes the problem clearer. The position info contained in this shape is:

<wp:positionH relativeFrom="column">
  <wp:posOffset>0</wp:posOffset>
</wp:positionH>
<wp:positionV relativeFrom="paragraph">
  <wp:posOffset>0</wp:posOffset>
</wp:positionV>

If you open this document with Word, you will see that the bounding box of the rotated shape is not positioned at (0,0). Instead, (0,0) is the position of the *unrotated* shape.
Comment 5 Commit Notification 2014-04-15 09:36:59 UTC
Jacobo Aragunde Perez committed a patch related to this issue.
It has been pushed to "master":

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

fdo#75722: fix incorrect import of rotated DML shapes



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 2014-04-15 09:50:10 UTC
Jacobo Aragunde Perez committed a patch related to this issue.
It has been pushed to "master":

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

fdo#75722: Push missing unit test files



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 Jacobo Aragunde Pérez 2014-04-15 10:36:38 UTC
I'm not very satisfied with the patch (I find it too hackish) but I think the bug is fixed.
Comment 8 vihsa 2017-06-02 11:04:16 UTC
verified

Version: 5.5.0.0.alpha0+
Build ID: 066665644b398a882e6cded98af5bb060af41d76
TinderBox: Android-ARM@24-Bytemark-Hosting, Branch: Master, Time: 2017-06-01 00:30:43