Bug 112312 - FILESAVE Shape with text is incorrectly exported to DOCX
Summary: FILESAVE Shape with text is incorrectly exported to DOCX
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: Balázs Regényi
URL:
Whiteboard: target:7.1.0 target:7.0.0.2
Keywords: bibisected, bisected, filter:docx, implementationError
Depends on:
Blocks: OOXML-Shapes DOCX
  Show dependency treegraph
 
Reported: 2017-09-10 22:40 UTC by Aron Budea
Modified: 2020-07-14 14:56 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample ODT, save as DOCX (10.86 KB, application/vnd.oasis.opendocument.text)
2017-09-10 22:40 UTC, Aron Budea
Details
Screenshot (71.66 KB, image/png)
2017-09-10 22:43 UTC, Aron Budea
Details
new test file (10.12 KB, application/vnd.oasis.opendocument.text)
2020-07-03 12:07 UTC, László Németh
Details
DOCX export and import before and after the fix (73.16 KB, image/png)
2020-07-03 12:08 UTC, László Németh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Budea 2017-09-10 22:40:23 UTC
Created attachment 136157 [details]
Sample ODT, save as DOCX

Open the attached ODT, containing a shape with a piece of text inside.
Save it as DOCX.
Reopen the DOCX.

=> The shape is squashed, and separated from the text.

Observed using LO 5.4.1.2 & 4.3.0.4 / Windows 7.
Somewhat better in LO 4.2.0.4: the shape frame is different and text position is incorrect in the exported DOCX.
=> let's consider it a regression
Comment 1 Aron Budea 2017-09-10 22:43:48 UTC
Created attachment 136158 [details]
Screenshot
Comment 2 Aron Budea 2017-09-10 22:46:19 UTC
(In reply to Aron Budea from comment #0)
> Somewhat better in LO 4.2.0.4: the shape frame is different and text
> position is incorrect in the exported DOCX.
What I mean is, otherwise the shape is the same size, and the text is inside the shape.
Comment 3 Aron Budea 2017-09-11 03:19:38 UTC
This is the range, bibisected using bibisect-43max:
https://cgit.freedesktop.org/libreoffice/core/log/?qt=range&q=562b21949f4ed986d11270bd6203741487795343..1542a655ea21da4cdcd4b836283e44fba5f35059

There are all kinds of crashes when bibisecting further.
Comment 5 Xisco Faulí 2017-09-12 23:49:35 UTC
Same range of commits as in bug 109171. Adding to see also just in case...
Comment 6 QA Administrators 2018-09-13 02:40:58 UTC Comment hidden (obsolete)
Comment 7 Roman Kuznetsov 2018-09-13 06:58:58 UTC
still present in 

Версия: 6.1.1.1
ID сборки: 2718b4a18dfcc6a54ebe5f7b801ee7a47fa81e0c
Потоков ЦП: 4; ОС:Windows 6.1; Отрисовка ИП: по умолчанию; 
Локаль: ru-RU (ru_RU); Calc: group threaded
Comment 8 Buovjaga 2019-04-14 13:03:28 UTC
Bibisected with win32-4.3 to https://gerrit.libreoffice.org/plugins/gitiles/core/+/cfb5b20cdc230320ff9f864d1cfd81aaea221da0%5E!/
DocxAttributeOutput::OutputFlyFrame_Impl: enable DML export by default

Also blamed for bug 122962
Comment 9 Regina Henschel 2019-10-09 18:17:51 UTC
The shape is a legacy rectangle. It does not have the ability to resize to content. Therefore LibreOffice should output an element "<a:noAutofit/>", but it writes "<a:spAutofit/>".
Comment 10 Xisco Faulí 2020-03-31 15:48:02 UTC
*** Bug 122962 has been marked as a duplicate of this bug. ***
Comment 11 Xisco Faulí 2020-03-31 15:48:54 UTC
(In reply to Buovjaga from comment #8)
> Bibisected with win32-4.3 to
> https://gerrit.libreoffice.org/plugins/gitiles/core/+/
> cfb5b20cdc230320ff9f864d1cfd81aaea221da0%5E!/
> DocxAttributeOutput::OutputFlyFrame_Impl: enable DML export by default
> 
> Also blamed for bug 122962

Adding Cc: to Miklos Vajna
Comment 12 Aron Budea 2020-04-01 03:06:36 UTC
(In reply to Buovjaga from comment #8)
> Bibisected with win32-4.3 to
> https://gerrit.libreoffice.org/plugins/gitiles/core/+/
> cfb5b20cdc230320ff9f864d1cfd81aaea221da0%5E!/
> DocxAttributeOutput::OutputFlyFrame_Impl: enable DML export by default
Seems like implementation error in the DrawingML export, then.

> Also blamed for bug 122962
I wouldn't be quick to set duplicates based on the above commit, it just means both bugs are in the DrawingML export that was switched on at that point.
Comment 13 Commit Notification 2020-07-03 11:34:46 UTC
Regényi Balázs committed a patch related to this issue.
It has been pushed to "master":

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

tdf#112312 DOCX legacy shape export: keep fixed size

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:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 14 Balázs Regényi 2020-07-03 12:00:26 UTC
(In reply to Regina Henschel from comment #9)
> The shape is a legacy rectangle. It does not have the ability to resize to
> content. Therefore LibreOffice should output an element "<a:noAutofit/>",
> but it writes "<a:spAutofit/>".

@Regina: thank you very much your help, it was the key

@Balázs Varga: thank you your earlier patch https://git.libreoffice.org/core/+/3fe3588d6743c27c3734b1b4993f5155c15abe98%5E%21, it was very useful for me too
Comment 15 László Németh 2020-07-03 12:07:25 UTC
Created attachment 162608 [details]
new test file

Created with Insert->Shape->Basic shapes->Rectangle, and option "Add Text Box" of the shape, and writing multiple lines in it.
Comment 16 László Németh 2020-07-03 12:08:24 UTC
Created attachment 162609 [details]
DOCX export and import before and after the fix
Comment 17 Xisco Faulí 2020-07-14 14:54:43 UTC
Verified in

Version: 7.1.0.0.alpha0+
Build ID: 616a47c9570f9ce67b18a124f08f4a342bff3468
CPU threads: 4; OS: Linux 4.19; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

@Balázs Regényi, thanks for fixing this issue!!
Comment 18 Commit Notification 2020-07-14 14:56:13 UTC
Regényi Balázs committed a patch related to this issue.
It has been pushed to "libreoffice-7-0":

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

tdf#112312 DOCX legacy shape export: keep fixed size

It will be available in 7.0.0.2.

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.