Bug 81567 - FILESAVE: DOCX caption of image is shown at top instead of bottom in Word
Summary: FILESAVE: DOCX caption of image is shown at top instead of bottom in Word
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected) rc
Hardware: Other All
: medium major
Assignee: Not Assigned
Whiteboard: target:7.1.0
Keywords: bibisected, bisected, filter:docx, regression
: 91149 (view as bug list)
Depends on:
Blocks: DOCX-Images
  Show dependency treegraph
Reported: 2014-07-20 17:00 UTC by Jorendc
Modified: 2020-08-10 10:34 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:

Sample document. Save this as .docx (10.35 KB, application/vnd.oasis.opendocument.text)
2014-07-20 17:00 UTC, Jorendc
LibO 4.0 VS 4.3 (349.68 KB, image/png)
2014-07-20 17:42 UTC, Yousuf Philips (jay) (retired)
sample files created for the testing (2.81 MB, application/zip)
2014-07-20 22:01 UTC, Yousuf Philips (jay) (retired)
bibisectlog (2.32 KB, text/plain)
2014-07-22 19:39 UTC, Jorendc
Screenshot of the original and exported document side by side in Word and Writer (40.08 KB, image/png)
2020-07-30 14:36 UTC, NISZ LibreOffice Team

Note You need to log in before you can comment on or make changes to this bug.
Description Jorendc 2014-07-20 17:00:26 UTC
Created attachment 103147 [details]
Sample document. Save this as .docx

* Open and resaved attached document as .docx
* Open using Microsoft Office

Behavior: image caption is shown at the top, and the caption text is lost.

Tested using LibreOffice Version:
Build ID: a82ff18269e5b37348d402b7c21c3f200068265c
TinderBox: Win-x86@39, Branch:master, Time: 2014-07-20_02:34:36

Test file created with following steps:
* Open Writer
* Insert > image > from file
* Just pick a random image
* Right click on it > Caption
* Add some caption text
* Save document as .odt an .docx
Comment 1 Yousuf Philips (jay) (retired) 2014-07-20 17:38:16 UTC
Confirmed in Linux Mint on 4.3.1 and 4.4. The saved docx file from 4.1.6 and 4.2.5 crashes ms word. The docx file saved from 4.0.6 works fine.
Comment 2 Yousuf Philips (jay) (retired) 2014-07-20 17:42:35 UTC
Created attachment 103150 [details]
LibO 4.0 VS 4.3
Comment 3 Yousuf Philips (jay) (retired) 2014-07-20 22:01:26 UTC
Created attachment 103157 [details]
sample files created for the testing
Comment 5 Jorendc 2014-07-22 19:42:22 UTC
Hi Tushar,

This bug _might_ be introduced by commit 7e92d9881f039899262882633712ec0a3de01474 (http://cgit.freedesktop.org/libreoffice/core/commit/?id=7e92d9881f039899262882633712ec0a3de01474). You mind taking a look?

Thanks in advance,
Comment 6 Michael Stahl (allotropia) 2014-07-24 15:01:58 UTC
comment #5 does have the right commit; but for me without that
Word 2010 will go into an infinite loop reading the file - that
was the bug that was fixed.
Comment 7 Tushar Bende 2014-07-24 15:53:47 UTC Comment hidden (obsolete)
Comment 8 Tushar Bende 2014-07-28 06:56:13 UTC
I checked the issue document on latest build.I can work on this issue you no one is working on it please assign it to me.

Comment 9 Jorendc 2014-07-28 11:19:48 UTC
Hi Tushar,

First of all thanks for your time! Really appreciated!

(In reply to comment #8)
> I checked the issue document on latest build.I can work on this issue you no
> one is working on it please assign it to me.

Sure you can :-). No one is assigned to this bug right now, and no one did left a comment saying (s)he's working on it. Please do :-).

PS: this is the same for all bugs: if it's not assigned and no one is commenting he's working on it -> feel free to take it.


Comment 10 Joel Madero 2015-01-10 19:57:45 UTC Comment hidden (obsolete)
Comment 11 Jorendc 2015-04-29 17:19:05 UTC
Still present in Version: (x64)
Build ID: f3375fa07f27bd2ade519af3c07d69040d10eaa9
TinderBox: Win-x86_64@42, Branch:master, Time: 2015-04-22_23:38:50
Locale: nl_BE

Kind regards,
Comment 12 Jorendc 2015-05-21 18:25:19 UTC
*** Bug 91149 has been marked as a duplicate of this bug. ***
Comment 13 Robinson Tryon (qubit) 2015-12-13 12:15:50 UTC Comment hidden (obsolete)
Comment 14 Andrey Skvortsov 2016-06-28 08:20:11 UTC
The issue is still present on 5.1.4, both GNU/Linux and Windows versions were tested.

To reproduce the issue MS Word isn't needed. To check the bug you can open saved docx document in LO. 

* Open and resaved attached document as .docx
* Open saved .docx document using LibreOffice

Behavior: image caption is shown at the top instead of in the bottom, and the caption number and text are lost.
Comment 15 QA Administrators 2018-06-26 02:45:42 UTC Comment hidden (obsolete)
Comment 16 Andrey Skvortsov 2018-08-02 14:10:22 UTC
Bug still exists in LO

Used system:
Debian Test (buster)
Build ID: 1:6.0.6~rc1-1
CPU threads: 8; OS: Linux 4.16; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); Calc: group
Comment 17 sdc.blanco 2019-10-28 12:38:39 UTC
Can confirm with Version: (x64), using .odt file in attachment 103147 [details].

One additional observation:  

Before saving the file as .docx, the frame (Frame1) is listed under "Text frames" in Navigator.  After saving as .docx and reloading, this frame is now listed under "Drawing objects".

Maybe that is significant?
Comment 18 NISZ LibreOffice Team 2020-07-30 14:36:17 UTC
Created attachment 163777 [details]
Screenshot of the original and exported document side by side in Word and Writer
Comment 19 NISZ LibreOffice Team 2020-07-30 14:38:34 UTC
This seems to have gotten better recently, with:


author	Michael Stahl <Michael.Stahl@cib.de>	2020-07-10 19:29:27 +0200
committer	Michael Stahl <michael.stahl@cib.de>	2020-07-13 11:24:29 +0200

tdf#134618 sw: DOCX export: fix order of as-char and at-char fly...
Comment 20 Commit Notification 2020-07-31 08:27:04 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":


tdf#81567 : sw_ooxmlexport14: Add unittest

It will be available in 7.1.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:

Affected users are encouraged to test the fix and report feedback.
Comment 21 Xisco Faulí 2020-08-10 10:34:59 UTC
Unittest added, setting to VERIFIED