Bug 123762 - EDITING Calc: Anchored objects are not effected by delete row/cell
Summary: EDITING Calc: Anchored objects are not effected by delete row/cell
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Ilhan Yesil
URL:
Whiteboard: target:6.3.0
Keywords:
Depends on:
Blocks:
 
Reported: 2019-02-28 11:39 UTC by Ilhan Yesil
Modified: 2019-05-15 07:05 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Calc document with two checkboxes (8.65 KB, application/vnd.oasis.opendocument.spreadsheet)
2019-02-28 11:40 UTC, Ilhan Yesil
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ilhan Yesil 2019-02-28 11:39:22 UTC
Description:
An object is anchored to a cell. If this cell or the row containing this cell is deleted, the object is anchored to the cell below. 

Steps to Reproduce:
1. Open attached document
2. Select first row
3. Right click -> select "Delete Rows" in popup menu

Actual Results:
The first row has now two checkboxes anchored to cell B1

Expected Results:
I would expect, that objects that are anchored to a cell, are deleted together with that cell. Intuitively I would say that rows with checkboxes as in this example indicates a choice that belongs to this row and not the next. 


Reproducible: Always


User Profile Reset: No



Additional Info:
Workaround would be, that I select "Clear Contents" or press the backspace key, where in a popup dialog I can decide what to delete. So, I'm not sure if this is really a bug. There is a similarly bug: 122982.
Comment 1 Ilhan Yesil 2019-02-28 11:40:20 UTC
Created attachment 149654 [details]
Calc document with two checkboxes
Comment 2 Oliver Brinzing 2019-02-28 18:09:29 UTC
reproducible with:

Version: 5.4.7.2 (x64)
Build-ID: c838ef25c16710f8838b1faec480ebba495259d0
CPU-Threads: 4; BS: Windows 6.19; UI-Render: Standard; 
Gebietsschema: de-DE (de_DE); Calc: single

Version: 6.1.5.2 (x64)
Build ID: 90f8dcf33c87b3705e78202e3df5142b201bd805
CPU threads: 4; OS: Windows 10.0; UI render: default; 
Locale: de-DE (de_DE); Calc: 

and even with AOO 4.1.5
Comment 3 Eike Rathke 2019-03-29 19:54:57 UTC
Expectations may vary. For clarification: I would never expect that a drawing object is deleted just because I clear a cell. I could expect that if I entirely delete a column or row, but not when clearing a single cell or range of cells without removing those cells.
Comment 4 Luke 2019-04-03 21:53:35 UTC Comment hidden (obsolete)
Comment 5 Ilhan Yesil 2019-04-04 07:24:11 UTC
I only mention delete operations on anchored objects, not clear operations. In my attached example, I think the user would be irretated, if he delete a row with an anchored object and has then two anchored objects in the next row. He has to delete the anchored object manually, but as there are two objects in the cell, he must find the right one.
Comment 6 Luke 2019-04-05 17:50:29 UTC
My previous comment appears incorrect. Delete cell and row is not the correct command here. I tested the objects comparing the behavior of Calc, Excel, and WPS Sheets. All 3 behaved the same way. Deleting a row, column, or cell did NOT remove form, image, nor shape objects. 

If you want to remove objects, you need to use the "clear contents" command. If you want to move them, cutting and pasting works. 
So, unless I'm missing something, it appears that this bug report is invalid and we should not change the behavior. The correct procedure to achieve your expected results is:

1. Open attached document
2. Select first row
3. Right click -> select "Clear Contents" in popup menu

This achieves your Expected Results.
Comment 7 Eike Rathke 2019-04-08 11:22:46 UTC
(In reply to Luke from comment #6)
> My previous comment appears incorrect. Delete cell and row is not the
> correct command here. I tested the objects comparing the behavior of Calc,
> Excel, and WPS Sheets. All 3 behaved the same way. Deleting a row, column,
> or cell did NOT remove form, image, nor shape objects. 
Was that for anchored to cell, or anchored to page, or both?
Comment 8 Luke 2019-05-10 23:04:44 UTC Comment hidden (obsolete)
Comment 9 Luke 2019-05-12 16:15:57 UTC
(In reply to Eike Rathke from comment #7)
> Was that for anchored to cell, or anchored to page, or both?

Both. You can try a simple example like attachment 140404 [details] in Excel.

With anchor to cell and anchor to page, deleting the cell, row, column, or entire worksheet does not delete the objects themselves. The objects anchored to the cell are not deleted, but they are shifted when their anchors are removed. 

Only if the object is anchored "move + size" will it be deleted by right clicking and selecting delete. However, it will not be deleted by pressing Delete (DEL) on the keyboard when the cell that contains it is selected.
Comment 10 Commit Notification 2019-05-14 22:08:27 UTC
Ilhan Yesil committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/d2fa9c0d657877c967e41fdd0091f81d1b7ca048%5E%21

tdf#123762 Cell anchored object is deleted if cell is deleted

It will be available in 6.3.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.