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 2012/01/14 17:15:16 UTC

DO NOT REPLY [Bug 118783] New: svg export produces invalid file

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

             Bug #: 118783
        Issue Type: DEFECT
           Summary: svg export produces invalid file
    Classification: Application
           Product: Drawing
           Version: current
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P5
         Component: save-export
        AssignedTo: graphicsneedsconfirm@openoffice.org
        ReportedBy: rb.henschel@t-online.de
                CC: ooo-issues@incubator.apache.org


Created attachment 77131
  --> https://issues.apache.org/ooo/attachment.cgi?id=77131
Source for the svg file.

Open the attached document and export the combined rectangles to svg. I get the
attached result.

It is not valid, because
(1) an id value must be unique, but is assigned twice.
(2) an id value must not contain the characters ( or ) .

-- 
Configure bugmail: https://issues.apache.org/ooo/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

DO NOT REPLY [Bug 118783] svg export produces invalid file

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

--- Comment #3 from Regina Henschel <rb...@t-online.de> 2012-01-14 19:23:35 UTC ---
There is no need for the second path element for the inner stroke, because svg
handles elements with more then one closed subpath as AOO handles polypolygons.
So on export it is sufficient to export the polypolygon itself. And with the
new svg import those paths are shown correct too. So I suggest to drop the
additional path element as solution for problem (1).

-- 
Configure bugmail: https://issues.apache.org/ooo/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

DO NOT REPLY [Bug 118783] svg export produces invalid file

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

--- Comment #1 from Regina Henschel <rb...@t-online.de> 2012-01-14 16:16:17 UTC ---
Created attachment 77132
  --> https://issues.apache.org/ooo/attachment.cgi?id=77132
result of export to svg

-- 
Configure bugmail: https://issues.apache.org/ooo/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

DO NOT REPLY [Bug 118783] svg export produces invalid file

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

Armin Le Grand <Ar...@me.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |STARTED

--- Comment #4 from Armin Le Grand <Ar...@me.com> 2012-01-16 10:45:44 UTC ---
ALG: Doing what is explained does not export the original Svg file, but uses
the built-in existing Svg exporter, so the exported Svg will not be equal to
the original one. To export the original one, use 'Save as Picture...' in the
context menu of the graphic object.

ALG: Looking at the existing Svg export...

-- 
Configure bugmail: https://issues.apache.org/ooo/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

DO NOT REPLY [Bug 118783] svg export produces invalid file

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

Armin Le Grand <Ar...@me.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Armin.Le.Grand@me.com
         AssignedTo|graphicsneedsconfirm@openof |Armin.Le.Grand@me.com
                   |fice.org                    |

--- Comment #2 from Armin Le Grand <Ar...@me.com> 2012-01-14 18:09:17 UTC ---
ALG: Taking alook...

-- 
Configure bugmail: https://issues.apache.org/ooo/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

DO NOT REPLY [Bug 118783] svg export produces invalid file

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

--- Comment #6 from Armin Le Grand <Ar...@me.com> 2012-01-16 12:37:25 UTC ---
ALG: (1) is tricky; The current Svg exporter works using Metafiles, not
primitives. In Metafiles the stroke actions (even the SvtGraphicStroke helper
in the comment action) use no PolyPolygon, but single polygons. Thus, the
resulting Metafile has thee basic polygon actions:
- the filled PolyPolygon
- the outer stroke polygon
- the inner stroke polygon
what is correct so far. The Svg exporter tries to combine the 1st
SvtGraphicFill with the 2nd SvtGraphicStroke WITHOUT comparing the paths on
equality, thus the 1st and 2nd action get combined to one path statement in the
export. The 3rd starts a new path segment, this time only stroked.

The error happens in the Svg exporter; it cannot combine PolyPolygon fill with
Polygon stroke actions (also to mark: basing the Svg exporter to primitives
would also solve this). Thus, in the case of stroked PolyPolygons it will
either be possible to more intelligently combine those or not.

Checking if this is possible; it's not planned to be done, this can be read
from looking at the code...

-- 
Configure bugmail: https://issues.apache.org/ooo/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

DO NOT REPLY [Bug 118783] svg export produces invalid file

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

--- Comment #5 from Armin Le Grand <Ar...@me.com> 2012-01-16 12:07:38 UTC ---
ALG: (2) Seems to be correct, checked
(http://www.w3.org/TR/2008/REC-xml-20081126/#NT-Name). I think about replacing
'(' and ')' by just '_'.

(1) Is more complicated: The 1st path is already the PolyPolygon suggested (see
the 'Z' statements in svg:d or delete 2nd path in an editor). The question is
more why the 2nd path is written at all, describing the inner polygon of a
PolyPolygon. Investigating...

-- 
Configure bugmail: https://issues.apache.org/ooo/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

DO NOT REPLY [Bug 118783] svg export produces invalid file

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

--- Comment #7 from Armin Le Grand <Ar...@me.com> 2012-01-16 14:24:28 UTC ---
ALG: Solved (1) by forcing write of fill data when stroke data is not equal,
also need to add a 2nd number to the ID since ID is not only object number but
multiple svg elements could be written per shape. Solved (2) by using '_'
instead of '(' and ')'. Also made 'Z' svg:d creation dependent of closed state
of the tool spolygon (1st and last point are equal), not only on fill and/or
line. Also had to be very careful for polygon comarison; operator== does not do
what YOu expect, there is a method IsEqual() instead. Argh! Old classes...

-- 
Configure bugmail: https://issues.apache.org/ooo/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

DO NOT REPLY [Bug 118783] svg export produces invalid file

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

Armin Le Grand <Ar...@me.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|STARTED                     |RESOLVED
         Resolution|                            |FIXED

--- Comment #8 from Armin Le Grand <Ar...@me.com> 2012-01-16 14:31:08 UTC ---
ALG: Comitted, done.

-- 
Configure bugmail: https://issues.apache.org/ooo/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.