Bug 118375

Summary: FILEOPEN: wrong position of rotated shapes in DOC
Product: LibreOffice Reporter: Aron Budea <aron.budea>
Component: WriterAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: raal, rb.henschel, vsfoote
Priority: medium Keywords: filter:doc
Version: Inherited From OOo   
Hardware: All   
OS: All   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=64997
Whiteboard: target:6.3.0
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 112793, 70838    
Attachments: Sample DOC
Comparison screenshot (Word - Writer)
Sample DOCX (for reference, opens correctly)
Another sample DOC (based on ODT from bug 70838)
patch for import of rotated shapes

Description Aron Budea 2018-06-25 15:35:13 UTC
Created attachment 143101 [details]
Sample DOC

The attached DOC with rotated shapes was created in Word, the different rotation values are 30, 120, 240 and 330 degrees.

In Writer the rotations appear fine, but the positioning is off.

Observed using LO 6.1 beta2 & 3.3.0 / Windows 7.

This is the import side of bug 70838.
Comment 1 Aron Budea 2018-06-25 15:35:54 UTC
Created attachment 143102 [details]
Comparison screenshot (Word - Writer)
Comment 2 Aron Budea 2018-06-25 15:37:47 UTC
Created attachment 143103 [details]
Sample DOCX (for reference, opens correctly)

Attaching the DOCX version as well, this opens fine in Writer.
Comment 3 Aron Budea 2018-06-25 15:39:41 UTC
Created attachment 143104 [details]
Another sample DOC (based on ODT from bug 70838)

This sample was created by saving attachment 141897 [details] (from bug 70838) as DOCX in Writer, then as DOC in Word. It also shows incorrectly in Writer.
Comment 4 raal 2018-06-25 16:19:26 UTC
Confirming. Version: 6.2.0.0.alpha0+
Build ID: c4c56de1b0e62ec866b519b2b24c5e805f0a86d3
CPU threads: 4; OS: Linux 4.4; UI render: default; VCL: gtk3;
Comment 5 Regina Henschel 2019-03-29 23:52:50 UTC
Created attachment 150408 [details]
patch for import of rotated shapes

The attached patch fixes the shape import for me. But it is useless without having a shape export fix. And I have no idea about export yet.
Comment 6 Regina Henschel 2019-04-06 21:18:27 UTC
proposed patch for correct position on import and export is in https://gerrit.libreoffice.org/#/c/70152/
Comment 7 Commit Notification 2019-04-06 23:15:21 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/421e6fc3cd2e6fe37afbef341e2d0ad7b8edde37%5E%21

tdf#118375, tdf#70838 correct position of rotated shape in doc

It will be available in 6.3.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 Luke 2019-04-08 16:28:36 UTC
The .doc importer and exporter now correctly handle rotated shapes. All shape test cases here are working. Tested in Writer and verified roundtrip file correctly open in Word. This is massive interoperability improvement. Well done Regina! 

Verified in Version: 6.3.0.0.alpha0+ (x64)
Build ID: 421e6fc3cd2e6fe37afbef341e2d0ad7b8edde37
Comment 9 V Stuart Foote 2019-04-08 18:49:17 UTC
Yes, rotated shapes for the sample .doc and .docx versions now match when opened in Writer.

Verified Fixed on Windows 10 Ent 64-bit en-US (1803) with
Version: 6.3.0.0.alpha0+ (x64)
Build ID: f3fc127dc007f32355859ae4fc7d34916c500a18
CPU threads: 8; OS: Windows 10.0; UI render: GL; VCL: win; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2019-04-08_04:49:13
Locale: en-US (en_US); UI-Language: en-US
Calc: CL