Bug 163890 - DOCX Shape is misplaced upon reload when added to document with an image anchored as character
Summary: DOCX Shape is misplaced upon reload when added to document with an image anch...
Status: ASSIGNED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.4.0.3 release
Hardware: All All
: medium normal
Assignee: Jaume Pujantell
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
Depends on:
Blocks: OOXML-Shapes
  Show dependency treegraph
 
Reported: 2024-11-14 04:35 UTC by Aron Budea
Modified: 2024-11-14 08:18 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample DOCX (5.93 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2024-11-14 04:35 UTC, Aron Budea
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Budea 2024-11-14 04:35:33 UTC
Created attachment 197607 [details]
Sample DOCX

- Open the attached simple DOCX (created in LO), with just an image in it, anchored As Character,
- Insert a shape, (note how it's anchored to page)
- Save and reload.

=> The shape is shifted (and is anchored to character, this is due to a limitation of the DOCX format). The shift is about the distance from page corner to the beginning of text area.
Interestingly, it doesn't happen when an existing ODT with such image and shape is saved as DOCX.

Either way, the shape shouldn't be created anchored to page in the first place.

This is a regression from the following commit in LO 7.4:
https://cgit.freedesktop.org/libreoffice/core/commit/?id=651527b4efe9700c8c8dff58ce5aa86ad5681f16
author		Miklos Vajna <vmiklos@collabora.com>	2022-04-26 15:40:44 +0200
committer	Miklos Vajna <vmiklos@collabora.com>	2022-04-26 17:02:15 +0200

sw: fix double-click opening frame dialog, not graphic dialog on images
Comment 1 Miklos Vajna 2024-11-14 08:18:14 UTC
Most probably the trouble is that we no longer throw away the graphic that we find for a doc coordinate: usually that's wanted (see the commit's message), but probably there is a case where where we revert to "to page" anchoring when the found node is not a text node (it's now a graphic node), and there we should go back to the old "if graphic node, go to its anchor" way.

Jaume: thanks for looking into this.