Bug 95730 - Jumping to block margin is broken after selecting cells
Summary: Jumping to block margin is broken after selecting cells
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected)
3.3.0 release
Hardware: All All
: medium minor
Assignee: Not Assigned
Keywords: preBibisect, regression
Depends on:
Blocks: Cell-Selection
  Show dependency treegraph
Reported: 2015-11-10 13:04 UTC by bintoro
Modified: 2023-10-21 18:12 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Note You need to log in before you can comment on or make changes to this bug.
Description bintoro 2015-11-10 13:04:46 UTC
After deleting the contents of an area with a height of n rows, jumping to the next/previous nonempty cell (Cmd-Up/Down) over-/undershoots by n-1 rows, depending on the direction of the selection. The analogous thing happens in the horizontal direction as well.

Steps to reproduce:

1. Enter a value in a cell (e.g., A20).

2. Make a selection above said cell, starting from the same column (e.g., select A1:B5, starting from either A1 or A5).

3. Clear the contents of the cells (hit Delete or Backspace).

4. Attempt to jump down to the next available value (press Cmd-Down).

Expected results: The cursor moves to A20.

Actual results: If the selection was started at A1 end extended downward, the cursor stops at A16. If the selection was started at A5 and extended upward, the cursor overshoots to A24.

Observed in LO and LO on OS X.

Not observed in OO 4.0.1 or OOo 3.3.0.
Comment 1 Buovjaga 2015-11-12 12:02:06 UTC

Win 7 Pro 64-bit Version:
Build ID: b216cc1b8096eb60c27f67e8c27b7cd756c75e38
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2015-11-12_00:06:20
Locale: fi-FI (fi_FI)

Comment 2 QA Administrators 2017-01-03 19:35:37 UTC Comment hidden (obsolete)
Comment 3 bintoro 2017-05-02 17:32:55 UTC
The issue is still present in v5.3.2.2.

While testing the current version, I noticed that my original STR contained a redundant step; clearing the selection is actually not necessary. All that is needed is to make a selection and then jump to a margin (along a dimension of the selection).

* * *

Simplified steps to reproduce:

1. On an empty sheet, make a selection from A20 upward to A15.

2. Jump to the top margin (Cmd-Up on a Mac).

Expected results:

The cursor goes to A1.

Actual results:

The cursor goes to A6.


The cursor movement stops 5 rows short of the target because the selection extends 5 rows towards the target. Conversely, if the selection extends *away* from the target, the final position overshoots instead of stopping short. It's as if the movement delta is incorrectly calculated from the edge of the selection instead of the cursor position.

* * *

There are multiple reports of keyboard navigation bugs that I believe to have the same root cause. It's pretty clearly just a simple arithmetic bug somewhere and should be an easy fix once it's located.

Please let me know if there's any way to help get these bugs fixed. I would gladly have a look at the relevant code if someone pointed out where it resides. Thanks!

AFAIK, the bug has not been present in any version of OpenOffice, but it already appears in the very first version of LibreOffice. Thus, it represents a regression from the shared codebase.
Comment 4 Buovjaga 2017-05-02 17:49:34 UTC
(In reply to ikjt from comment #3)
> Please let me know if there's any way to help get these bugs fixed. I would
> gladly have a look at the relevant code if someone pointed out where it
> resides. Thanks!

Eike: reporter is interested in digging into the code. Can you give pointers?

ikjt: for finding out what is happening: https://wiki.documentfoundation.org/Development/How_to_debug

Btw. if you sometimes want to talk about LibreOffice in Finnish, we have a (pretty quiet) IRC channel #libreoffice-fi @ Freenode network :)
Comment 5 QA Administrators 2018-07-17 02:39:34 UTC Comment hidden (obsolete)
Comment 6 QA Administrators 2020-07-17 03:52:41 UTC Comment hidden (obsolete)
Comment 7 QA Administrators 2022-07-18 03:27:16 UTC Comment hidden (obsolete)
Comment 8 bintoro 2023-10-21 18:12:18 UTC
Bug still present in