https://issues.apache.org/ooo/show_bug.cgi?id=124259

--- Comment #7 from Andre <awf....@googlemail.com> ---
As usual the implementation is stranger than one might think.  The relevant
code part is SmXMLIdentifierContext_Impl::EndElement() in
starmath/source/mathmlimport.cxx.

- The italic state is represented in an object of SmXMLContext_Helper as
nIsItalic.  Its type is sal_Int8 and seems to be used as a boolean value with
values -1 for true and 0 for false.

- The (not) italic flag in the MathML file seems to be ignored completely.  The
nIsItalic flag is -1 (true) for all identifiers in the formula.

- There is a hard coded rule in EndElement() that looks like this:

    if (((aStyleHelper.nIsItalic == -1) && (aToken.aText.Len() > 1))
        || ((aStyleHelper.nIsItalic == 0) && (aToken.aText.Len() == 1)))
    {
        pNode = new SmTextNode(aToken,FNT_FUNCTION);
        pNode->GetFont().SetItalic(ITALIC_NONE);
        aStyleHelper.nIsItalic = -1;
    }
    else
        pNode = new SmTextNode(aToken,FNT_VARIABLE);

The typographical rule is not unusual (multiletter names (like function names)
upright, single letter names (like variable names) italic).  It is just the
wrong place to enforce it.


That means that the single letter variables, function names and operators in
the bug doc are forced to italic because 
a) the flag for using upright font for 'e' and 'd' is ignored when the XML text
is read and
b) it is ignored also when text node for the internal formula representation is
created.


I made an experiment by changing the names in the bug doc from 'e' to 'ee' and
'd' to 'dd' and they are displayed upright.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.
You are watching all bug changes.

Reply via email to