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.
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.
I think the mishandling in the second slide, may be more of the Opentype 'vert' handling of CJK related to bug 128304
s/bug 128304/bug 128221
(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.
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.)
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.
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.
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