Bug 155285 - Cell anchored callout loses position in save and reload
Summary: Cell anchored callout loses position in save and reload
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.4.0.3 release
Hardware: x86-64 (AMD64) All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard: target:7.6.0
Keywords: implementationError
Depends on:
Blocks: Anchor-and-Text-Wrap
  Show dependency treegraph
 
Reported: 2023-05-13 17:50 UTC by Regina Henschel
Modified: 2024-03-26 07:31 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Callout anchored to page (13.39 KB, application/vnd.oasis.opendocument.spreadsheet)
2023-05-13 17:50 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2023-05-13 17:50:56 UTC
Created attachment 187250 [details]
Callout anchored to page

Load attached document. It has a callout shape in range D7:F9 with a tail tip in B6. Currently the shape is anchored to page.

Change the anchor of the callout to 'To cell (resize with cell)'. You will see the anchor in D7. Save and reload the document. Notice, that the callout is moved so that the tip of the tail is now at the position where the rectangle top/left corner has been before saving.

[The shape has the additional error, that the anchor type has changed to 'To cell' because the anchor end address is not written to file. But that is a not related export problem.]

The wrong position is produced on import in #1311 to #1321 in ScDrawLayer::RecalcPos method in drwlayer.cxx.
https://opengrok.libreoffice.org/xref/core/sc/source/core/data/drwlayer.cxx?r=dfb0d118#1311

That part of the code is correct for AOO, because the object point to which the anchor refers, is the topleft of the bounding box including the tail in AOO. But in LibreOffice that has been changed so that the anchor now refers to the rectangle part of the shape.

Unfortunately, the problem is not solved by simply removing the mentioned part. At a first glance it looks correct on opening. But when you insert a row or column, the tail is separated from the rectangle, because the tail is not adjusted to the new position of the rectangle. The tip of the tail should still point into the cell with content 'text', while the tail basis should be at the rectangle.
Comment 1 Buovjaga 2023-05-17 13:08:07 UTC
Repro

Arch Linux 64-bit, X11
Version: 7.6.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 85a47bbb8340e65a19dc1ceaac768902a771ee77
CPU threads: 8; OS: Linux 6.3; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Built on 17 May 2023
Comment 2 Stéphane Guillou (stragu) 2024-03-26 07:31:27 UTC
Reproduced in 7.4.0.3 and 7.5.9, resolved in 7.6.5.

Fix bibisected with linux-64-7.6 repo to first good build [f47c42c95293d2a888e8fc1ac1aeda33f9d44852] which is:

commit 800f9233513a45aa8f8950cf929fd44cb9381d72
author	Regina Henschel 	Sat May 13 01:36:44 2023 +0200
committer	Regina Henschel 	Thu May 18 14:45:48 2023 +0200
tdf#154821 improve shape export with hidden row/col
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151717

(In reply to Regina Henschel from comment #0)
> [The shape has the additional error, that the anchor type has changed to 'To
> cell' because the anchor end address is not written to file.
This is also resolved.

Thank you Regina!