Bug 134007

Summary: EDITING: Image anchored to paragraph gets removed when removing the paragraph
Product: LibreOffice Reporter: Xisco Faulí <xiscofauli>
Component: WriterAssignee: Michael Stahl (allotropia) <michael.stahl>
Status: RESOLVED FIXED    
Severity: minor CC: kelemeng, michael.stahl, telesto, xiscofauli
Priority: low Keywords: bibisected, bisected, regression
Version: 7.1.0.0.alpha0+   
Hardware: All   
OS: All   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=132321
https://bugs.documentfoundation.org/show_bug.cgi?id=139514
https://bugs.documentfoundation.org/show_bug.cgi?id=132279
Whiteboard: target:7.4.0 target:7.3.5
Crash report or crash signature: Regression By: Michael Stahl
Bug Depends on:    
Bug Blocks: 87740    

Description Xisco Faulí 2020-06-15 18:09:31 UTC
Steps to reproduce it:
1. Open sw/qa/extras/uiwriter/data3/tdf132725.odt
2. Go to end of paragraph
3. Use backspace twice

-> Image disappears

Regression introduced by https://cgit.freedesktop.org/libreoffice/core/commit/?id=91b2325808a75174f284c48c8b8afc118fad74e4, later on fixed by https://cgit.freedesktop.org/libreoffice/core/commit/?id=be2f539012d818eaa2d40a9cf199b53d32e1dee4 and reintroduced again by 
https://git.libreoffice.org/core/commit/b314735568c1e9ab8ca52413017425bc2ef12973

See https://gerrit.libreoffice.org/c/core/+/96386 for more information
Comment 1 Xisco Faulí 2020-06-15 18:10:09 UTC Comment hidden (obsolete)
Comment 2 Timur 2020-06-16 06:06:04 UTC
It's not attachment 160388 [details] ? 
I don't see by title why this should be a bug, looks reasonable.
Comment 3 Xisco Faulí 2020-06-16 07:40:00 UTC
(In reply to Timur from comment #2)
> It's not attachment 160388 [details] ? 
> I don't see by title why this should be a bug, looks reasonable.

I'm reporting it because it has always worked in a different way. Also see my description explaining that it was introduced, fixed and reintroduced again.
I'm fine if the behaviour changes but I would like to hear Michael's opinion first
Comment 4 Michael Stahl (allotropia) 2020-06-16 08:57:49 UTC
 be2f539012d818eaa2d40a9cf199b53d32e1dee4 was a regression for this example because it didn't take into account that anchor of at-para fly doesn't have SwIndex.

see https://bugs.documentfoundation.org/show_bug.cgi?id=132321#c20
for my idea of how this should work.

this falls into case 2.

distinguishing between a selection that was created by SelectAll and one that was  created by Backspace key and happens to be the entire section because there's only one character doesn't look easy to implement.
Comment 5 Buovjaga 2021-08-05 16:24:25 UTC
*** Bug 135629 has been marked as a duplicate of this bug. ***
Comment 6 Michael Stahl (allotropia) 2022-06-08 18:31:35 UTC
fixed on master
Comment 7 Michael Stahl (allotropia) 2022-06-21 12:10:01 UTC
notification didn't happen, apparently i need to put all the bugs into subject line:

commit a6832b836e6905362c85d1a90c8779cf7ce821fe
Author:     Michael Stahl <michael.stahl@allotropia.de>
AuthorDate: Tue Jun 7 19:01:24 2022 +0200
Commit:     Michael Stahl <michael.stahl@allotropia.de>
CommitDate: Tue Jun 21 10:03:07 2022 +0200

    tdf#133957 sw: don't delete flys on Backspace/Delete keys
    
    Also fixes: tdf#134007 tdf#138835 tdf#139514