Bug 133957 - Deleting a paragraph with backspace deletes the image (instead of moving up)
Summary: Deleting a paragraph with backspace deletes the image (instead of moving up)
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.4.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.1.0 target:7.0.0.1 target:6.4.6
Keywords: bibisected, bisected, regression
: 133952 (view as bug list)
Depends on:
Blocks: Anchor-and-Text-Wrap
  Show dependency treegraph
 
Reported: 2020-06-13 11:30 UTC by Telesto
Modified: 2021-03-29 16:59 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file (672.87 KB, application/vnd.oasis.opendocument.text)
2020-06-13 11:31 UTC, Telesto
Details
Writer doc. showing an issue withthe behaviour of paragraph-anchored imaghes (672.95 KB, application/vnd.oasis.opendocument.text)
2020-06-14 16:15 UTC, R. Green
Details
Example file (13.52 KB, application/vnd.oasis.opendocument.text)
2020-06-14 17:08 UTC, Telesto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2020-06-13 11:30:59 UTC
Description:
Deleting a paragraph with backspace deletes the image (instead of moving up)

Steps to Reproduce:
1. Open the attached file
2. Click on the second line
3. Press backspace -> Image gone
4. Undo 
5. Go to the top paragraph & press delete.. image gone

Actual Results:
Image gone

Expected Results:
Moved up, not deleted by backspace


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.1.0.0.alpha0+ (x86)
Build ID: 26483950760f0aac7bc45e93db4127f66a98fdc6
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 2020-06-13 11:31:15 UTC
Created attachment 161947 [details]
Example file
Comment 2 BogdanB 2020-06-13 19:18:04 UTC
Confirm it with:
Version: 7.1.0.0.alpha0+
Build ID: cd47dba9aa4b91bb0edf0744561d29e2eef61cc9
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2020-06-11_19:46:20
Calc: threaded
Comment 3 R. Green 2020-06-14 16:15:49 UTC
Created attachment 161991 [details]
Writer doc. showing an issue withthe  behaviour of paragraph-anchored imaghes

Version: 6.4.4.2 (x64)
Build ID: 3d775be2011f3886db32dfd395a6a6d1ca2630ff
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: default; VCL: win; 
Locale: en-GB (en_GB); UI-Language: en-GB
Calc: threaded

A similar problem:

1. Open the attached file. The image has been anchored to a blank paragraph.
2. Place the cursor at the start of the paragraph (where the image is anchored). Now add the text "abc" (for example).
3. Use the arrow keys to move the cursor before the "a". Use Shift + arrow, one press at a time.

EXPECTED RESULT: When all three letters have been selected, the image should NOT be selected.
ACTUAL RESULT: When all three letters are selected, the image is automatically selected as well.

This is clearly anomalous because the image was able to exist on its own in the paragraph prior to the addition of the letters, whereas once the letters are added the image will be automatically deleted with the text.

The user might expect that if ONLY the text is deleted, then the image, or frame, should remain.

Reminds me of the problem in Bug 131331 (If you select paragraph in the header, selection includes a frame, that is anchored to that paragraph).
Comment 4 Telesto 2020-06-14 17:08:38 UTC
Created attachment 161993 [details]
Example file

A variant
Comment 5 Michael Stahl (allotropia) 2020-06-15 09:54:03 UTC
(In reply to Telesto from comment #0)
> Description:
> Deleting a paragraph with backspace deletes the image (instead of moving up)
> 
> Steps to Reproduce:
> 1. Open the attached file
> 2. Click on the second line
> 3. Press backspace -> Image gone
> 4. Undo 
> 5. Go to the top paragraph & press delete.. image gone
> 
> Actual Results:
> Image gone
> 
> Expected Results:
> Moved up, not deleted by backspace

this is because with only 2 empty paragraph in the section, the selection created by Backspace or Delete key will be indistinguishable from one created by "select all". not sure how to fix that.
Comment 6 Xisco Faulí 2020-06-15 11:44:33 UTC
Regression introduced by:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=e75dd1fc992f168f24d66595265a978071cdd277

author	Michael Stahl <Michael.Stahl@cib.de>	2019-12-05 16:49:33 +0100
committer	Michael Stahl <michael.stahl@cib.de>	2019-12-06 14:44:42 +0100
commit	e75dd1fc992f168f24d66595265a978071cdd277 (patch)
tree	1e1870aac20c62254eb5b3b0f64711ea74730d54
parent	35191846feb19751e247cd228d7dcc6ddfdf2c8b (diff)
tdf#121300 sw: consistent fly at-pargraph selection

Bisected with: bibisect-linux64-6.4

Adding Cc: to Michael Stahl
Comment 7 Michael Stahl (allotropia) 2020-06-15 13:10:26 UTC
(In reply to R. Green from comment #3)
> 
> 1. Open the attached file. The image has been anchored to a blank paragraph.
> 2. Place the cursor at the start of the paragraph (where the image is
> anchored). Now add the text "abc" (for example).
> 3. Use the arrow keys to move the cursor before the "a". Use Shift + arrow,
> one press at a time.
> 
> EXPECTED RESULT: When all three letters have been selected, the image should
> NOT be selected.
> ACTUAL RESULT: When all three letters are selected, the image is
> automatically selected as well.
> 
> This is clearly anomalous because the image was able to exist on its own in
> the paragraph prior to the addition of the letters, whereas once the letters
> are added the image will be automatically deleted with the text.

https://bugs.documentfoundation.org/show_bug.cgi?id=132321#c16
is a similar scenario.

i agree that this is inconsistent, but i think the way it should work is that if the entire section is selected, then all flys anchored in it are selected - even if the section doesn't contain any text, which is a special case that could be short-cut to do nothing previously.

these commits implement this:

https://gerrit.libreoffice.org/c/core/+/96324
https://gerrit.libreoffice.org/c/core/+/96350/
Comment 8 Commit Notification 2020-06-15 13:56:11 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/b314735568c1e9ab8ca52413017425bc2ef12973

tdf#132321 tdf#133957 sw: for at-para fly, ignore anchor SwIndex

It will be available in 7.1.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.
Comment 9 Commit Notification 2020-06-15 13:59:59 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2d89b9929e85bede4c72684a12e7508751875f0e

tdf#133957 sw: SelectAll should select fly in empty section

It will be available in 7.1.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.
Comment 10 Xisco Faulí 2020-06-15 15:52:01 UTC
*** Bug 133952 has been marked as a duplicate of this bug. ***
Comment 11 Commit Notification 2020-06-16 10:12:20 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/eb6290410e699841b805ef75df393d72bf50baaa

tdf#132321 tdf#133957 sw: for at-para fly, ignore anchor SwIndex

It will be available in 7.0.0.1.

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.
Comment 12 Commit Notification 2020-06-16 10:12:29 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-6-4":

https://git.libreoffice.org/core/commit/89dc2b547b4cc307f7d69715a5e1ed4a27691755

tdf#133957 sw: SelectAll should select fly in empty section

It will be available in 6.4.6.

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.
Comment 13 Commit Notification 2020-06-16 12:43:26 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

https://git.libreoffice.org/core/commit/1ad7ff8affaba315c8f28a43a18d51c803eb78bc

tdf#133957 sw: SelectAll should select fly in empty section

It will be available in 7.0.0.1.

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.
Comment 14 Commit Notification 2020-06-17 08:54:30 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-6-4":

https://git.libreoffice.org/core/commit/81580e8850a1f256262edeaea990fb40c0dd637f

tdf#132321 tdf#133957 sw: for at-para fly, ignore anchor SwIndex

It will be available in 6.4.6.

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.
Comment 15 BogdanB 2020-06-17 20:40:10 UTC
Not OK.
I tested on
Version: 7.1.0.0.alpha0+
Build ID: a3c8ea5e644ca2fc04de9f01ba9f8ace47f520f0
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2020-06-17_02:21:20
Calc: threaded


And it is not ok. The image is gone even it should be resolved.
Comment 16 ralf.krapf 2020-10-29 06:48:04 UTC
Hi

@Michael Stahl (CIB) : Could your commits be the Reason for Bug 137348 - picture pasted into new document (edit)?

Thanks Ralf