Bug 79695 - FILEOPEN: MS Word 2013 ODF shows red question marks after formula
Summary: FILEOPEN: MS Word 2013 ODF shows red question marks after formula
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Formula Editor (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on: 99984
Blocks: MSO-Formats
  Show dependency treegraph
 
Reported: 2014-06-05 18:07 UTC by Firas Hanife
Modified: 2024-10-16 03:15 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
LibO 4.2 vs Word 2013 (149.98 KB, image/png)
2014-06-05 18:37 UTC, Yousuf Philips (jay) (retired)
Details
example docx with formuls (17.95 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2017-10-14 06:48 UTC, Roman Kuznetsov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Firas Hanife 2014-06-05 18:07:11 UTC
Opening the file from attachment 93106 [details] I noticed that some formulas were not properly recognized and consequently some "¿" were shown instead. (bug 74262)

You can see them on page 29 and 30.

Reproduced with 4.1.6.2, 4.2.4.2 and 4.3.0.0.beta1.
Comment 1 Yousuf Philips (jay) (retired) 2014-06-05 18:37:03 UTC
Created attachment 100483 [details]
LibO 4.2 vs Word 2013

Confirmed in Linux Mint LibO 3.3.0 so inherited from OOo. MS Word 2013 doesnt show these question marks, but has a series of '}'.
Comment 2 Yousuf Philips (jay) (retired) 2014-06-05 18:37:47 UTC
The MS Word 2013 pdf export can be found in attachment 100262 [details].
Comment 3 QA Administrators 2015-06-08 14:43:12 UTC Comment hidden (obsolete)
Comment 4 Yousuf Philips (jay) (retired) 2015-06-09 08:46:03 UTC
Red question marks still present.

Version: 5.1.0.0.alpha1+
Build ID: 587006cac508616f486aea45e265a170bcccdc87
TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:master, Time: 2015-06-06_00:16:39
Comment 5 Xisco Faulí 2016-04-21 13:40:03 UTC
This issue can be also reproduced with attachment #82092 [details]
Comment 6 Xisco Faulí 2016-04-21 13:41:05 UTC
Reproduced in

Version: 5.2.0.0.alpha0+
Build ID: 3dca8575d63db50b0120fbff09bbfcd056fa3732
CPU Threads: 4; OS Version: Windows 6.1; UI Render: default; 
TinderBox: Win-x86@39, Branch:master, Time: 2016-04-20_05:07:29
Locale: es-ES (es_ES)
Comment 7 Regina Henschel 2016-04-21 18:50:47 UTC
A docx document is not helpful here, because it uses "http://schemas.openxmlformats.org/officeDocument/2006/math", which requires a different filter.

This is about the MathML import filter. Our own MathML is not imported from the pure MathML but from the embedded annotation, which contains the StarMath string. The part, which can read pure MathML, is in a bad state. The internal model is designed for StarMath and lacks many properties needed for MathML.

The attached document is far too large. The formulas might have different problems and it would be good, to make a single issue for each problem, if not already existing.

I have looked at the formula in the lower part of page 13. It is OLE-object "18" in the navigator. I can identify some problems:

(1) StarMath does not allow an empty matrix cell. LibreOffice should insert a small space or an empty string for StarMath in such cases.

(2) The brace for the case distinction is a <mml:mo>{</mml:mo>. It is imported as lbrace. That is bad, because it does not preserve the default "stretchy" attribute of this operator and prevents setting a closing "right none", which is needed for StarMath, because it requires balanced brackets. LibreOffice should use a "left lbrace" and insert a "right none", when the enclosed element is closed and no bracket follows.
 
(3) The source uses <mml:mo>∣</mml:mo> to represent the lines of the abs function, where the ∣ is the unicode symbol "DIVIDES". A literal translation would result in StarMath operator "divides", which does not fit well in this context.
StarMath itself uses the unicode symbol "VERTICAL LINE" for the lines of the abs function and imports them as "left lline" and "right lline" in case the annotation is missing.
I don't know a save algorithm to detect whether a true "divides" is intended or not.
The operators have no mathematical meaning in Presentation MathML, so it is not a direct fault, but it is at least bad style by Microsoft.
Comment 8 Regina Henschel 2016-05-13 19:13:15 UTC
(In reply to Regina Henschel from comment #7)
 
> (1) StarMath does not allow an empty matrix cell. LibreOffice should insert
> a small space or an empty string for StarMath in such cases.

I was wrong here.

https://www.w3.org/TR/MathML2/chapter3.html#presm.reqarg
"3.1.3.1 Inferred mrows
The elements listed in the following table as requiring 1* argument (msqrt, mstyle, merror, menclose, mpadded, mphantom, mtd, and math) actually accept any number of arguments. However, if the number of arguments is 0, or is more than 1, they treat their contents as a single inferred mrow formed from all their arguments."

Therefore in case of an empty cell neither small space nor empty string has to be used but an empty row element, which will result in {} in StarMath.
Comment 9 Regina Henschel 2016-05-21 20:56:18 UTC
If have written bug 99984 for the sub problem of empty table cells.
Comment 10 QA Administrators 2017-05-22 13:40:54 UTC Comment hidden (obsolete)
Comment 11 Roman Kuznetsov 2017-10-13 16:44:57 UTC
This bug repro in 5.4.2 and 6.0 alpha0, because nobody didn't fix it =(

Takeshi, you improve filter MathML in version 5.3. Do you have any opinion about this bug?
Comment 12 Roman Kuznetsov 2017-10-14 06:48:09 UTC
Created attachment 136966 [details]
example docx with formuls
Comment 13 QA Administrators 2018-10-23 02:47:58 UTC Comment hidden (obsolete)
Comment 14 Regina Henschel 2018-10-23 10:40:48 UTC
The formulae have still a problem with the equal sign. StarMath does not allow a missing operand in a line. Therefore a {} needs to be added. And I see some order problems, where a "=}" is generated, but it needs to be a "}=".

Tested in Version: 6.2.0.0.alpha1+ (x64)
Build ID: 22beeb3ee7d199b6b15636c532d3ad9f75da1a2b
CPU threads: 8; OS: Windows 10.0; UI render: GL; VCL: win; 
Locale: en-US (en_US); Calc: threaded
Comment 15 QA Administrators 2019-10-24 02:40:46 UTC Comment hidden (obsolete, spam)
Comment 16 QA Administrators 2022-10-13 03:32:31 UTC Comment hidden (obsolete)
Comment 17 Roman Kuznetsov 2022-10-16 10:51:56 UTC
Still repro 

Version: 7.5.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 5a1f41a0d3aab15c113651f2edc9d4137ae99063
CPU threads: 4; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: ru-RU
Calc: threaded
Comment 18 QA Administrators 2024-10-16 03:15:21 UTC
Dear Firas Hanife,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug