Bug 137576 - Measure line anchored "To cell (resize with cell)" is distorted after reopening
Summary: Measure line anchored "To cell (resize with cell)" is distorted after reopening
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.1.0.3 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.2.0 target:7.1.0.0.beta2
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-18 12:01 UTC by Regina Henschel
Modified: 2020-12-03 23:09 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2020-10-18 12:01:08 UTC
Start Calc. Enter a diagonal or vertical measure line and anchor them "To cell (resize with cell)". Save and reopen the file. Notice, that the measure lines have lost their original orientation.
Comment 1 m.a.riosv 2020-10-19 17:52:06 UTC
Confirmed
Version: 7.1.0.0.alpha0+ (x64)
Build ID: df74aef7159d7155addf78cfc4d139485945d794
CPU threads: 4; OS: Windows 10.0 Build 20180; UI render: Skia/Vulkan; VCL: win
Locale: es-ES (es_ES); UI: en-US Calc: CL
Comment 2 Regina Henschel 2020-10-31 16:54:02 UTC
Some work has be done in https://cgit.freedesktop.org/libreoffice/core/commit/?id=1f0b3c7a40edfa81bbc7a58d123a6a2dfd83e4ca

To complete the fix, measure line object needs own SetSnapRect and SetLogicRect methods. Currently it uses those from the text object, which does not know start and end points of the measure line object.
Comment 3 Regina Henschel 2020-11-15 18:23:28 UTC
It seems TRSetBaseGeometry and TRGetBaseGeometry are wrong. To work similar as for path objects (as intended), the second parameter has to be used. In the current version of TRSetBaseGeometry the matrix is applied to a unit line from (0|0) to (1|0). But the matrix which is generated by TRGetBaseGeometry contains only scale and translate. Thus a chain with TRGetBaseGeometry followed by TRSetBaseGeometry does not work. It will always end up in a horizontal line.
Comment 4 Commit Notification 2020-12-02 18:07:29 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "master":

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

tdf#137576 Improve cell anchored measure line in Calc

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 5 Regina Henschel 2020-12-02 18:45:03 UTC
Use of TRSetBaseGeometry and TRGetBaseGeometry has already been replaced with "Move" in commit bba0cd79984875124f8d43d05d4cdb7f63517e77.

Instead of a new "SetLogicRectangle" method the already existing TakeUnrotatedSnapRect is used in commit d0921aa753c43600272865602df3c7c2a8f13196 

The problem should be fixed now.
Comment 6 Commit Notification 2020-12-03 09:18:45 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "libreoffice-7-1":

https://git.libreoffice.org/core/commit/9706790b1e4d34d0fac5eb10a51770f9d62f802c

tdf#137576 Improve cell anchored measure line in Calc

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.