Bug 145282 - Group of objects loses position when page is moved up
Summary: Group of objects loses position when page is moved up
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected) alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Object
  Show dependency treegraph
Reported: 2021-10-23 12:58 UTC by phv
Modified: 2022-06-11 03:33 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:

Testcase for complex group of object bug (12.53 KB, application/vnd.oasis.opendocument.text)
2021-10-23 12:59 UTC, phv
Video showing the bug (859.65 KB, video/mp4)
2022-01-05 20:44 UTC, phv

Note You need to log in before you can comment on or make changes to this bug.
Description phv 2021-10-23 12:58:19 UTC
Complex group of drawing object is losing its position, either referenced to a paragraph or a page, when the page which contains the group is moved up. I can reproduce this bug by removing pages before the group, or by updating the index in large document.

Steps to Reproduce:
From the Writer document posted as attachement:
1. Delete the first page.

Actual Results:
The group on the second page is moved down the page.

Expected Results:
The group on the second page should keep its position on the page.

Reproducible: Always

User Profile Reset: Yes

Additional Info:
It seems that the group first keeps its position as defined but, for some unexplained reason, is then moved to the bottom (and sometimes to the right) of the page afterwards.

This bug is reproduced only on version 7.3 dev, version is not affected.

Strangely enough, not all my flowcharts are moved down.
Comment 1 phv 2021-10-23 12:59:04 UTC
Created attachment 175881 [details]
Testcase for complex group of object bug
Comment 2 phv 2021-11-07 18:33:42 UTC
Note also that this bug, still present in the last LibreOffice dev version, ignores that the vertical position of the group of objects is protected and modifies it so that the group is moved as low as possible on the page even if it means covering the margin (the group is in foreground and doesn't allow overlap).

The regression is likely to ruin page layouts if this version is made available more widely to the public.
Comment 3 Dieter 2021-11-11 07:27:06 UTC
I confirm it with

Version: (x64) / LibreOffice Community
Build ID: 742b8befecbcfc0cfab87cfcd87c83b7d8ef32ab
CPU threads: 4; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL

but not with

Version: (x64) / LibreOffice Community
Build ID: 02b2acce88a210515b4a5bb2e46cbfb63fe97d56
CPU threads: 4; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: de-DE
Calc: CL
Comment 4 raal 2021-11-13 18:05:08 UTC
I can reproduce when open the file (no action needed, Linux, vclplugin=gen)
This seems to have begun at the below commit.
Adding Cc: to Daniel Arato ; Could you possibly take a look at this one?
 8ee4fb4db4091c3645c994ee741e63c2e1f98b30 is the first bad commit
commit 8ee4fb4db4091c3645c994ee741e63c2e1f98b30
Author: Jenkins Build User <tdf@pollux.tdf>
Date:   Fri Oct 1 13:24:57 2021 +0200

    source 8da3586cff9cc11cf5db985d19851f21f0d42eb8

   tdf#141220 sw: fix textbox popped out of off-page shape
Comment 5 phv 2021-11-24 03:07:06 UTC
Now in LibreOffice version 7.2.3.
Comment 6 phv 2021-12-05 19:28:19 UTC
Can we remove the fix for bug #141220, at least until this bug is investigated? Because it seems to do more harm than good and there is no feedback from the developer on this issue.

Fix for #141220 made impossible to maintain the position of a group of objects in Writer. Thank you!
Comment 7 phv 2022-01-05 20:44:51 UTC
Created attachment 177336 [details]
Video showing the bug

I'm adding a video showing that, depending on which character the group is anchored to, the bug does or does not occur. Here, it only takes a shift of one character to the left for the group to lose its position when the previous page is deleted.

This loss is made during a recomputation which takes place just after the content has moved on page one. Without it, the position is the right one.
Comment 8 phv 2022-01-28 11:51:06 UTC
There seems to be some improvement in the positioning of groups of shapes in the latest version of LibreOfficeDev 7.4. But I'm waiting to give the stable version a try before closing this report.
Comment 9 phv 2022-06-10 15:14:58 UTC
This bug has been properly fixed.