Bug 150001

Summary: Fileopen DOCX: Equation converted from microsoft word to writer is different
Product: LibreOffice Reporter: joebros <jojo.gaming0001>
Component: WriterAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: normal CC: himajin100000
Priority: medium Keywords: filter:docx
Version: 7.3.4.2 release   
Hardware: All   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 104526    
Attachments: Equation sample
Equation in word as text form
Equation in writer
Equation in writer after convert in word as a text
new file
New file
The formula in Word 2016

Description joebros 2022-07-15 07:24:00 UTC
Description:
I tried to insert an equation in word and try to see the differences in writer. surprisingly, the result on writer is very poor. although i can fix it manually but still troublesome by removing {} on {)} after rsub {3}. the arrow symbol with delta also quite different. I tried made an equation 1st through writer and open it in word. some word are not spaced

Steps to Reproduce:
1.Insert a text in equation in word
2. Save and open the docx file in writer
3. Change the equation in word as a text form

Actual Results:
The equation in writer is different from word. Some word are missing. 

Expected Results:
The same equation as in word


Reproducible: Always


User Profile Reset: No


OpenGL enabled: Yes

Additional Info:
an equation 1st through writer and open it in word. some word are not spaced
Comment 1 joebros 2022-07-15 07:24:36 UTC
Created attachment 181273 [details]
Equation sample
Comment 2 joebros 2022-07-15 07:25:01 UTC
Created attachment 181274 [details]
Equation in word as text form
Comment 3 joebros 2022-07-15 07:26:28 UTC
Created attachment 181275 [details]
Equation in writer
Comment 4 joebros 2022-07-15 07:27:14 UTC
Created attachment 181276 [details]
Equation in writer after convert in word as a text
Comment 5 Mike Kaganski 2022-07-15 07:42:25 UTC Comment hidden (obsolete)
Comment 6 Timur 2022-07-15 10:21:02 UTC
Not clear report. 
If this is about opening MSO files, Equation sample must be from MSO and this one is from LO.
If this is about saving, Equation sample must be ODT from LO. 
Also, there are other bugs with DOCS and equation and question mark, you should search before reporting.
Comment 7 Rafael Lima 2022-07-15 23:04:08 UTC
Not repro in

Version: 7.3.4.2 / LibreOffice Community
Build ID: 30(Build:2)
CPU threads: 12; OS: Linux 5.15; UI render: default; VCL: kf5 (cairo+xcb)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Ubuntu package version: 1:7.3.4-0ubuntu0.22.04.1
Calc: threaded

Also not repro in

Version: 7.5.0.0.alpha0+ / LibreOffice Community
Build ID: 61f5c991a97de8990badfed6ef840941b5aa8c7f
CPU threads: 12; OS: Linux 5.15; UI render: default; VCL: kf5 (cairo+xcb)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Calc: threaded

The equation in the DOCX file by the OP (attachment 181273 [details]) is opening correctly as shown in attachment 181274 [details].
Comment 8 joebros 2022-07-17 07:48:32 UTC Comment hidden (obsolete)
Comment 9 joebros 2022-07-17 08:00:43 UTC Comment hidden (obsolete)
Comment 10 joebros 2022-07-17 08:01:22 UTC
Created attachment 181292 [details]
New file
Comment 11 QA Administrators 2022-07-18 03:27:33 UTC Comment hidden (obsolete)
Comment 12 Timur 2022-07-18 10:35:07 UTC
I set New.
Comment 13 Mike Kaganski 2022-07-18 10:59:00 UTC
Created attachment 181307 [details]
The formula in Word 2016

It is definitely a compatibility issue. Just wanted to note that it's astonishing how the formula could get created in Word.

The attachment shows the cursor set in the beginning of the formula; one may see which block is highlighted - it's "Ce(NO", which is not a reasonable formula block, including an opening parenthesis and an incomplete inner subexpression.

This corresponds to the XML:

> <m:sSub>
>     ...
>     <m:e>
>         <m:r>
>             ...
>             <m:t>Ce(NO</m:t>
>         </m:r>
>     </m:e>
>     <m:sub>
>         <m:r>
>             ...
>             <m:t>3</m:t>
>         </m:r>
>     </m:sub>
> </m:sSub>
> <m:sSub>
>     ...
>     <m:e>
>         <m:r>
>             ...
>             <m:t>)</m:t>
>         </m:r>
>     </m:e>
>     <m:sub>
>         <m:r>
>             ...
>             <m:t>3</m:t>
>         </m:r>
>     </m:sub>
> </m:sSub>

And to the import result in Math:

> {Ce(NO} rsub {3} {)} rsub {3} ...

where all the parts in braces: "{Ce(NO}", "{3}", "{)}", and "{3}" correspond to the separate <m:sub> elements of the original formula.

I wonder how can that be ever converted into a valid math expression, given the input - unless we treat every piece of such a "formula" as literal text, which would ruin all normal formulas.