Bug 87488 - Wrong text rotation inside a preset shape imported from docx
Summary: Wrong text rotation inside a preset shape imported from docx
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
4.3.4.1 release
Hardware: Other All
: medium normal
Assignee: Gary Houston
QA Contact:
URL:
Whiteboard: target:5.0.0 target:4.4.3 target:4.3.7
Keywords: filter:docx
Depends on:
Blocks:
 
Reported: 2014-12-19 11:50 UTC by Gary Houston
Modified: 2015-12-17 04:37 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
docx file with DrawingML shape rotated 90 degrees and text inside shape rotated -90. (9.54 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2014-12-19 11:50 UTC, Gary Houston
Details
2014-12-19 test file opened with Word 2011 on OSX 10.10.1 (129.75 KB, image/png)
2014-12-20 20:36 UTC, retired
Details
Another test case. Two shapes with text, but the one on the right is inverted in LibreOffice. (25.80 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2015-01-06 23:45 UTC, Gary Houston
Details
PDF version of test case exported from Word. (119.95 KB, application/pdf)
2015-01-06 23:47 UTC, Gary Houston
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gary Houston 2014-12-19 11:50:48 UTC
Created attachment 111039 [details]
docx file with DrawingML shape rotated 90 degrees and text inside shape rotated -90.

Text inside a preset shape diagram imported from docx is rotated in the wrong direction. E.g., the attached document has a shape rotated by 90 degrees which contains text that is rotated by -90 degrees. The rotation of the text is relative to the containing shape, so the two rotations should cancel out and leave the text the right way up. However in Writer the text is upside down.

The attached file contains only hand-crafted DrawingML so won't be usable in programs like Word that read SmartArt. However it can be opened in Google Docs and the text will be the right way up.

I have a patch, I'll try to submit it some time using gerrit.
Comment 1 Robinson Tryon (qubit) 2014-12-20 19:43:55 UTC
Comment on attachment 111039 [details]
docx file with DrawingML shape rotated 90 degrees and text inside shape rotated -90.

Fix mimetype
Comment 2 retired 2014-12-20 20:36:51 UTC
Created attachment 111088 [details]
2014-12-19 test file opened with Word 2011 on OSX 10.10.1
Comment 3 Gary Houston 2014-12-20 22:24:20 UTC
Interesting, I didn't think Word would open the document at all (since Microsoft's word viewer doesn't). Unfortuately I don't have a copy of Word available to experiment with it myself. 

I think it would be possible to create a well-formed test document within Word by making diagram containing one of the pre-defined shapes (one without rotational symmetry), rotating it 90 degrees and putting some right-way-up text inside it.
Comment 4 Gary Houston 2014-12-20 22:26:32 UTC
I do have an original Word document that exhibits the problem, and which is fixed by my patch, but I don't want to attach it here due to copyright/privacy issues.
Comment 5 Gary Houston 2014-12-29 01:02:56 UTC
I got access to a machine with Word and attempted to duplicate it, but ended up with fdo#87811 instead. Perhaps it needs to be created as a SmartArt document. Don't have a good test document yet.
Comment 6 Gary Houston 2015-01-06 05:15:35 UTC
I created a couple more test documents using SmartArt, but neither comes out identically to this bug. See 88090 and 88091. I'm mystified about how the original document was created.
Comment 7 Gary Houston 2015-01-06 23:45:56 UTC
Created attachment 111875 [details]
Another test case. Two shapes with text, but the one on the right is inverted in LibreOffice.
Comment 8 Gary Houston 2015-01-06 23:46:34 UTC
Comment on attachment 111875 [details]
Another test case. Two shapes with text, but the one on the right is inverted in LibreOffice.

Created this one in Word 2010 by cutting down the original document.
Comment 9 Gary Houston 2015-01-06 23:47:36 UTC
Created attachment 111877 [details]
PDF version of test case exported from Word.
Comment 10 Robinson Tryon (qubit) 2015-01-15 08:30:47 UTC
(In reply to Gary Houston from comment #6)
> I created a couple more test documents using SmartArt, but neither comes out
> identically to this bug. See 88090 and 88091. I'm mystified about how the
> original document was created.

Fair enough. I'll toss this in NEEDINFO. Feel free to change the Status back to UNCONFIRMED once you have enough information assembled for us to (try to) reproduce it.
Comment 11 Gary Houston 2015-01-15 21:49:21 UTC
I still don't know how to create such a document in Word from scratch, but the document that I uploaded in Comment 7 should be enough to verify the behaviour in Word vs LibreOffice.
Comment 12 Robinson Tryon (qubit) 2015-01-15 22:31:56 UTC
TESTING with Lo 4.4.0.2 + Ubuntu 14.04

(In reply to Gary Houston from comment #7)
> Created attachment 111875 [details]
> Another test case. Two shapes with text,

Ok

> but the one on the right is
> inverted in LibreOffice.

CONFIRMED: Yep, the text in the right-hand object is upside down

> PDF version of test case in Word: attachment 111877 [details]

If that's how the test document appears in Word, then LibreOffice is definitely doing something differently.

Status -> NEW
Comment 13 Commit Notification 2015-01-21 13:23:08 UTC
Gary Houston committed a patch related to this issue.
It has been pushed to "master":

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

fdo#87488 Wrong text rotation inside a preset shape from docx

It will be available in 4.5.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 14 Commit Notification 2015-03-31 07:25:43 UTC
Gary Houston committed a patch related to this issue.
It has been pushed to "libreoffice-4-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=b8fdf370d8732d39d6739e320aa1450ead5a31b7&h=libreoffice-4-4

fdo#87488 Wrong text rotation inside a preset shape from docx

It will be available in 4.4.3.

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 15 Commit Notification 2015-03-31 10:05:01 UTC
Gary Houston committed a patch related to this issue.
It has been pushed to "libreoffice-4-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=89032c4b7344139b7e3608d09e8c63b3eafd534b&h=libreoffice-4-3

fdo#87488 Wrong text rotation inside a preset shape from docx

It will be available in 4.3.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 16 Robinson Tryon (qubit) 2015-12-17 04:37:15 UTC
Migrating Whiteboard tags to Keywords: (filter:docx)
[NinjaEdit]