Bug 122151 - Only first letter of custom operator exported in mathml
Summary: Only first letter of custom operator exported in mathml
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Formula Editor (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: MathML
  Show dependency treegraph
 
Reported: 2018-12-17 09:43 UTC by vivien.guillet
Modified: 2022-05-03 11:29 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description vivien.guillet 2018-12-17 09:43:18 UTC
Description:
Custom operators defined using "oper", "uoper" and "boper" having more than one letter shows in equation editor, but only first letter is exported in mathml.

Steps to Reproduce:

Steps to Reproduce:
1. type "uoper OP x" in formula editor
2. save document
3. examine mathml in odf document


Actual Results:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
    <semantics>
        <mrow>
            <mo stretchy="false">O</mo><mi>x</mi>
        </mrow>
        <annotation encoding="StarMath 5.0">uoper OP x</annotation>
    </semantics>
</math>


Expected Results:
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
    <semantics>
        <mrow>
            <mo stretchy="false">OPER</mo><mi>x</mi>
        </mrow>
        <annotation encoding="StarMath 5.0">uoper OP x</annotation>
    </semantics>
</math>



Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 vivien.guillet 2018-12-17 09:59:57 UTC
Version: 5.2.7.2 (debian)
Comment 2 Regina Henschel 2018-12-17 16:58:30 UTC
Yes, that is a missing feature.
Comment 3 vivien.guillet 2018-12-18 22:24:17 UTC
I think this is related to the function

void SmXMLExport::ExportMath(const SmNode *pNode, int /*nLevel*/)

in starmath/source/mathmlexport.cxx

where the nArse unicode string is explicitly truncated after the first char.
Comment 4 dante19031999 2020-11-18 15:58:11 UTC
(In reply to vivien.guillet from comment #3)
> I think this is related to the function
> 
> void SmXMLExport::ExportMath(const SmNode *pNode, int /*nLevel*/)
> 
> in starmath/source/mathmlexport.cxx
> 
> where the nArse unicode string is explicitly truncated after the first char.

Thanks you for locating the issue. Along this I also want to solve the &charname; thing, whose issue is related with and exception thown in the XML parser when charname is not recognized. That way I can completly handle multichar operators.
Also, when reimporting it doesn't work. That also has to be solved. I need to check mathml standars to checkout how it should be exported.
It gonna take a little time figuring it out.
Comment 5 Xisco Faulí 2022-05-03 11:29:24 UTC
Dear Dante,
This bug has been in ASSIGNED status for more than 3 months without any
activity. Resetting it to NEW.
Please assign it back to yourself if you're still working on this.