Bug 138945

Summary: Setting width of rotated custom shape results in wrong rotation angle
Product: LibreOffice Reporter: Regina Henschel <rb.henschel>
Component: DrawAssignee: Regina Henschel <rb.henschel>
Status: VERIFIED FIXED    
Severity: normal CC: xiscofauli
Priority: medium    
Version: Inherited From OOo   
Hardware: x86-64 (AMD64)   
OS: Windows (All)   
Whiteboard: target:7.2.0 target:7.1.0.0.beta2
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 137033    
Attachments: file with custom shape (blue) and legacy rectangle (red)

Description Regina Henschel 2020-12-15 15:42:45 UTC
Created attachment 168196 [details]
file with custom shape (blue) and legacy rectangle (red)

Open attached document. It contains a custom shape (blue fill) and legacy rectangle (red). Both were original at position (45mm|40mm) and have size 70mm x 40mm. The they got a shear with 45° shear angle and after that a rotation with 330° rotation angle in dialog "Position&Size".

Mark the custom shape. Open "Position&Size" dialog. Make sure "Keep ratio" is not checked. Set width of the object to 200mm with base point left/top.

Mark the legacy rectangle and do the same.

Notice, the legacy rectangle is correctly stretched in horizontal direction. The custom shape is stretched too, but has got a wrong rotation.

If you mark the custom shape, you will notice, that its handles do not match the outline of the shape. It is not a pur rendering problem, the wrong shape geometry is saved to file.

I suspect, that the error is, that the member fObjectRotation is not updated to the changed rotation angle in SdrObjCustomShape::NbcResize.

The error is very old, but I have not found a bug report. It might have not been detected yet, because drag-resize at the corner of a custom shape always uses "keep ratio". So it can only be reproduced in the UI, when using the dialog.

This bug prevents fixing bug 137033.
Comment 1 Commit Notification 2020-12-16 13:00:26 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/d4ca360f6632f03e9fb7e9af37aac40d23f1249a

tdf#138945 update fObjectRotation for NbcResize

It will be available in 7.2.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 2 Xisco Faulí 2020-12-17 10:16:32 UTC
Verified in

Version: 7.2.0.0.alpha0+
Build ID: d00e7c651e80b9fd3d00262900e0938e2c392809
CPU threads: 4; OS: Linux 5.7; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

@Regina, thanks for fixing this issue!!
Comment 3 Commit Notification 2020-12-17 10:16:58 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "libreoffice-7-1":

https://git.libreoffice.org/core/commit/c6bc280fa986bac1b62726a4a19fd0be1c735fc0

tdf#138945 update fObjectRotation for NbcResize

It will be available in 7.1.0.0.beta2.

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.