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 2015/04/08 20:44:22 UTC

[Issue 126230] New: Current type detection is too restrict

https://bz.apache.org/ooo/show_bug.cgi?id=126230

          Issue ID: 126230
        Issue Type: ENHANCEMENT
           Summary: Current type detection is too restrict
           Product: Math
           Version: 4.2.0-dev
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: P5
         Component: code
          Assignee: issues@openoffice.apache.org
          Reporter: rb.henschel@t-online.de

The current type detection refuses a MathML file, if there exists no <?xml
declaration. But such declaration is not needed for valid MathML.

The SAX parser itself can parse MathML files without such declaration. The
parser needs only a math root element with the MATHML namespace URL.

-- 
You are receiving this mail because:
You are the assignee for the issue.

[Issue 126230] Current type detection is too restrict

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

Matthias Seidel <ms...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mseidel@apache.org
   Target Milestone|---                         |4.2.0

-- 
You are receiving this mail because:
You are the assignee for the issue.

[Issue 126230] Current type detection is too restrict

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

--- Comment #9 from SVN Robot <sv...@dev.null.org> ---
"regina" committed SVN revision 1675478 into trunk:
#i126230 current Math type detection is too restrict

-- 
You are receiving this mail because:
You are the assignee for the issue.

[Issue 126230] Current type detection is too restrict

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

Regina Henschel <rb...@t-online.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #84655|                            |review?
              Flags|                            |

--- Comment #1 from Regina Henschel <rb...@t-online.de> ---
Created attachment 84655
  --> https://bz.apache.org/ooo/attachment.cgi?id=84655&action=edit
change detection from <?xml to <math

The part for detecting MathML has been changed totally, so please have a look.
Please test it on Linux and MacOS, because I have only Windows.

The detections accepts now - both for "Open" and "Tool>Import Formula.." -
MathML files, if they have a math-Element with MathML namespace attribute. It
accepts both the default utf-8 encoding and utf-16 encoding as well. I have not
seen other encodings, so others are currently not considered.

The MathML files need no <?xml prolog to be excepted. Because it does not
consider the <?xml prolog, but only looks for the math element, the issue
#124636 is still fixed. If the MathML part is embedded in xhtml or other xml,
it opens still in module Math, if the MathML part is inside the first 4096
bytes.

The utf-16 encoding is used by Microsoft "Math Input Control", which puts the
MathML into the clipboard. [My dream is, that AOO can insert such formula from
clipboard.]

-- 
You are receiving this mail because:
You are the assignee for the issue.

[Issue 126230] Current type detection is too restrict

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

Matthias Seidel <ms...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.2.0                       |4.1.16

-- 
You are receiving this mail because:
You are the assignee for the issue.

[Issue 126230] Current type detection is too restrict

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

Regina Henschel <rb...@t-online.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #84655|0                           |1
        is obsolete|                            |
  Attachment #84673|                            |review?
              Flags|                            |

--- Comment #6 from Regina Henschel <rb...@t-online.de> ---
Created attachment 84673
  --> https://bz.apache.org/ooo/attachment.cgi?id=84673&action=edit
improving detection of MathML

This is my final version of the patch. It has this goals:

Make it possible to open and import MathML fragments, which have only the math
element body. That makes it easier for users to reuse formulas from external
libraries.

Make it possible to open and import MathML files with any prefix on the math
element. OOo1.15 had used prefix "math", MS Office uses prefix "mml", other
prefixes are possible.

Detect MathML files, which are UTF-16 encoded. The MS Math Input Panel puts
such files into the clipboard.

The patch tries to open all files in Math, which the parser can parse in Math
context. If you find a file, that will be detected as "MathML", but the parser
is not able to open, inform me and attach the file. Such case would result in
an "General input/output error".

-- 
You are receiving this mail because:
You are the assignee for the issue.

[Issue 126230] Current type detection is too restrict

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

Regina Henschel <rb...@t-online.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #84655|review?                     |review-
              Flags|                            |

--- Comment #4 from Regina Henschel <rb...@t-online.de> ---
Comment on attachment 84655
  --> https://bz.apache.org/ooo/attachment.cgi?id=84655
change detection from <?xml to <math

A better patch will follow.

-- 
You are receiving this mail because:
You are the assignee for the issue.

[Issue 126230] Current type detection is too restrict

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

--- Comment #7 from Kay <ks...@apache.org> ---
Still on Linux-32.

I applied the improved patch today (I pulled out the other one) and checked out
some of test cases -- esp utf-16 vs utf-8. So far, so good! :) These test cases
were very helpful and I think it would be a good idea to set up a new area
under "test" -- http://svn.apache.org/viewvc/openoffice/trunk/test/ -- for
them.

Good job! :)

-- 
You are receiving this mail because:
You are the assignee for the issue.

review requested: [Issue 126230] Current type detection is too restrict : [Attachment 84673] improving detection of MathML

Posted by bu...@apache.org.
Regina Henschel <rb...@t-online.de> has asked  for review:
Issue 126230: Current type detection is too restrict
https://bz.apache.org/ooo/show_bug.cgi?id=126230

Attachment 84673: improving detection of MathML
https://bz.apache.org/ooo/attachment.cgi?id=84673&action=edit



--- Comment #6 from Regina Henschel <rb...@t-online.de> ---
Created attachment 84673
  --> https://bz.apache.org/ooo/attachment.cgi?id=84673&action=edit
improving detection of MathML

This is my final version of the patch. It has this goals:

Make it possible to open and import MathML fragments, which have only the math
element body. That makes it easier for users to reuse formulas from external
libraries.

Make it possible to open and import MathML files with any prefix on the math
element. OOo1.15 had used prefix "math", MS Office uses prefix "mml", other
prefixes are possible.

Detect MathML files, which are UTF-16 encoded. The MS Math Input Panel puts
such files into the clipboard.

The patch tries to open all files in Math, which the parser can parse in Math
context. If you find a file, that will be detected as "MathML", but the parser
is not able to open, inform me and attach the file. Such case would result in
an "General input/output error".

[Issue 126230] Current type detection is too restrict

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

Regina Henschel <rb...@t-online.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |53509

-- 
You are receiving this mail because:
You are the assignee for the issue.

[Issue 126230] Current type detection is too restrict

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

--- Comment #3 from Regina Henschel <rb...@t-online.de> ---
Thanks for testing. I have further improved the patch. I will attach a new
version of the patch and test documents tomorrow (it's already after midnight
here ).

-- 
You are receiving this mail because:
You are the assignee for the issue.

review requested: [Issue 126230] Current type detection is too restrict : [Attachment 84655] change detection from Posted by bu...@apache.org.
Regina Henschel <rb...@t-online.de> has asked  for review:
Issue 126230: Current type detection is too restrict
https://bz.apache.org/ooo/show_bug.cgi?id=126230

Attachment 84655: change detection from <?xml to <math
https://bz.apache.org/ooo/attachment.cgi?id=84655&action=edit



--- Comment #1 from Regina Henschel <rb...@t-online.de> ---
Created attachment 84655
  --> https://bz.apache.org/ooo/attachment.cgi?id=84655&action=edit
change detection from <?xml to <math

The part for detecting MathML has been changed totally, so please have a look.
Please test it on Linux and MacOS, because I have only Windows.

The detections accepts now - both for "Open" and "Tool>Import Formula.." -
MathML files, if they have a math-Element with MathML namespace attribute. It
accepts both the default utf-8 encoding and utf-16 encoding as well. I have not
seen other encodings, so others are currently not considered.

The MathML files need no <?xml prolog to be excepted. Because it does not
consider the <?xml prolog, but only looks for the math element, the issue
#124636 is still fixed. If the MathML part is embedded in xhtml or other xml,
it opens still in module Math, if the MathML part is inside the first 4096
bytes.

The utf-16 encoding is used by Microsoft "Math Input Control", which puts the
MathML into the clipboard. [My dream is, that AOO can insert such formula from
clipboard.]

[Issue 126230] Current type detection is too restrict

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

--- Comment #5 from Regina Henschel <rb...@t-online.de> ---
Created attachment 84672
  --> https://bz.apache.org/ooo/attachment.cgi?id=84672&action=edit
A collection with examples.

-- 
You are receiving this mail because:
You are the assignee for the issue.

[Issue 126230] Current type detection is too restrict

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

--- Comment #8 from Regina Henschel <rb...@t-online.de> ---
Thank you Kay for looking again. I'm pleased, that you like it.

Regarding directory "test", I'm not familiar with that testing and don't know
what needs to be done. The test cases are constantly available here in
Bugzilla.

-- 
You are receiving this mail because:
You are the assignee for the issue.

[Issue 126230] Current type detection is too restrict

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

damjan@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Issue Type|ENHANCEMENT                 |PATCH
         Resolution|---                         |FIXED
                 CC|                            |damjan@apache.org
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #10 from damjan@apache.org ---
The patch was committed long ago, and latest trunk successfully opens MathML
files without having:
<?xml version="1.0" encoding="utf-8"?>
as their first line. Old versions of AOO give the ASCII filter dialog instead.

Thus resolving FIXED. Thank you for your bug report and patch Regina!

-- 
You are receiving this mail because:
You are the assignee for the issue.

[Issue 126230] Current type detection is too restrict

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

Kay <ks...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kschenk@apache.org

--- Comment #2 from Kay <ks...@apache.org> ---
(In reply to Regina Henschel from comment #1)
> Created attachment 84655 [details]
> change detection from <?xml to <math
> 
> The part for detecting MathML has been changed totally, so please have a
> look. Please test it on Linux and MacOS, because I have only Windows.
> 
> The detections accepts now - both for "Open" and "Tool>Import Formula.." -
> MathML files, if they have a math-Element with MathML namespace attribute.
> It accepts both the default utf-8 encoding and utf-16 encoding as well. I
> have not seen other encodings, so others are currently not considered.
> 
> The MathML files need no <?xml prolog to be excepted. Because it does not
> consider the <?xml prolog, but only looks for the math element, the issue
> #124636 is still fixed. If the MathML part is embedded in xhtml or other
> xml, it opens still in module Math, if the MathML part is inside the first
> 4096 bytes.
> 
> The utf-16 encoding is used by Microsoft "Math Input Control", which puts
> the MathML into the clipboard. [My dream is, that AOO can insert such
> formula from clipboard.]

Thanks for your changes.

Builds fine for me on Linux-32. But I don't really have test documents.
Can you provide some as attachment?

-- 
You are receiving this mail because:
You are the assignee for the issue.

review denied: [Issue 126230] Current type detection is too restrict : [Attachment 84655] change detection from Posted by bu...@apache.org.
Regina Henschel <rb...@t-online.de> has denied Regina Henschel
<rb...@t-online.de>'s request for review:
Issue 126230: Current type detection is too restrict
https://bz.apache.org/ooo/show_bug.cgi?id=126230

Attachment 84655: change detection from <?xml to <math
https://bz.apache.org/ooo/attachment.cgi?id=84655&action=edit



--- Comment #4 from Regina Henschel <rb...@t-online.de> ---
Comment on attachment 84655
  --> https://bz.apache.org/ooo/attachment.cgi?id=84655
change detection from <?xml to <math

A better patch will follow.

[Issue 126230] Current type detection is too restrict

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

--- Comment #11 from Matthias Seidel <ms...@apache.org> ---
Cherry-picked for AOO41X with:
https://github.com/apache/openoffice/commit/32ee43316e9a5c31ed7374e555bc02879e2f8282

-- 
You are receiving this mail because:
You are the assignee for the issue.