Bug 150417 - Undo puts cursor inside comment box if track changes record being enabled and show changes OFF
Summary: Undo puts cursor inside comment box if track changes record being enabled and...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.2.0.3 release
Hardware: All All
: lowest minor
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected
Depends on:
Blocks: redlinehide-regressions
  Show dependency treegraph
 
Reported: 2022-08-15 09:59 UTC by Telesto
Modified: 2023-10-15 01:38 UTC (History)
6 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 Telesto 2022-08-15 09:59:26 UTC
Description:
Redo puts cursor inside comment box if track changes record being enabled and show changes OFF

Steps to Reproduce:
1. Open attachment 173161 [details]
2. Place cursor after X
3. Press Backspace 2x
4. Press CTRL+Z (2x)
5. Press arrow left/right (cursor inside comment box)

Actual Results:
Cursor inside comment box in the consternation of show changes ON, Track changes Record ON

Expected Results:
Same as the cases with Show Changes OFF or Record disabled


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.5.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 86b2bfd34a4f07c54f03c8c8dfe48e0810834628
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL
Comment 1 Telesto 2022-08-15 10:03:48 UTC Comment hidden (no-value)
Comment 2 Dieter 2022-08-30 06:22:42 UTC
I confirm it with

Version: 7.5.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 4c96abd81460977d413d4d28e891bbbac5769ede
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL

Additional inforations
As far as I can see it only depends on record changes on
Comment 3 BogdanB 2023-10-08 16:49:34 UTC Comment hidden (obsolete)
Comment 4 Telesto 2023-10-08 18:42:48 UTC Comment hidden (obsolete)
Comment 5 BogdanB 2023-10-09 04:51:38 UTC Comment hidden (obsolete)
Comment 6 Stéphane Guillou (stragu) 2023-10-09 06:51:57 UTC Comment hidden (obsolete)
Comment 7 Justin L 2023-10-13 16:26:18 UTC
The problem here is that after the undo, the cursor has moved out of the text body, and into the comment.

Comment 3's bibisect result is not correct. The difference is that prior to my fix, you couldn't (easily) get the cursor behind the comment. So your first backspace was deleting the x, not the comment, and the second backspace did nothing.

The original steps to reproduce are overly complicated. Only a single backspace is necessary - the backspace that deleted the comment (and therefore only one undo).

Steps to reproduce:
-place the cursor after the x
-press backspace (which deletes the comment)
-press Ctrl-Z (to undo - the comment returns and the cursor is now in the comment)

Prior to my commit, use DEL instead of BACKSPACE to get the same result.

The cursor change is coming because the comment display "area" is appearing and disappearing (but of course not going away when track changes is showing - in that case the comment stays, but is crossed out).

The disappearing/reappearing comment area started in LO 6.3 (backported to 6.2.0) with commit 32902f66e7749b2d06d13f50416be5323a0c0ea9
Author: Michael Stahl on Fri Nov 30 17:54:41 2018 +0100
    sw_redlinehide: make layout based Show/Hide mode the default

Adding CC to: Michael Stahl
Comment 8 Justin L 2023-10-13 16:47:10 UTC
bisecting in LO 6.2 with experimental mode turned on points to the commit that hides the comment margin when the comment is deleted.

commit 683fd2d5726d0511a94681e5438b3c080b81cbba
Author: Michael Stahl on Wed Dec 5 15:24:55 2018 +0100
    sw_redlinehide_4b: consider the comments in the margin

I assume what is happening is that normally the comment margin shows up when the first comment is created, so it is assumed that the cursor should be placed inside the comment. (Indeed, if we add a second comment to the provided bug document, the cursor is not moved when following the steps to reproduce.)
Comment 9 Justin L 2023-10-13 16:52:03 UTC
(In reply to Justin L from comment #8)
> I assume what is happening is that normally the comment margin shows up when
> the first comment is created, so it is assumed that the cursor should be
> placed inside the comment.
Indeed, the same behaviour is seen when turning off View - Comments, and then turning them back on.
Comment 10 Justin L 2023-10-13 17:24:08 UTC
Calling this a regression is not really appropriate. It is a consequence...