You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openoffice.apache.org by bu...@apache.org on 2014/02/18 20:05:20 UTC

[Bug 124259] New: mathvariant="normal" is ignored on import of .mml file

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

            Bug ID: 124259
        Issue Type: DEFECT
           Summary: mathvariant="normal" is ignored on import of .mml file
           Product: Math
           Version: 4.1.0-dev
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: code
          Assignee: issues@openoffice.apache.org
          Reporter: rb.henschel@t-online.de
                CC: issues@openoffice.apache.org

Created attachment 82621
  --> https://issues.apache.org/ooo/attachment.cgi?id=82621&action=edit
File as exported by AOO but with removed annotation element

Open the attached file. It will open in Math.
The formula should look like
  int {func e^x nospace{nitalic d x}}
and does so in Browser.
But AOO imports it as
  int  {e^x {d x}}

The upright orientation of 'func e' and 'nitalic d' had been correctly written
as attribute mathvariant="normal" on export. But this attribute is ignored when
reading the file.

-- 
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.

[Bug 124259] mathvariant="normal" is ignored on import of .mml file

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=124259

--- Comment #2 from Edwin Sharp <el...@apache.org> ---
Created attachment 82625
  --> https://issues.apache.org/ooo/attachment.cgi?id=82625&action=edit
screenshot of original document

-- 
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.

[Bug 124259] mathvariant="normal" is ignored on import of .mml file

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=124259

Edwin Sharp <el...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|needmoreinfo                |
             Status|UNCONFIRMED                 |CONFIRMED
             Latest|---                         |4.1-dev
    Confirmation on|                            |
     Ever confirmed|0                           |1

--- Comment #3 from Edwin Sharp <el...@apache.org> ---
Sorry for misunderstanding.

-- 
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.

[Bug 124259] mathvariant="normal" is ignored on import of .mml file

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=124259

--- Comment #7 from Andre <aw...@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.

[Bug 124259] mathvariant="normal" is ignored on import of .mml file

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=124259

Edwin Sharp <el...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |needmoreinfo
                 CC|                            |elish@apache.org

--- Comment #1 from Edwin Sharp <el...@apache.org> ---
Can not reproduce
Both Math and iceweasel 24.2.0 show the same
AOO410m1(Build:9750)  -  Rev. 1566800
2014-02-11_04:11:01 - Rev. 1566981
Debian

-- 
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.

[Bug 124259] mathvariant="normal" is ignored on import of .mml file

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=124259

--- Comment #6 from Regina Henschel <rb...@t-online.de> ---
No, it is not a font problem. Look into menu Font in module Math. Variables and
Text are written in usual fonts, e.g. "Times New Roman", but set Variables are
set in italic, whereas Text is set upright.

Please look into the command window. The characters e, d and x are identifier
elements (mi) in MML and therefore correspond to the category "Variables".
Therefore you see them italic. But the attribute mathvariant="normal" forces a
upright setting. But this attribute of MML is ignored. The corresponding
command in StarMath would be nitalic.

The translation of MML
<mi mathvariant="normal">e</mi>
to StarMath should be
nitalic e.

-- 
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.

[Bug 124259] mathvariant="normal" is ignored on import of .mml file

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=124259

--- Comment #8 from Andre <aw...@googlemail.com> ---
Ah, I found the reason why the mathvariant="normal" is ignored on input: It is
a construct from MathML 2, while AOO only supports MathML 1.1.  MathML 1.1 has
only the 'fontstyle' attribute, which is deprecated in MathML 2.

So, changing the tag
  <mi mathvariant="normal">
to
  <mi fontstyle="normal">
would make the importer correctly set the nIsItalic flag.  But only to be
ignored in SmXMLIdentifierContext_Impl::EndElement() because the text it
applies to is only one character long.


A possible fix for this bug could look like this:

- Fix the bug doc to conform to MathML 1.1

- Remove the rule from EndElement() that ignores the MathML instructions in
certain cases.

-- 
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.

[Bug 124259] mathvariant="normal" is ignored on import of .mml file

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=124259

Andre <aw...@googlemail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |awf.aoo@googlemail.com

--- Comment #5 from Andre <aw...@googlemail.com> ---
Maybe this is a font problem?  No math font with upright characters available?
Can anybody reproduce this on Windows or Mac?

-- 
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.

[Bug 124259] mathvariant="normal" is ignored on import of .mml file

Posted by bu...@apache.org.
https://issues.apache.org/ooo/show_bug.cgi?id=124259

Rainer Bielefeld <ra...@bielefeldundbuss.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rainerbielefeld_ooo_qa@biel
                   |                            |efeldundbuss.de
            Version|4.1.0-dev                   |OOo 3.3 or older

--- Comment #4 from Rainer Bielefeld <ra...@bielefeldundbuss.de> ---
I am not familiar with correct translation of
<http://www.w3.org/1998/Math/MathML/> to ODF, but I see the result, some more
characters in italic than should be (see attached screenshot comparison).

Not a new problem, already visible with OOo 3.1.1, 2.0.2, 1.1.5

-- 
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.