Bug 147039 - Page with images deleted after deleting second last paragraph
Summary: Page with images deleted after deleting second last paragraph
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.4.0.3 release
Hardware: All All
: lowest trivial
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Anchor-and-Text-Wrap Paragraph
  Show dependency treegraph
 
Reported: 2022-01-28 11:05 UTC by Telesto
Modified: 2023-10-09 17:58 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file (10.70 KB, application/vnd.oasis.opendocument.text)
2022-01-28 11:05 UTC, Telesto
Details
Bibisect log (3.21 KB, text/plain)
2022-01-28 11:51 UTC, Telesto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2022-01-28 11:05:23 UTC
Description:
Page with images deleted after deleting a page break with delete

Steps to Reproduce:
1. Open the attached file
2. Press Delete 

Actual Results:
Second page gone

Expected Results:
Image move up from second page to first page


Reproducible: Always


User Profile Reset: No



Additional Info:
Found in
Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 4a388f5e01ebb5a512931d11e48c4380382239c8
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: nl-NL
Calc: CL

and in
4.4.7.2

not in
Version: 4.3.7.2
Build ID: 8a35821d8636a03b8bf4e15b48f59794652c68ba
Comment 1 Telesto 2022-01-28 11:05:41 UTC
Created attachment 177871 [details]
Example file
Comment 2 Telesto 2022-01-28 11:51:28 UTC
Created attachment 177873 [details]
Bibisect log

Bisected to:
author	Luboš Luňák <l.lunak@collabora.com>	2014-08-12 18:39:02 +0200
committer	Luboš Luňák <l.lunak@collabora.com>	2014-08-12 20:23:16 +0200
commit 2903d85d6197829633d7f96c95cd55821c2c20ff (patch)
tree c73b28cb073885647e4e9274735bc7e4ed93fa10
parent 95f0811c093680e6258f3bc973a3f7a3731a28f4 (diff)
fix deleting an image anchored to last paragraph in document
It only compared nodes instead of SwPositions, thus refusing to delete
anything anchored at the last content node. Also, select-all makes
rEnd point to the last content node, after its content. So if
an anchor-to-char image is anchored at the end of the paragraph,
it points to this place, too, so that must be checked.

https://cgit.freedesktop.org/libreoffice/core/commit/?id=2903d85d6197829633d7f96c95cd55821c2c20ff
Comment 3 LeroyG 2022-01-28 15:15:48 UTC
In single-page view and in book view, I see the images anchored at page 1 vertical level, may be out or in the page, and position varies with zoom level. But values from properties said that they are anchored to the second paragraph.

Version: 7.1.8.1 / LibreOffice Community
Build ID: e1f30c802c3269a1d052614453f260e49458c82c
CPU threads: 1; OS: Linux 4.12; UI render: default; VCL: x11
Locale: es-MX (es_AR.UTF-8); UI: en-US
Calc: threaded
Comment 4 raal 2022-02-13 08:10:07 UTC
I can confirm with Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: 1c0aa970650ffc7c749e0b5ea655ebb2d137c8ae
CPU threads: 4; OS: Linux 5.11; UI render: default; VCL: gtk3
Locale: cs-CZ (cs_CZ.UTF-8); UI: en-US
Calc: threaded Jumbo
Images missing after delete. Adding cc to Lubos Lunak, see comment 2.
Comment 5 Justin L 2022-02-23 13:18:50 UTC
This looks completely irrelevant and contrived.

Not only that, but the same thing happens without a page break. So very little debugging went into this before reporting.

So I could mark this as WONTFIX, or NOTABUG, but perhaps INVALID is the best fit. 

Based on the bibisect commit, it sounds like this will only happen on a two paragraph document, which makes this completely irrelevant.
Comment 6 Telesto 2022-02-23 15:44:14 UTC
(In reply to Justin L from comment #5)
> This looks completely irrelevant and contrived.

Contrived, well I disagree (all thought this being a created sample bug doc)

It's simple to create
1. Open Writer
2. press CTRL+ENTER
3. Paste and image on the second page
4. Go to first page and press delete

> Not only that, but the same thing happens without a page break. 
> So very little debugging went into this before reporting.

Well that's indeed true.

But, example does illustrate the disturbance (in my workflow.) 
I intended to move the images from page 2 to page 1 by pressing delete on the first page (or deleting the empty paragraph on the second page. I expected the page break to be deleted, and the image jumping the first page.. Instead the images where gone.

It does work as expected, if you fill the empty paragraph on the second with some character (or in the backspace case to have some character on the first page)

B) And well even it the non-page break case this is counter intuitive. If I have images anchored to the second paragraph, and delete the first paragraph, you don't expect delete something not even attached to that paragraph 

C)Well this might be somewhat related
1. Open Writer
2. Insert a chart (a second paragraph is created (out of the blue). The chart will be deleted if you press backspace at the second paragraph, or delete on the first paragraph

D) 
1. Open Writer
2. Press enter 4x
3. Paste some image
4. Deselect the image by ESC
5. Press backspace 2x -> Image moves up as expect
6. Press backspace again -> image gets deleted before reaching the top of the page

> Based on the bibisect commit, it sounds like this will only happen on a two
> paragraph document, which makes this completely irrelevant.

Well it does happen only with 2 empty paragraph present, yes. May it be the first page of a document or first paragraphs of page between page breaks
Comment 7 Jean-Baptiste Faure 2022-05-16 15:41:53 UTC
I can confirm with version Version: 7.3.4.0.0+ / LibreOffice Community
Build ID: 6d615be74e30f50b164e0342a0f8fb3324ce8058
CPU threads: 8; OS: Linux 5.13; UI render: default; VCL: gtk3
Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR
Ubuntu_20.04_x86-64
Calc: threaded

Removing a paragraph should not remove something that is not in this paragraph or anchored to this paragraph.
Removing a paragraph should not depend on the next paragraph is empty or not.

Set back to NEW.

Best regards. JBF
Comment 8 Timur 2023-10-09 17:58:00 UTC
Let me again close this trivial issue as NotABug, as this makes normal behavior, content is moved to page 1 and nothing is on page 2. 
Editors I tested (MSO, FreeOffice) behave as LO - and we do not have a sample of one that does not. 
And if Justin closed this, please leave it that way.