Bug 128413 - Writing mode tb-rl is faulty for rotated custom shapes
Summary: Writing mode tb-rl is faulty for rotated custom shapes
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
6.4.0.0.alpha1+
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Regina Henschel
URL:
Whiteboard: target:6.4.0
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-27 12:33 UTC by Regina Henschel
Modified: 2019-11-10 19:30 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
ApplyWritingMode_tb-rl.odp contains a rotated custom shape and a legacy retangle (16.48 KB, application/vnd.oasis.opendocument.presentation)
2019-10-27 12:33 UTC, Regina Henschel
Details
Custom shapes with text in various transformations (15.23 KB, application/vnd.oasis.opendocument.presentation)
2019-10-28 22:10 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2019-10-27 12:33:52 UTC
Created attachment 155339 [details]
ApplyWritingMode_tb-rl.odp contains a rotated custom shape and a legacy retangle

Open attached file.

Go to first slide. It has a rotated custom shape rectangle.
Click into the text. In case the toolbar "Text Formatting" is not shown, open it (menu View -> Toolbars).
This toolbar has an icon for writing mode tb-rl. Click it.
Error: The shape becomes larger and is on a wrong place.

Click on Undo.
Error: The previous state is not reconstructed.

Workaround: First apply the writing mode tb-rl and then rotate the shape.

Go to second slide. It has a legacy rectangle.
Click into the text and then on the icon "Writing mode tb-rl".
Error: The text is no longer inside the shape.
Comment 1 V Stuart Foote 2019-10-27 18:18:12 UTC
Confirmed on Windows 10 Home 64-bit en-US (1903) with
Version: 6.3.2.2 (x64)
Build ID: 98b30e735bda24bc04ab42594c85f7fd8be07b9c
CPU threads: 4; OS: Windows 10.0; UI render: default; VCL: win; 
Locale: en-US (en_US); UI-Language: en-US
Calc: threaded

The change resizes and repositions the Draw frame for the Text object unexpectantly.

Looking at the ODP in MS Powerpoint 2016 there is more direct control over behavior of the drawing frame relative to the text rotation and orientation.
Comment 2 V Stuart Foote 2019-10-27 18:25:58 UTC
I think the mishandling in the second slide, may be more of the Opentype 'vert' handling of CJK related to bug 128304
Comment 3 V Stuart Foote 2019-10-27 18:28:13 UTC
s/bug 128304/bug 128221
Comment 4 Regina Henschel 2019-10-28 13:17:51 UTC
(In reply to V Stuart Foote from comment #2)
> I think the mishandling in the second slide, may be more of the Opentype
> 'vert' handling of CJK related to bug 128304

The cases are indeed different. The fix needed for custom shapes works only for custom shapes.

The problem for the rectangle is not the single CJK character (that has correct orientation) put the position of the entire text block.

I have removed 'rectangle' from the subject.
Comment 5 Regina Henschel 2019-10-28 22:10:15 UTC
Created attachment 155377 [details]
Custom shapes with text in various transformations

A similar problem exists with undo/redo.
The problem exist too with the command "Autofit Text".

Customize your UI, so that you have access to the command "Autofit Text".
Open attached document.
Apply "Autofit Text" to a shape. Then do Undo and Redo. Notice, that the shape size is changed in case the shape has a transformation.

(The shape on slide 1 is the original shape, without any transformation. That one should work.)
Comment 6 Regina Henschel 2019-11-07 13:01:50 UTC
The problem is caused by the method SdrObjCustomShape::SetSnapRect, which currently treats the passed rectangle as logic rectangle and not as snap rectangle. After some math it turns out, that it is not possible to transform the shape to a passed rectangle and keep rotation and shear angle at the same time. Therefore a common fix by changing SdrObjCustomShape::SetSnapRect is not possible. Instead each user of SetSnapRect needs an own fix. I will use this bug report for SdrObjCustomShape::SetVerticalWriting and write a new bug report for undo/redo.
Comment 7 Commit Notification 2019-11-08 14:26:46 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/9b2a94321e3a05364064cb60dafc1d1b69eece56

tdf#128413 SetSnapRect of custom shapes expects logic rect

It will be available in 6.4.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 Regina Henschel 2019-11-10 19:30:11 UTC
Fix is available in Version: 6.4.0.0.alpha1+ (x64)
Build ID: d456ca6efb98d707427228e8131dfe8a5f27e2f6
CPU threads: 8; OS: Windows 10.0 Build 18362; UI render: default; VCL: win; 
Locale: de-DE (en_US); UI-Language: en-US
Calc: threaded