https://bugs.documentfoundation.org/show_bug.cgi?id=99556

--- Comment #2 from Sergey Zelenyuk <[email protected]> ---
The cause of problem is in mathmlimport.cxx.

// ...
void SmXMLSqrtContext_Impl::EndElement()
{
    /*
    <msqrt> accepts any number of arguments; if this number is not 1, its
    contents are treated as a single "inferred <mrow>" containing its
    arguments
    */
    if (GetSmImport().GetNodeStack().size() - nElementCount > 1)
        SmXMLRowContext_Impl::EndElement();
// ...

If <msqrt> has more than one children they will be handled inside a <mrow>, but
it should also be done if there is no child.

- GetSmImport().GetNodeStack().size() - nElementCount > 1
+ GetSmImport().GetNodeStack().size() - nElementCount != 1

Not only msqrt affect to this problem but also mphantom, menclose, mstyle,
mpadded and several attributes such as fontweight. Unlike msqrt, they will not
crash the program now because they have no code deals with children in their
EndElement functions, but they can do it in future.

mphantom and font attributes have been fixed in
https://bugs.documentfoundation.org/show_bug.cgi?id=98088. The fix adds a code
which checks number of children but the cause of problem remains.

menclose, mstyle and mpadded aren't cause a crash because they have no code in
mathmlimport.cxx which works with children elements but the problem at the
place anyway.

Summarize. How to fix the cause:
1) msqrt. See above.
2) mphantom, menclose, mstyle, mpadded and font attributes. Same changes as
with msqrt should be done but in other functions:
SmXMLPhantomContext_Impl::EndElement
SmXMLEncloseContext_Impl::EndElement
SmXMLStyleContext_Impl::EndElement
SmXMLPaddedContext_Impl::EndElement

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to