Bug 121509 - FILESAVE DOCX Shape jumps out of the frame after export
Summary: FILESAVE DOCX Shape jumps out of the frame after export
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.3.0.4 release
Hardware: All All
: medium normal
Assignee: Attila Bakos (NISZ)
URL:
Whiteboard: target:7.3.0 target:7.2.0.0.beta2
Keywords: filter:docx
: 121511 126669 126777 135707 135985 136035 139168 (view as bug list)
Depends on:
Blocks: DOCX-Frames DOCX-Images DOCX-Anchor-and-Text-Wrap
  Show dependency treegraph
 
Reported: 2018-11-19 09:41 UTC by NISZ LibreOffice Team
Modified: 2022-10-19 14:52 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
The original file saved by Writer (9.38 KB, application/vnd.oasis.opendocument.text)
2018-11-19 09:41 UTC, NISZ LibreOffice Team
Details
Example file from Writer – with the moved shape (14.38 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-11-19 09:42 UTC, NISZ LibreOffice Team
Details
Screenshot of the original document in Writer (96.57 KB, image/png)
2018-11-19 09:42 UTC, NISZ LibreOffice Team
Details
Screenshot of the exported document in Word (57.86 KB, image/png)
2018-11-19 09:42 UTC, NISZ LibreOffice Team
Details
Example file (6.94 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2020-12-23 08:00 UTC, Telesto
Details

Note You need to log in before you can comment on or make changes to this bug.
Description NISZ LibreOffice Team 2018-11-19 09:41:22 UTC
Description:
Shape anchored to paragraph in a frame jumps out of the frame after saving to .docx format.

Steps to Reproduce:
1. Insert a frame.
2. Insert a shape and anchored it a paragraph in the frame. (Frame-Paragraph-Shape.odt, Frame-Paragraph-Shape.PNG)
3. Save the document into .docx format. (Frame-Paragraph-Shape.docx)
4. Open the .docx file with MS Word. (Frame-Paragraph-Shape-Export.PNG)

Actual Results:
The shape appears beside the frame.

Expected Results:
The shape remains in the original place


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 NISZ LibreOffice Team 2018-11-19 09:41:53 UTC
Created attachment 146734 [details]
The original file saved by Writer
Comment 2 NISZ LibreOffice Team 2018-11-19 09:42:15 UTC
Created attachment 146735 [details]
Example file from Writer – with the moved shape
Comment 3 NISZ LibreOffice Team 2018-11-19 09:42:35 UTC
Created attachment 146737 [details]
Screenshot of the original document in Writer
Comment 4 NISZ LibreOffice Team 2018-11-19 09:42:58 UTC
Created attachment 146738 [details]
Screenshot of the exported document in Word
Comment 5 Dieter 2019-05-16 13:53:52 UTC
I confirm it with

Version: 6.2.3.2 (x64)
Build-ID: aecc05fe267cc68dde00352a451aa867b3b546ac
CPU-Threads: 4; BS: Windows 10.0; UI-Render: GL; VCL: win; 
Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE
Calc: threaded

Shape in now anchored to the paragraph outside the frame and no longer to the paragraph within the frame
Comment 6 Regina Henschel 2019-05-16 15:43:12 UTC
If I try to insert a drawing object into a text box in Writer, I get the error message "You can't put drawing objects into a text box, callout, comment, footnote, or endnote."

Which kind of object do you expect in Word, so that it can take a drawing object?
Comment 7 Xisco Faulí 2019-05-22 16:12:53 UTC
Also reproduced in

Version: 5.2.0.0.alpha1+
Build ID: 5b168b3fa568e48e795234dc5fa454bf24c9805e
CPU Threads: 4; OS Version: Linux 4.15; UI Render: default; 
Locale: ca-ES (ca_ES.UTF-8)
Comment 8 NISZ LibreOffice Team 2020-12-04 11:19:27 UTC
*** Bug 135985 has been marked as a duplicate of this bug. ***
Comment 9 NISZ LibreOffice Team 2020-12-04 11:22:38 UTC
*** Bug 136035 has been marked as a duplicate of this bug. ***
Comment 10 Gabor Kelemen (allotropia) 2020-12-22 20:52:56 UTC
*** Bug 139168 has been marked as a duplicate of this bug. ***
Comment 11 Telesto 2020-12-22 21:18:14 UTC
(In reply to Gabor Kelemen from comment #10)
> *** Bug 139168 has been marked as a duplicate of this bug. ***

Bug 139168 Comment 2 ("Gabor Kelemen")
But this is not new. The frame is converted to a shape and shapes in Word cannot have other shapes anchored inside.

FWIW: it looked OK in 4.2 (for LO, didn't check MSO)
Comment 12 Aron Budea 2020-12-23 07:00:58 UTC
(In reply to Telesto from comment #11)
> FWIW: it looked OK in 4.2 (for LO, didn't check MSO)
It wasn't looking great in Word after saving as DOCX in 4.2.0.4, the shape was out of place in the top left corner of the page.

In Writer it looks fine in 4.2.0.4, while no shape is shown in 4.3.0.4. In between there are crashes either at start or when you try to load the generated DOCX, and also ranges where the saved DOCX is empty.

Eg. the frame returns without the shape somewhere in the following range:
https://cgit.freedesktop.org/libreoffice/core/log/?qt=range&q=e81212315b5fe22e1005d41149a0ea1a557bf412..fe451fb94a33c914c0a7c1265c013d9704af850a
Comment 13 Telesto 2020-12-23 08:00:13 UTC
Created attachment 168444 [details]
Example file

Not sure if this route being option to emulate the result
Comment 14 NISZ LibreOffice Team 2021-01-20 08:46:47 UTC
*** Bug 135707 has been marked as a duplicate of this bug. ***
Comment 15 Commit Notification 2021-07-01 10:48:06 UTC
Attila Bakos (NISZ) committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/35732c84b05e4f6e50349796636beb01f2a09907

tdf#121509 DOCX export: fix corrupt shape anchoring in textbox

It will be available in 7.3.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 Attila Bakos (NISZ) 2021-07-01 13:56:55 UTC
*** Bug 121511 has been marked as a duplicate of this bug. ***
Comment 17 Attila Bakos (NISZ) 2021-07-01 13:57:39 UTC
*** Bug 126669 has been marked as a duplicate of this bug. ***
Comment 18 Attila Bakos (NISZ) 2021-07-01 13:58:06 UTC
*** Bug 126777 has been marked as a duplicate of this bug. ***
Comment 19 Commit Notification 2021-07-01 14:07:11 UTC
Attila Bakos (NISZ) committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

https://git.libreoffice.org/core/commit/68688b4ca2288ac815d1dff137177e632bbb5f9f

tdf#121509 DOCX export: fix corrupt shape anchoring in textbox

It will be available in 7.2.0.0.beta2.

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 NISZ LibreOffice Team 2021-07-02 05:26:09 UTC
Verified in: 

Version: 7.3.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 3964e0854507b2696ae0fbe48a4fb005c779947e
CPU threads: 4; OS: Windows 10.0 Build 17134; UI render: default; VCL: win
Locale: en-DK (hu_HU); UI: en-GB
Calc: threaded