Bug 122151

Summary: Only first letter of custom operator exported in mathml
Product: LibreOffice Reporter: vivien.guillet
Component: Formula EditorAssignee: Not Assigned <libreoffice-bugs>
Status: NEW ---    
Severity: enhancement CC: himajin100000, rb.henschel, xiscofauli
Priority: medium    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 118765    

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.