Bug 117087 - FILEOPEN: Word OOXML equation layout missing newline on filter import
Summary: FILEOPEN: Word OOXML equation layout missing newline on filter import
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Formula Editor (show other bugs)
(earliest affected)
4.1 all versions
Hardware: All All
: medium normal
Assignee: Not Assigned
Keywords: filter:docx
Depends on:
Blocks: DOCX-Formula
  Show dependency treegraph
Reported: 2018-04-18 12:41 UTC by Lapo Luchini
Modified: 2022-05-04 22:30 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:

original Word document (13.89 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-04-18 12:43 UTC, Lapo Luchini
PDF produced by Word (299.20 KB, application/pdf)
2018-04-18 12:43 UTC, Lapo Luchini
PDF produced by LibreOffice 6.0.1 (FreeBSD) (39.21 KB, application/pdf)
2018-04-18 12:44 UTC, Lapo Luchini
attached OOXML as saved to ODF from Word 2016 (8.83 KB, application/vnd.oasis.opendocument.text)
2018-04-18 14:04 UTC, V Stuart Foote
Equations in OOXML are deformed in LO 7.4.0.a (40.94 KB, image/png)
2022-05-04 22:30 UTC, Silvestr VS

Note You need to log in before you can comment on or make changes to this bug.
Description Lapo Luchini 2018-04-18 12:41:54 UTC
Importing an existing .docx file with equations produces a file that contains the equations correctly shown, but with a different layout.

Steps to Reproduce:
Open the attached .docx

Actual Results:  
Both on screen and on PDF all the equations are on the same line.

Expected Results:
As can be seen in the attached PDF produced with Word, the equations should be on different lines.

Reproducible: Always

User Profile Reset: No

Additional Info:

User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36
Comment 1 Lapo Luchini 2018-04-18 12:43:00 UTC
Created attachment 141459 [details]
original Word document
Comment 2 Lapo Luchini 2018-04-18 12:43:39 UTC
Created attachment 141460 [details]
PDF produced by Word
Comment 3 Lapo Luchini 2018-04-18 12:44:15 UTC
Created attachment 141461 [details]
PDF produced by LibreOffice 6.0.1 (FreeBSD)
Comment 4 V Stuart Foote 2018-04-18 14:04:07 UTC
Created attachment 141463 [details]
attached OOXML as saved to ODF from Word 2016

Confirmed on Windows 10 Home 64-bit en-US with
Version: (x64)
Build ID: 8f48d515416608e3a835360314dac7e47fd0b821
CPU threads: 4; OS: Windows 10.0; UI render: GL; 
Locale: en-US (en_US); Calc: CL

The docx filter does not correctly layout the formulas and needs attention.

Simple workaround of opening the OOXML .docx in Office 365/Word 2016 and saving to ODF .odt produces a document that LibreOffice correctly displays the formulas for further work.

That is if you have the option, work in MS Word in ODF rather than OOXML, and avoid the annoyances of filter conversion.
Comment 5 Regina Henschel 2018-04-18 19:07:31 UTC
The filter needs to be smart to detect, that the last node is a "w:br", which causes the line break in Word. Having the line break inside the formula does not work in LibreOffice, because the formula is an OLE object, which is anchered as entire entity "as character". So when the formula is inserted, this last line break has to be moved to the normal text flow in the paragraph.
Comment 6 Xisco Faulí 2018-04-19 09:49:51 UTC
Also reproduced in

Build ID: 3ca42d8d51174010d5e8a32b96e9b4c0b3730a53
Threads 4; Ver: 4.10; Render: default; 

Build ID: c15927f20d4727c3b8de68497b6949e72f9e6e9e

Version (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)
Comment 7 QA Administrators 2019-04-20 02:57:53 UTC Comment hidden (obsolete)
Comment 8 Roman Kuznetsov 2019-05-19 09:25:00 UTC
still repro in

Version: (x64)
Build ID: ccf3a0600ee902390ad6112ecf28223078bdd2db
CPU threads: 4; OS: Windows 10.0; UI render: GL; VCL: win; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2019-05-13_03:08:59
Locale: ru-RU (ru_RU); UI-Language: en-US
Calc: threaded
Comment 9 QA Administrators 2021-05-19 04:39:06 UTC Comment hidden (obsolete)
Comment 10 Silvestr VS 2022-05-04 22:29:28 UTC
Repro in 

Version: / LibreOffice Community
Build ID: 465c3ad95059f0efa13c8027f7383c4d20a5b2ff
CPU threads: 4; OS: Linux 5.15; UI render: default; VCL: kf5 (cairo+xcb)
Locale: cs-CZ (cs_CZ.UTF-8); UI: en-US
Calc: threaded

The original document displays all equations on the same line. The example file from comment #4 shows the equations on separate lines, but deformed (I'll upload a screenshot shortly).
Comment 11 Silvestr VS 2022-05-04 22:30:56 UTC
Created attachment 179932 [details]
Equations in OOXML are deformed in LO 7.4.0.a