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.
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
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.
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.
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.
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.
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.
The patch had two errors. They are fixed with commits https://git.libreoffice.org/core/+/520a2819fa6030ec11175d82dd42cfcdb2e92634%5E! and https://git.libreoffice.org/core/+/60ae45f5846f69857c46b74d153fea1ef14d3c4d%5E!