Bug 149809 - FILEOPEN FILESAVE Text orientation is wrong after round-trip
Summary: FILEOPEN FILESAVE Text orientation is wrong after round-trip
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.5.0.0 alpha0+
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-01 15:46 UTC by Regina Henschel
Modified: 2022-07-24 03:33 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
Test document from unit test (15.55 KB, application/zip)
2022-07-01 15:46 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2022-07-01 15:46:33 UTC
Created attachment 181071 [details]
Test document from unit test

This is a follow-up to bug 87924.

The attached document is the test document from unit test DECLARE_OOXMLIMPORT_TEST(testTdf87924, "tdf87924.docx").

Open the saved document in Word. Notice, that the text appears horizontal. In fact the text is with text direction "Rotate all text 270°" which compensates the 90° shape rotation.

Now open the document in LO. The text appears horizontal. Reason is, that the text was set to "Rotate all text 0°".

Now save the document without any change to .docx format and open the saved document in Word. Notice, that the text is vertical.

The fix for bug 87924 does not really work. But removing the matrix and the rotation test does not solve the problem, since then the text is vertical because the frame does not has the needed rotation for compensation.

[The matrix is wrong, but works accidentally for 90° and -90° rotations.]

A solution is complicated. I see several ways:
A) Keep "Rotate all text 270°" on import and export. But because the attached frame is not able to rotate but honors writing modes, fake the writing direction on rendering, so that it is looks as if the frame could rotate.
B) Set "Rotate all text 0°" on import and set it back to "Rotate all text 270°" on export by considering the shape rotation on export too.
C) Do not use frames in case the shape is rotated.
D) Implement rotation for text frames at least for multiples of 90°.

My favorite is to use C) as short term solution. That would solve in addition the error, that the text has a wrong position. Solution D) should be used in the long term.
Solution C) would in addition allow to implement a true "upright" in Writer too. Currently the text looks upright because the frame cannot rotate. But saving and opening the saved document in Word shows that "upright" is not handled correctly.
Comment 1 raal 2022-07-23 21:03:20 UTC
Confirm Version: 7.5.0.0.alpha0+ / LibreOffice Community
Build ID: 28daee8a3252e03a67484dc8d3dd26fd73af4826
CPU threads: 4; OS: Linux 5.13; UI render: default; VCL: gtk3
Locale: cs-CZ (cs_CZ.UTF-8); UI: en-US
Calc: threaded