Issue 121221 - SVG file not rendered correctly - style in grouping overrides too much?
SVG file not rendered correctly - style in grouping overrides too much?
Status: CLOSED FIXED
Product: Writer
Classification: Application
Component: open-import
3.4.1
PC Mac OSX, 10.7
: P3 normal (vote)
: 4.0.0
Assigned To: Armin Le Grand
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-15 15:27 UTC by Anders Sjöström
Modified: 2013-07-12 16:26 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation on: ---
Developer Difficulty: ---


Attachments
Wrong.svg (15.45 KB, image/svg+xml)
2012-10-15 15:27 UTC, Anders Sjöström
no flags Details
Correct.svg (15.57 KB, image/svg+xml)
2012-10-15 15:27 UTC, Anders Sjöström
no flags Details
Inkscape XML Editor.png (73.82 KB, image/png)
2012-10-15 15:28 UTC, Anders Sjöström
no flags Details
OpenOffice_rendering.png (8.31 KB, image/png)
2012-10-15 15:28 UTC, Anders Sjöström
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Anders Sjöström 2012-10-15 15:27:20 UTC
Created attachment 79777 [details]
Wrong.svg

I have found a SVG file that is rendered differently in Open Office than in Firefox 16 or Inkscape 0.48 etc. This is the file Wrong.svg. Note that the rectangle should not be dashed. I use Insert->Picture-From file... to import it.

I have removed a grouping from the file, and after that the file renders as expected. This file is Correct.svg.

Look at the picture OpenOffice_rendering.png which demonstrates how OpenOffice renders the files for me. In other tools both files renderes as the top one.

Look at the picture Inkscape XML Editor.png which shows the attributes present on the grouping tag that only the troubled SVG file has. It would seem that it is the one thing that causes the problem.

Both SVG files are created by Inkscape, saved as plain svg.
Comment 1 Anders Sjöström 2012-10-15 15:27:49 UTC
Created attachment 79778 [details]
Correct.svg
Comment 2 Anders Sjöström 2012-10-15 15:28:12 UTC
Created attachment 79779 [details]
Inkscape XML Editor.png
Comment 3 Anders Sjöström 2012-10-15 15:28:33 UTC
Created attachment 79780 [details]
OpenOffice_rendering.png
Comment 4 Regina Henschel 2012-10-15 16:35:53 UTC
I see the error too in AOO r1397615 on WinXP.
Comment 5 Armin Le Grand 2012-10-16 11:24:03 UTC
ALG: Taking over, need to check this.
Comment 6 Armin Le Grand 2012-10-30 15:05:27 UTC
ALG: Anders, good catch! The StrokeDasharrays were imported correctly with the styles, but their state were used inconsequently. Being empty made the get method to look for the parent, so it indicated that it was *not* set. The 'none' case was not recognized this way and the parent style was used.
I have added a boolean to the styles to be able to remember when the StrokeDasharray was set to empty by purpose, in that case the get method will no longer travel the parent style chain to find a set StrokeDasharray. All works well then.
Looked for some other 'none' defines in SVG1.2, but seems to be okay.
Comment 7 SVN Robot 2012-10-30 15:06:18 UTC
"alg" committed SVN revision 1403730 into trunk:
#121221# added boolean state to remember when the StrokeDasharray was set to ...
Comment 8 Armin Le Grand 2012-10-30 15:06:36 UTC
ALG: Okay, done.
Comment 9 Li Feng Wang 2012-11-08 06:25:57 UTC
Verified pass, can render this svg normally as firefox.