Bug 161274 - Selection lost when moving paragraphs with Shift + Alt + Down (.uno:MoveDown) when recording track changes; erroneous tracked move recorded
Summary: Selection lost when moving paragraphs with Shift + Alt + Down (.uno:MoveDown)...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.3.0.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Track-Changes Selection
  Show dependency treegraph
 
Reported: 2024-05-25 15:40 UTC by Marcin Segit
Modified: 2024-06-25 16:07 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshots (608.27 KB, image/jpeg)
2024-05-25 15:41 UTC, Marcin Segit
Details
Screenshots (587.95 KB, image/jpeg)
2024-05-25 15:41 UTC, Marcin Segit
Details
Screenshots (614.28 KB, image/jpeg)
2024-05-25 15:41 UTC, Marcin Segit
Details
Screenshots (612.65 KB, image/jpeg)
2024-05-25 15:41 UTC, Marcin Segit
Details
Screenshots (617.54 KB, image/jpeg)
2024-05-25 15:41 UTC, Marcin Segit
Details
Screenshots (625.68 KB, image/jpeg)
2024-05-25 15:42 UTC, Marcin Segit
Details
Sample text case odt (41.95 KB, application/vnd.oasis.opendocument.text)
2024-06-25 11:26 UTC, Marcin Segit
Details
Screen recording (6.38 MB, video/mp4)
2024-06-25 11:27 UTC, Marcin Segit
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marcin Segit 2024-05-25 15:40:30 UTC
Description:
Hard to describe, but I'll try.
When I'm moving two paragraphs of text with changes tracking turned on, a longer one and a shorter one, that shorter one gets detached from the selection. Also, another paragraph gets marked as changed while it should not.
Attaching screenshots in a sequence.

Steps to Reproduce:
1. Prepare test case. There should be at least four paragraphs, three longer and a shorter one. One longer and one shorter paragraph should be pasted into text between other paragraphs after tracking changes has been turned on.
2. Select one long paragraph and one short paragraph together.
3. Move selected paragraphs down a couple of times with Left Alt+Control+down arrow.

Addition: When trying to revert changes with Control+Z, there is additional mess as paragraph marked as changed does not revert to unchanged state and the paragraph that was shifted down becomes marked as not changed at some point.

Actual Results:
Selected text is shifted down but the shorter paragraph gets detached. Also, the paragraph not selected the moved text is going through gets marked as changed.

Expected Results:
Selected text is shifted down complete - both paragraphs - and only them are marked as changed (moved from... to). Control+Z reverts all changes to the initial state.


Reproducible: Always


User Profile Reset: Yes

Additional Info:
Version: 24.2.3.2 (X86_64) / LibreOffice Community
Build ID: 433d9c2ded56988e8a90e6b2e771ee4e6a5ab2ba
CPU threads: 16; OS: Windows 10.0 Build 19045; UI render: Skia/Raster; VCL: win
Locale: pl-PL (pl_PL); UI: en-US
Calc: CL threaded
Comment 1 Marcin Segit 2024-05-25 15:41:18 UTC
Created attachment 194348 [details]
Screenshots
Comment 2 Marcin Segit 2024-05-25 15:41:34 UTC
Created attachment 194349 [details]
Screenshots
Comment 3 Marcin Segit 2024-05-25 15:41:42 UTC
Created attachment 194350 [details]
Screenshots
Comment 4 Marcin Segit 2024-05-25 15:41:49 UTC
Created attachment 194351 [details]
Screenshots
Comment 5 Marcin Segit 2024-05-25 15:41:57 UTC
Created attachment 194352 [details]
Screenshots
Comment 6 Marcin Segit 2024-05-25 15:42:04 UTC
Created attachment 194353 [details]
Screenshots
Comment 7 Stéphane Guillou (stragu) 2024-06-11 13:03:15 UTC
I could not reproduce with a document created from scratch.
The second use of Alt + Shift + Down only moves the large paragraph because the two-paragraph selection is not active anymore. So for that steps, it makes sense that only the large paragraph is sent down (i.e. the paragraph in which the cursor is located).

Can you please attach as sample file for others to test in the same conditions?

Version: 24.2.3.2 (X86_64) / LibreOffice Community
Build ID: 433d9c2ded56988e8a90e6b2e771ee4e6a5ab2ba
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
Comment 8 Marcin Segit 2024-06-25 11:26:09 UTC
I'm uploading a simple test case and a recording which might better the problem in a better way than I'm able to describe it.
What I do not get is:
- Why two-paragraph selection is dropped after the first move down (I get that this is intentional but counterintuitive as one might need to move paragraphs further down)
- Why yet another whole paragraph is marked as changed (inserted, to be precise) - this should not happen as might lead to accidental loss of text (it happened to me a couple of times when I hit "reject change" on such occurrence).
Comment 9 Marcin Segit 2024-06-25 11:26:35 UTC
Created attachment 194946 [details]
Sample text case odt
Comment 10 Marcin Segit 2024-06-25 11:27:04 UTC
Created attachment 194947 [details]
Screen recording
Comment 11 Marcin Segit 2024-06-25 12:28:59 UTC
(In reply to Marcin Segit from comment #8)
> I'm uploading a simple test case and a recording which might better the
> problem in a better way than I'm able to describe it.
> What I do not get is:
> - Why two-paragraph selection is dropped after the first move down (I get
> that this is intentional but counterintuitive as one might need to move
> paragraphs further down)
> - Why yet another whole paragraph is marked as changed (inserted, to be
> precise) - this should not happen as might lead to accidental loss of text
> (it happened to me a couple of times when I hit "reject change" on such
> occurrence).

To add to that, with the tracking changes turned off the behavior is as I would expect: two-paragraph selection is not dropped and I can move two (or more) paragraph up and down without issues. Apparently change history tracking has some impact here.
Comment 12 Stéphane Guillou (stragu) 2024-06-25 16:07:09 UTC
(In reply to Marcin Segit from comment #11)
> To add to that, with the tracking changes turned off the behavior is as I
> would expect: two-paragraph selection is not dropped and I can move two (or
> more) paragraph up and down without issues. Apparently change history
> tracking has some impact here.
Ah, indeed! I can now see it's a bug.

I can reproduce in:

Version: 24.8.0.0.beta1+ (X86_64) / LibreOffice Community
Build ID: 1b61abc4451d38984338b750d85770ec9871060a
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 70b3e128aef631e18e6451362c2e6315c28b857e
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3

... and in 7.3.0.3 when moves started being tracked in green colour.

Steps:
1. Open attachment 194946 [details]
2. Select paragraphs 3 and 4
3. Alt + Shift + Down (twice)
4. Undo everything

Results:

A. Selection lost after Alt + Shift + Arrow when Record Track Changes is on
B. On the second Alt + Shit + Down, the "Vestibulum" paragraph is coloured in green even though it was not moved
C. Undoing everything results in that erroneous move of "Vestibulum" still being displayed

Issue (A) has been around for a while, (B) and (C) started in 7.3.

László, I thought you might be interested?