Bug 152635 - Image anchored to cell jump around when sorting + autofilter
Summary: Image anchored to cell jump around when sorting + autofilter
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected) release
Hardware: All All
: medium normal
Assignee: Not Assigned
Whiteboard: target:24.8.0 target:24.2.4
Keywords: bibisected, bisected, implementationError
Depends on:
Blocks: Anchor-and-Text-Wrap AutoFilter Sorting
  Show dependency treegraph
Reported: 2022-12-21 12:23 UTC by stephan.leineweber
Modified: 2024-05-07 13:01 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:

Seasonal Calendar for visualising the bug yourself (237.97 KB, text/plain)
2022-12-21 12:25 UTC, stephan.leineweber
Another try to attach it as ods (237.97 KB, application/vnd.oasis.opendocument.spreadsheet)
2022-12-21 12:28 UTC, stephan.leineweber

Note You need to log in before you can comment on or make changes to this bug.
Description stephan.leineweber 2022-12-21 12:23:15 UTC
In a table there is a row with images, all anchored to cell. When I hide some rows with autofilter and sort at the same time with autofilter, it screws up the position of the images.

Steps to Reproduce:
1. Create a table with some columns and values (Numbers, words,...)
2. Insert images in one column, so that each row has an image anchored to the cell
3. Click Autofilter and hide certain rows
4. Sort them (e.g. descending) at the same time

Actual Results:
The position of the images is messed up

Expected Results:
The images should still have the correct position in the cell/row where they belong to 

Reproducible: Always

User Profile Reset: No

Additional Info:
See the attachment for experiencing the bug oneself.

Version: / LibreOffice Community
Build ID: 1048a8393ae2eeec98dff31b5c133c5f1d08b890
CPU threads: 4; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-GB (en_GB.UTF-8); UI: en-GB
Calc: threaded
Comment 1 stephan.leineweber 2022-12-21 12:25:20 UTC Comment hidden (obsolete)
Comment 2 stephan.leineweber 2022-12-21 12:28:16 UTC
Created attachment 184294 [details]
Another try to attach it as ods
Comment 3 m_a_riosv 2022-12-21 14:35:32 UTC Comment hidden (obsolete)
Comment 4 Telesto 2024-03-24 20:39:27 UTC Comment hidden (obsolete)
Comment 5 Stéphane Guillou (stragu) 2024-03-25 12:33:57 UTC
Using steps:
1. Open attachment 184294 [details]
2. Filter column "Januar" for value "2"
3. Sort column "Name" in descending order

Some changes in 6.1:

- in 6.0, pictures don't move when sorting.

- linux-64-6.1, build [cc1980c9609c44386fdf6a1deb301fdbe4662a91], commit 3a2a430ae8e2c1647c18d8904477949f6e2e7941: images moved when sorting, but don't end up in the correct row.

commit 3a2a430ae8e2c1647c18d8904477949f6e2e7941
author	Samuel Mehrbrodt 	Wed Dec 20 11:30:36 2017 +0100
committer	Eike Rathke 	Tue Jan 23 00:46:19 2018 +0100
tdf#98931 Consider cell-anchored images when sorting
Reviewed-on: https://gerrit.libreoffice.org/46838

- linux-64-6.1, build [a25fe0dc4460c3dec74d8590c036c6892b95bd06], commit 4f29ce6a67b81e7f28e1c86d60ff15ec1d180661: many images end up underneath the sorted rows.

commit 4f29ce6a67b81e7f28e1c86d60ff15ec1d180661
author	Samuel Mehrbrodt 	Tue Feb 27 16:56:44 2018 +0100
committer	Eike Rathke 	Tue Mar 13 00:23:40 2018 +0100
tdf#114552 Improve image scaling in Calc
Reviewed-on: https://gerrit.libreoffice.org/50451

Still the case in:

Version: (X86_64) / LibreOffice Community
Build ID: 53c5d570cab036b23f4969b858a648c8f0c24f93
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: CL threaded

I think we should keep this separate from bug 147420.

Samuel, can you please have a look?
Comment 6 Stéphane Guillou (stragu) 2024-05-07 13:01:06 UTC
Fixed by Regina with:

tdf#160329 update objects after row sort is finished
It will be available in 24.8.0.

tdf#160329 update objects after row sort is finished
It will be available in 24.2.4.

I checked with linux-64-24.8 bibisect repo at corresponding build [921f5f782a764a4b51f12b95986f16f6278333e8].
Thanks Regina!