Bug 135581 - Changing anchor from "to page" or "to paragraph' or 'to character' (with intent or in DOCX export) moves the image to a total different position
Summary: Changing anchor from "to page" or "to paragraph' or 'to character' (with inte...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium minor
Assignee: Justin L
URL:
Whiteboard: target:7.6.0 target:24.8.0
Keywords:
: 135842 138498 140206 140219 142388 142456 146930 149806 (view as bug list)
Depends on:
Blocks: Anchor-and-Text-Wrap
  Show dependency treegraph
 
Reported: 2020-08-09 14:44 UTC by Telesto
Modified: 2024-05-17 03:34 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file (677.71 KB, application/vnd.oasis.opendocument.text)
2020-08-09 14:44 UTC, Telesto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2020-08-09 14:44:13 UTC
Description:
Changing anchor from "to page" "to paragraph' or 'to character' moves the image to a total different position

Steps to Reproduce:
1. Open the attached file
2. Select the image at the right bottom on first page
3. Right click -> Change anchor to to paragraph

Actual Results:
Image jump to beginning of the page

Expected Results:
Should not move


Reproducible: Always


User Profile Reset: No



Additional Info:
Found in
7.1

and in
3.3.0
Comment 1 Telesto 2020-08-09 14:44:29 UTC
Created attachment 164069 [details]
Example file
Comment 2 Paul W. 2020-09-09 12:50:37 UTC
This bug is already present in Libreoffice 3.3.0
Changing version to "inherited from OOo"
Comment 3 Aron Budea 2020-09-19 06:50:56 UTC
(In reply to Paul W. from comment #2)
> This bug is already present in Libreoffice 3.3.0
> Changing version to "inherited from OOo"
This also means it's not a regression.
Comment 4 Timur 2022-02-07 12:31:07 UTC
*** Bug 138498 has been marked as a duplicate of this bug. ***
Comment 5 Timur 2022-02-07 12:33:38 UTC
*** Bug 142456 has been marked as a duplicate of this bug. ***
Comment 6 Timur 2022-02-07 12:35:30 UTC
*** Bug 94302 has been marked as a duplicate of this bug. ***
Comment 7 Timur 2022-02-07 12:35:45 UTC
*** Bug 140219 has been marked as a duplicate of this bug. ***
Comment 8 Timur 2022-02-07 12:41:09 UTC
*** Bug 146930 has been marked as a duplicate of this bug. ***
Comment 9 Timur 2022-02-07 12:43:21 UTC
*** Bug 146984 has been marked as a duplicate of this bug. ***
Comment 10 sdc.blanco 2022-06-19 16:09:50 UTC
(In reply to Telesto from comment #0)
> Description:
> Changing anchor from "to page" "to paragraph' or 'to character' moves the
> image to a total different position
Repro with context Anchor menu.

NO repro  with image 1 if using "Position and Size" dialog.
Different repro with image 2 if using "Position and Size" dialog.

Version: 7.5.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: c0e66cfab12d6c78d68af09498533362724dbd05
CPU threads: 8; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: da-DK (da_DK); UI: en-US
Calc: CL
Comment 11 Justin L 2023-03-15 18:34:04 UTC
*** Bug 140206 has been marked as a duplicate of this bug. ***
Comment 12 Justin L 2023-03-15 18:35:32 UTC
*** Bug 142388 has been marked as a duplicate of this bug. ***
Comment 13 Justin L 2023-03-15 18:36:02 UTC
*** Bug 135842 has been marked as a duplicate of this bug. ***
Comment 14 Justin L 2023-03-16 22:53:34 UTC
For the right-click menu, the code to look at is basesh.cxx FN_TOOL_ANCHOR_

For the dialog, the code to look at is grfsh.cxx execute where the problem seems to be aMgr.SetAttrSet(*pSet) clearing the Hori and Vert formats.

The interesting code seems to be in docfly.cxx.

Potential proposal at https://gerrit.libreoffice.org/c/core/+/149012
Comment 15 Commit Notification 2023-03-22 10:40:53 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

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

tdf#135581 sw UI: keep image in place when changing anchor

It will be available in 7.6.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 16 Justin L 2023-03-22 11:36:51 UTC
This could use some good testing. All the code seemed to converge on one spot, so I think this patch should solve all menu, right-click, and dialog issues.

Of course, please be careful when testing. It should always work when starting from any of the PAGE options and going "to paragraph" or "to character", and similarly para -> char and back again.

"At Char" should not be tested as that is completely different.

If you start from "to char", then obviously settings which only apply to a character anchor will show as shifting when changing to a different anchor. Similarly most of the paragraph options are meaningless with a page anchor.
So your starting point should always be "to page" or "to paragraph".
Comment 17 Cor Nouws 2023-04-14 20:56:55 UTC
(In reply to Justin L from comment #16)
> This could use some good testing. All the code seemed to converge on one

will try - thanks!
Comment 18 Cor Nouws 2024-03-21 09:20:15 UTC
works nicely in Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 56767830b81fa21382b87cf43d78b1c73ca5dbd8
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

thnx!
Comment 19 Commit Notification 2024-04-07 16:47:55 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

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

Improve test for tdf#135581

It will be available in 24.8.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 20 Stéphane Guillou (stragu) 2024-05-17 03:34:03 UTC
*** Bug 149806 has been marked as a duplicate of this bug. ***