Bug 140679 - Upside down question markers formula round trip DOCX
Summary: Upside down question markers formula round trip DOCX
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Formula Editor (show other bugs)
Version:
(earliest affected)
3.5.0 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: filter:ooxml
Depends on:
Blocks:
 
Reported: 2021-02-26 10:16 UTC by Telesto
Modified: 2022-12-25 23:00 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Example file (17.21 KB, application/vnd.oasis.opendocument.text)
2021-02-26 10:16 UTC, Telesto
Details
clips for attachment 170076 opened in LO7 writer, original ODT - roundtrip DOCX - roundtrip DOC (55.11 KB, image/png)
2021-02-26 15:55 UTC, V Stuart Foote
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Telesto 2021-02-26 10:16:26 UTC
Description:
Upside down question markers formula after DOCX export 

Steps to Reproduce:
1. Open the attached file
2. Save as DOCX
3. File reload

Actual Results:
Notice red question markers in formula

Expected Results:
Not present in source so not in DOCX


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.2.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 385808a2dff7300ec0120fdd5e8acfad8f86e50d
CPU threads: 4; OS: Windows 6.3 Build 9600; UI render: Skia/Raster; VCL: win
Locale: nl-NL (nl_NL); UI: en-US
Calc: CL
Comment 1 Telesto 2021-02-26 10:16:36 UTC
Created attachment 170076 [details]
Example file
Comment 2 Telesto 2021-02-26 10:17:15 UTC
Also in
Versie: 4.4.7.2 
Build ID: f3153a8b245191196a4b6b9abd1d0da16eead600
Locale: nl_NL
Comment 3 Telesto 2021-02-26 10:18:21 UTC
And in
LibreOffice 3.5.0rc3 
Build ID: 7e68ba2-a744ebf-1f241b7-c506db1-7d53735
Comment 4 Telesto 2021-02-26 10:31:47 UTC
@Justin
To distract you from the color bullet stuff? Maybe something 'easy' (or maybe not, what the hell do I know). Looks like unsupported symbols.
Comment 5 V Stuart Foote 2021-02-26 15:53:44 UTC
This is not an OpenSymbol font issue. This is a filter issue (export to OOXML, and/or import from OOXML).

The original chemical formula in LO7 StarMath is:

   nitalic{NH_3 + H_2 O %Ux21CC  NH_4^{+{}} + OH^{`-{}} }

In LO7 on roundtrip to OOXML (Word 2007-365):

   {NH} rsub {3} + {H} rsub {2} O ⇌ {NH} rsub {4} rsup {+} + {OH} ^ {  −}

Or, in LO7 on roundtrip to MS Word 97-2003 binary:

    size 12{"NH" rSub { size 8{3} } +H rSub { size 8{2} } O⇌"NH" rSub { size 8{4} }  rSup { size 8{+{}} } +"OH" rSup { size 8{` - {}} } } {}


The OOXML filtering has the issue, and because the chemical formula is not rendered non-italic when opened in Word issue start with the ww8 export.
Comment 6 V Stuart Foote 2021-02-26 15:55:41 UTC
Created attachment 170087 [details]
clips for attachment 170076 [details] opened in LO7 writer, original ODT - roundtrip DOCX - roundtrip DOC
Comment 7 V Stuart Foote 2021-02-26 16:24:08 UTC
The sm error markers seem to be from the

rsup {+} + {OH} ^ {  −}

which will render correctly if notated:

rsup {"+"} + {OH} rsup {"−"};  or mixed rsup {"+"} + {OH} ^ {"−"}


Meaning that rather than explicitly literal with the quotes as now, the sm parser might need to allow/accept them as literals when bracketed alone in an rsub or rsup expression?
Comment 8 dante19031999 2021-02-26 17:44:10 UTC
(In reply to V Stuart Foote from comment #7)

> Meaning that rather than explicitly literal with the quotes as now, the sm
> parser might need to allow/accept them as literals when bracketed alone in
> an rsub or rsup expression?

Those are chemistry formulas.
In the new parser I'm implementing there will be special namespace for formulas in which syntax is optimized for that. I'll take it into account.
Comment 9 Rajasekaran Karunanithi 2022-12-25 23:00:34 UTC
Still presents in LO 7.6 Dev under Windows 10(x64).

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: ad387d5b984c6666906505d25685065f710ed55d
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: en-IN (en_IN); UI: en-US
Calc: threaded