Bug 46142 - Error with formulas in odt format after docx import
Summary: Error with formulas in odt format after docx import
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.0.0.3 release
Hardware: Other All
: medium critical
Assignee: Not Assigned
URL:
Whiteboard: (target:4.3.0)
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-15 18:56 UTC by disinterested
Modified: 2014-02-15 09:32 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Original docx file with some equations (26.31 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2012-02-15 18:56 UTC, disinterested
Details
Odt file created from the docx file (11.74 KB, application/vnd.oasis.opendocument.text)
2012-02-15 18:57 UTC, disinterested
Details

Note You need to log in before you can comment on or make changes to this bug.
Description disinterested 2012-02-15 18:56:23 UTC
Created attachment 57128 [details]
Original docx file with some equations

- Create a docx file containing some equations using office
- Open the docx file with LibO
- Save the imported file as an odt file
- Close LibO and reopen the odt file

Only the first equation displays properly. The remaining equations are not editable and they show the image file associated with the first equation.

See attachments for an example.
Comment 1 disinterested 2012-02-15 18:57:05 UTC
Created attachment 57129 [details]
Odt file created from the docx file
Comment 2 Ivan Timofeev (retired) 2012-03-14 10:52:24 UTC
Reproducible with a fresh master build (Build ID: 9e6b086-f89f0d1-e67b1bf-879ce36-638d9c) under Ubuntu 10.10 x86.

As a workaround:

1. save docx to fodt 
2. close and reopen this fodt
3. save it to odt
Comment 3 ape 2012-03-14 20:54:45 UTC
LibreOffice can not create within the ODT-archive folder with
the contents of all OLE-objects, which were placed in DOCX-file, and creates
these folders only for some objects. The mechanism of passage I do not
understand, any OLE-object, regardless of its type ( "image" or "formula") may
be lost. Most often, lost objects, starting with the second, if DOCX-file are
located in a row, one after another.
Comment 4 ape 2012-03-15 09:22:50 UTC
Reproduced in LibO-3.5.1_Win_x86, blocking the opening of that part of the document, which is located below the missed OLE-object.
Comment 5 ape 2012-03-15 23:30:55 UTC
(In reply to comment #2)
> Reproducible with a fresh master build (Build ID:
> 9e6b086-f89f0d1-e67b1bf-879ce36-638d9c) under Ubuntu 10.10 x86.
> 
> As a workaround:
> 
> 1. save docx to fodt 
> 2. close and reopen this fodt
> 3. save it to odt

The issue resolved by a workaround in the "libreoffice-3-5~2012-03-15_15.40.13_LibO-Dev_3.5.2rc0_Win_x86_install_en-US".
Comment 6 Petr Mladek 2012-03-20 08:24:50 UTC
The formula DOCX import is new in LO-3.5. It did not work in LO-3.4. => it is not regression => Of course, we should fix this but it can't block the release => lowering the severity a bit.
Comment 7 Roman Eisele 2012-03-21 01:16:27 UTC
Just for your information: compare the following formula/DOCX bugs:

* Bug 36982 - [FILEOPEN] Writer ignores text after Equation in docx
* Bug 46716 - Some formulas are lost by "DOCX" import filter.
* Bug 43429 - Opening of docx-file with mathematical formulas crashed writer. (Sample provided)
* Bug 44289 - [FILEOPEN] docx with mathtype 6.0 equations does not fully open on Windows

Of these some/all may be releated ... or may not ;-) At least some of these bugs should be fixed in the current Master builds and in the upcoming LibreOffice 3.5.2, so we should test if this bug here is still present in 3.5.2.
Comment 8 Roman Eisele 2012-05-08 11:09:53 UTC
Just FYI:
Still reproducible with LibreOffice 3.5.3.2 (Build-ID: 235ab8a-3802056-4a8fed3-2d66ea8-e241b80), German langpack installed, on MacOS X 10.6.8 German UI. Still the same results as in the original description.
Comment 9 Kevin Ernst 2012-09-23 00:18:23 UTC
This problem is still present in the shipping Mac OS X LibreOffice build (Version 3.6.2.1 [Build ID: ba822cc]).

Also confirm that the workaround of saving as a "flat" ODT, then re-saving as .odt works for me, even for a very complex .docx that I was having lots of problems with before.

I nominate this bug as a duplicate of Bug 46716. Not sure I have the authority to mark it as such (although clearly Bugzilla will let me), but it's definitely describing the same behavior as 46716.
Comment 10 Roman Eisele 2012-09-23 18:27:47 UTC
(In reply to comment #9)
> I nominate this bug as a duplicate of Bug 46716. Not sure I have the
> authority to mark it as such (although clearly Bugzilla will let me), but
> it's definitely describing the same behavior as 46716.

You can mark this bug as a duplicate, no problem ;-) Every user who gives some rationale can do that.

However, I am not sure if both problems are really the same; they seem related, of course, but at least the original description (comment #0) of both bugs, and therefore the summaries, differ IMHO.
Comment 11 Ruslan Kabatsayev 2013-01-09 21:12:16 UTC
Still reproducible with Version 4.1.0.0.alpha0+ (Build ID: c57906c8f614047a488eea6eb77c535bf90a889).
Second equation looks the same as first and third has "Object 6" instead of any equation.
Comment 12 disinterested 2013-02-14 03:13:31 UTC
In 4.0.0.3 this bug is still present and accompanied by two new bugs: 

(1) equations imported from Word 2007/2010 format are compressed to the wrong size (this goes away upon save to fodt). 

(2) if you save the file as an fodt document, then open the fodt document and save it as an odt document, the original bug happens again (all equations are lost and replaced with a missing object icon).

The work that has been done to allow for OMML is very impressive, but these bugs render LibreOffice completely incompatible with Word 2007/2010 equations. This is quite unfortunate -- what needs to be done to get this fixed?
Comment 13 Jorendc 2014-02-15 09:32:53 UTC
Looks fixed in LibreOffice 4.3 master (tested using Mac OSX 10.9 with LibreOffice Version: 4.3.0.0.alpha0+ Build ID: b540f9172814f51361cf31d2a4b03e34d1d375ef TinderBox: MacOSX-x86@49-TDF, Branch:master, Time: 2014-02-15_00:28:42

Opening attached .docx: 
* No error
* 3 equations

Save and reopen as .odt:
* No errors
* 3 equations visible, as imported in previous step

Save and reopen as .fodt:
* No errors too
* All 3 equations visible

Save and reopen as .docx:
* Same as above :-)


Compared original .docx file and roundtripped .docx file in Word for Mac:
* Exact the same.

Note: it looks like the equations should be center-aligned on the page. This isn't true when importing using LibreOffice. _BUT_ roundtripping the file and open it using Word for Mac doesn't result in a 'loss' of that alignment. (read: LibreOffice doesn't show it correct, but export it correct so Word opens it as original).

Lets mark this one as RESOLVED WORKSFORME. Please create a separate bug report for the incorrect alignment of the equations.

Kind regards,
Joren

PS: you can test this version yourself by downloading it here: http://dev-builds.libreoffice.org/daily/master/

Please feel free to reopen this bug if you still can reproduce this behavior with LibreOffice 4.3 or later.