Bug 58949 - FILEOPEN: DOCX-filter; DOC format formulas embedded in OOXML (DOCX) file, don’t save and don’t edit
Summary: FILEOPEN: DOCX-filter; DOC format formulas embedded in OOXML (DOCX) file, don...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.1.0.0.alpha0+ Master
Hardware: All All
: high blocker
Assignee: Miklos Vajna
URL:
Whiteboard: target:4.0.0.0beta2+ bibisected40 tar...
Keywords: regression
Depends on:
Blocks:
 
Reported: 2013-01-02 15:16 UTC by ape
Modified: 2013-04-30 09:44 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
DOCX file (28.31 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2013-01-02 15:16 UTC, ape
Details
formulas.fodt and formulas.odt: Workaround by LibreOffice_3.6.4 (36.94 KB, application/zip)
2013-01-03 12:29 UTC, ape
Details
bibisect log + terminal output (14.41 KB, text/plain)
2013-04-02 16:20 UTC, Jorendc
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ape 2013-01-02 15:16:41 UTC
Created attachment 72390 [details]
DOCX file

Description:
1. Open the attached file.
2. Try to edit formulas and you'll ascertain that it is impossible.
3. Save this file as ODT or Flat XML file.
4. Reloads the new file and you’ll see that old format’s formulas are lost.

History:
 WinWord-2007 converts DOC file with formulas in DOCX (OOXML) format, preserving such formulas as objects - images WMF format. These objects are saved earlier versions of the program (for example OOo_3.1.1) as bitmaps. Then was undertaken an attempt at reading and conversion WMF of objects as formulas. LibreOffice_3.6.4 allows you to convert and save all objects (formulas WinWord-2003), using The Workaround:
1. Open the attached file.
2. Save this file as FODT.
3. Reloads FODT file.
4. FODT file saves as ODT.
 The method had a specific bug in OS Windows. A pop-up window shows the message "Too many windows are opened" if Equation Editor has been installed as a MS-Office’s component. But The Microsoft Office modified by The Control Panel that removes and recovers Equation Editor easily and quickly.
 The Workaround does not work now in LOdev_4.0.0.beta2. DOC-format’s formulas, embedded in OOXML (DOCX) file as ‘img*.wmf’, don’t edit or save into ODT\FODT files. The program can use The Workarounds II only:
1. Open the attached file.
2. Save this file as DOC.
3. Reloads DOC file.
4. DOC file saves as ODT.
 Formulas of old format will be converted to a bitmap picture, as in OOo_3.1.1_Writer.

Resume:
This is a regression, because error became common for all operating systems.
Comment 1 ape 2013-01-03 12:29:36 UTC
Created attachment 72443 [details]
formulas.fodt and formulas.odt: Workaround by LibreOffice_3.6.4

  It seems to me that the changes, introduced into the code (most likely into the core but not into the filter) became the reason for this error, which has another very unpleasant expression.
  FODT and ODT files (see an attachment) were created with The LibreOffice_3.6.4 Workaround from ‘formulas.docx’.
  Open these files using LOdev_4.0.0.0.beta2+ (Date build: January 3, 2013). You will see that Writer does not decode binary objects (OLE-formulas) that are in the body of ODT file.
Comment 2 ape 2013-01-03 13:20:39 UTC
(In reply to comment #1)
>   FODT and ODT files (see an attachment) were created with The
> LibreOffice_3.6.4 Workaround from ‘formulas.docx’.
>   Open these files using LOdev_4.0.0.0.beta2+ (Date build: January 3, 2013).
> You will see that Writer does not decode binary objects (OLE-formulas) that
> are in the body of ODT file.

I see this bug in the Windows OS (XPsp3_x32 and XPsp2_x64) only. OK in Lubuntu-12.04_x32.
Comment 3 ape 2013-01-03 14:50:33 UTC
(In reply to comment #0)
> This is a regression, because error became common for all operating systems.

Sorry, Windows_OS (NT-5.x;6.x) only
Comment 4 ape 2013-01-03 15:01:50 UTC
Michael, I added You to СС, because You asked for it (Bug 46716).
Comment 5 ape 2013-01-07 14:04:29 UTC
(In reply to comment #3)
> (In reply to comment #0)
> > This is a regression, because error became common for all operating systems.
> 
> Sorry, Windows_OS (NT-5.x;6.x) only

Error is again in Lubuntu-12.04. The program has been updated at Ver. 4.0.0.0.beta2+ (ID: a97bf2e3bc43a709eb72bdc695f96aeecf1174b; TinderBox: Linux-x86_10-Release-Configuration, Branch:libreoffice-4-0, Time: 2012-12-26_12:23:11) to Ver. 4.0.0.0.beta2+ (ID: 1d7287f8d7984eae98a577f60a8bc0a740fc5e9 TinderBox: Linux-x86_10-Release-Configuration, Branch:libreoffice-4-0, Time: 2012-12-28_12:46:28).
Comment 6 Petr Mladek 2013-01-07 14:47:40 UTC
This is related to the bug #56270. The DOCX import/export of formulas newer worked reliably. I actually do not any difference when I save and open the test file in ODT by Lo-3.6.3 or LO-4.0. You results on Lubuntu are confusing. I wonder if there is any regression at all. Such bugs should not block the release => lowering the severity a bit.

Anyway, Miklos or Lubos, could you please have a look at the formula import/export and make it working more reliably?
Comment 7 ape 2013-01-07 17:45:27 UTC
(In reply to comment #6)
> ...You results on Lubuntu are confusing.

Petr,
I did not want to write about Lubuntu, because Linux is not my system. It is possible that it was necessary to remove the old version and install the new version after that. I've updated the program only (dpkg -i *.deb). I will try to repeat the mistake on a clean install tomorrow or the day after.
Comment 8 ape 2013-01-08 04:44:32 UTC
Petr, I confirm a bug in Lubuntu-12.04_x32:

(In reply to comment #6)
> The DOCX import/export of formulas newer
> worked reliably. I actually do not any difference when I save and open the
> test file in ODT by Lo-3.6.3 or LO-4.0.

 I also see the file (attachment 72443 [details]) identical. But LO-3.6.4 can convert the ODT\FODT file's objects, starting Math_LO by double-clicking. LO-4.x does not start Math_LO, so unknown OLE objects are not converted to OLE Formula Math_LO.
Comment 9 ape 2013-01-09 03:10:42 UTC
This error and bug 59128 were born at the same time. Have they the same cause maybe?
Comment 10 Michael Stahl (allotropia) 2013-02-08 19:59:25 UTC
the "cannot edit embedded formulas" part of the problem is fixed with 63ca871bf8f14e0450e5da0dbcfa3ee5d48f1604
Comment 11 Jorendc 2013-04-02 16:19:07 UTC
I bibisect this one. I can confirm the "loss of data/formula" is a regression. But the bug regarding "not editable" is already present in LibreOffice 3.5.0 (oldest bibisectable version).

The bibisection is based on the loss of data/formulas.

I agree with the priority High Critical.
Critical: data loss
High: our own file format + not reproducible by many users (should be "medium" then, but because of the regression and our own file format -> raise it a bit).
Comment 12 Jorendc 2013-04-02 16:20:02 UTC
Created attachment 77329 [details]
bibisect log + terminal output
Comment 13 Miklos Vajna 2013-04-24 10:31:58 UTC
I could not reproduce this with my 3.6 build, but bibisect indeed had an old (pre-3.5 branch point) commit where this worked. I'll try to check what's going on here.
Comment 14 Miklos Vajna 2013-04-24 14:33:25 UTC
So, this is a regression from 0f7fb6868011ea8f7b51a6a326d552254269a63c, though I'm almost sure it's just the commit where the mathml import started to work: I mean possibly it just uncovered an already existing issue.
Comment 15 Commit Notification 2013-04-26 11:11:25 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=6238cfe27f0a202f3fbf482cde2b0a3189adc86f

fdo#58949 EmbeddedObjectContainer: guard against embed::WrongStateException



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 16 Commit Notification 2013-04-26 11:11:47 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=dc92bac5df72ecca123472a5e945b1864a17f457

fdo#58949 testcase



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 17 Miklos Vajna 2013-04-26 12:31:21 UTC
-4-0 review: https://gerrit.libreoffice.org/3624
Comment 18 Commit Notification 2013-04-26 14:07:29 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-4-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=fe437463e3a3fb4cc0e388b45930742bac8c9162&h=libreoffice-4-0

fdo#58949 EmbeddedObjectContainer: guard against embed::WrongStateException


It will be available in LibreOffice 4.0.4.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 19 ape 2013-04-28 14:26:31 UTC
Windows XP(sp2) 64-bit edition
LOdev  4.1.0.0.alpha0+
Build ID: 4c4b9db8bbaed7acd064a4015fabe784c4fbca2
TinderBox: Win-x86@6, Branch:master, Time: 2013-04-28_06:18:09
--
Writer crashed when I opened this DOCX file (attachment 72390 [details]).
Comment 20 Miklos Vajna 2013-04-29 08:31:37 UTC
Sounds like you hit bug 63680: I can reproduce the crash on Windows when opening this bugdoc without that fix, can't after. So, marking as resolved again.

Thanks for testing, though! :-)
Comment 21 ape 2013-04-29 16:13:31 UTC
(In reply to comment #20)
> So, marking as resolved again.
--
Miklos, excuse me!
 This is my discomfiture. On April 28 there were no other builds with yours fixation of error.
 There is no bug here:
buildname: Win-x86@6; tree: libreoffice-4-0; ver.: 4.0.4.0+;
time 2013-04-29 09:00:54; core:af435af8ad93f1616c3471bde70e36227cea8269
Comment 22 Commit Notification 2013-04-29 17:35:41 UTC
Miklos Vajna committed a patch related to this issue.
It has been pushed to "libreoffice-4-0-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=800b17fd80433163e323775862a528fbebe60a11&h=libreoffice-4-0-3

fdo#58949 EmbeddedObjectContainer: guard against embed::WrongStateException


It will be available already in LibreOffice 4.0.3.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 23 ape 2013-04-29 19:17:34 UTC
This is nice news.
--
But I found a new bug re-export the formulas MSO-2003 format of which I will write separately.
 The bottom line: the formulas-2003 ("Object_No" into ODT file) are stored in EMF-format, not in WMF, during re-export DOCX file.
--
Miklos! Please take a look at this problem, if you have the time.
Comment 24 Miklos Vajna 2013-04-30 07:51:04 UTC
(In reply to comment #23)
> But I found a new bug re-export the formulas MSO-2003 format of which I will
> write separately.
>  The bottom line: the formulas-2003 ("Object_No" into ODT file) are stored
> in EMF-format, not in WMF, during re-export DOCX file.
> --
> Miklos! Please take a look at this problem, if you have the time.

Please open a separate issue for this, so it won't be forgotten.

Thanks!
Comment 25 ape 2013-04-30 09:44:02 UTC
(In reply to comment #24)
> Please open a separate issue for this, so it won't be forgotten.
--
Bug 64079