Bug 139763 - FILEOPEN XLSX Anchor type of rotated shape changes
Summary: FILEOPEN XLSX Anchor type of rotated shape changes
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.1.0.3 release
Hardware: All All
: medium normal
Assignee: Regina Henschel
URL:
Whiteboard: target:7.2.0 target:7.1.2
Keywords: bibisected, bisected, implementationError
Depends on:
Blocks: XLSX-Shapes
  Show dependency treegraph
 
Reported: 2021-01-19 12:45 UTC by NISZ LibreOffice Team
Modified: 2021-03-03 08:22 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot of the original document side by side in Excel and Calc after changing the row height (96.98 KB, image/png)
2021-01-19 12:45 UTC, NISZ LibreOffice Team
Details
Proposed patch (662 bytes, patch)
2021-02-23 15:36 UTC, Regina Henschel
Details
example with absoluteAnchor (15.08 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2021-02-23 17:00 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description NISZ LibreOffice Team 2021-01-19 12:45:47 UTC
Created attachment 169011 [details]
Screenshot of the original document side by side in Excel and Calc after changing the row height

This is another followup to bug #103050
When this document is opened the left pointing arrow shapes anchoring is incorrect: originally it’s “Move but don’t size with cells’ but it becomes “To cell (resize with cell)” in Calc. This causes the shape to resize if the anchor rows height grows, unlike in Excel.

Steps to reproduce:
    1. Open attachment #127853 [details] in Excel and Calc
    2. In both programs go to the cell A4 and enable Wrap text property of the cell
    3. Write a few words into cell A4

Actual results:
In Excel the row height of row 4 grows, but the shapes size does not change.
In Calc the row height of row 4 grows and the shapes size grows with it.

Expected results:
Shape size does not grow in Calc either. This could be achieved if the anchor type is changed to “To cell” manually.

LibreOffice details:
Version: 7.2.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 2081eac430ac69619149e44b453a2d7dda41fc83
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: en-US (hu_HU); UI: en-US
Calc: CL


Also in 
Version: 6.1.0.3
Build ID: efb621ed25068d70781dc026f7e9c5187a4decd1
CPU threads: 4; OS: Windows 6.3; UI render: default; 
Locale: en-US (hu_HU); Calc: CL

In version:
Version: 6.0.0.3
Build ID: 64a0f66915f38c6217de274f0aa8e15618924765
CPU threads: 4; OS: Windows 6.3; UI render: default; 
Locale: en-US (hu_HU); Calc: CL

There was no “To cell (resize with cell)” option for shapes, only “To cell” which also resized the shape on row height change.

Additional Information: 

Bibisected using bibisect-win32-6.1to:
URL: https://cgit.freedesktop.org/libreoffice/core/commit/?id=acf0bad4e2b8c3c43aaaee8312c8a61d3552fcc2 
author	Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>	2018-02-09 12:52:52 +0100
committer	Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>	2018-03-06 15:45:28 +0100

tdf#114552 Add a third anchor type for calc graphics
Comment 1 Regina Henschel 2021-02-23 15:36:34 UTC
Created attachment 170004 [details]
Proposed patch

The error is likely in ShapeAnchor::importAnchor()

It seems in the first two cases the assignment to meEditAs is missing. That is later used in getEditAs(), which is called in #328 to set bResizeWithCell of the object. I think, the error is unrelated to the rotation.

In case of ShapeAnchor::ANCHOR_ABSOLUTE, #324 to #331 is skipped. Shall I nevertheless add the assignment to meEditAs in that case too? I don't know whether other places exist, that evaluate meEditAs.

I can test it with the mentioned file, which has xdr:oneCellAnchor for the second case. But I have no test file for the first case.

How are those files created in Excel? When I try to create an example file, I always get xdr:twoCellAnchor. Or do you have a file for case XDR_TOKEN( absoluteAnchor ) which I can use for testing?
Comment 2 Regina Henschel 2021-02-23 17:00:15 UTC
Created attachment 170006 [details]
example with absoluteAnchor

The change is needed for the first case, otherwise the default from ctor is used.
The attachment is a manually changed file to use absoluteAnchor.
Comment 3 Commit Notification 2021-02-23 23:40:45 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "master":

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

tdf#139763 set anchor type in meEditAs in all cases

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 4 Commit Notification 2021-03-03 08:22:56 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "libreoffice-7-1":

https://git.libreoffice.org/core/commit/6c86b57a746ab8941ae1c4b0dd1a10c381395eed

tdf#139763 set anchor type in meEditAs in all cases

It will be available in 7.1.2.

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.