Bug 168816 - editing: undo of a cell move causes selection to jump by one
Summary: editing: undo of a cell move causes selection to jump by one
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.5.0 release
Hardware: All All
: medium minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Undo-Redo
  Show dependency treegraph
 
Reported: 2025-10-11 21:29 UTC by casa
Modified: 2025-11-09 16:02 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description casa 2025-10-11 21:29:32 UTC
Description:
Selecting or moving one or more cells in Calc and then undoing action will cause the cell selection to move lower (or to the right) by one cell.

Steps to Reproduce:
REPRODUCTION:
On a spreadsheet make a 3x3 block of filled cells. I just put one letter or number in each cell like this:

a 1 x
b 2 y
c 3 z

Now select cells "b 2 y".
Click-hold-drag the selection (while holding ALT) one row higher and drop.
This will put "b 2 y" at top and swap it with row "a 1 x" which is now in the middle:
b 2 y
a 1 x
c 3 z
(b 2 y will be selected)

Now press ctrl-z to undo.

"b 2 y" will move back down to the middle (properly), but the cell selection will jump down by one and now "c 3 z" cells are selected.
BUG/EXPECTED: "b 2 y" should be selected instead.

This same bug will happen if you vertically select "1 2 3" and drag-drop(with ALT) to the left resulting in:
1 a x
2 b y
3 c z
(1 2 3 will be selected)

When you undo this action 1 2 3 will move back to the middle, but the selected cells will jump right by one to "x y z".
BUG/EXPECTED: the selection should be on "1 2 3" cells after undo.

NOTE: that this bug does not exist if you move(alt swap) cells DOWN or RIGHT and then undo them.  Only if you move cells UP or LEFT and then undo will the selected cells jump off by one.

NOTE: this problem happens with single cell moves(alt drag/swaps), but I made the examples above have multiple cells because selecting single cells and then drag-dropping them requires an additional step/trick to get a cell 'dragable' (you have to click a single cell, then click it again while holding CTRL so it colors in and then you can alt-drag-swap it)


Actual Results:
.

Expected Results:
.


Reproducible: Always


User Profile Reset: No

Additional Info:
.
Comment 1 Sarah Lim 2025-11-05 07:40:26 UTC
Reproducible 

Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 620(Build:0)
CPU threads: 12; OS: Windows 11 X86_64 (build 26100); UI render: Skia/Raster; VCL: win
Locale: en-US (en_FI); UI: en-GB
Calc: threaded
Comment 2 Buovjaga 2025-11-09 16:02:00 UTC
Repro already in oldest of Linux 43all bibisect repo.