Created attachment 85719 [details]
Particular SVG picture showing the regression and screenshots
As of version 4.1.1 (possibly earlier) SVG picture "Background - Gray.svg", found in attached zip archive, is not displayed correctly when inserted in LO Writer document.
Steps to reproduce:
1. Open the "Front_page.odt" document found in attached zip archive.
In version 4.1.1 of LO Writer the picture is displayed in color instead of light gray. The light gray version of the picture was done by "coloring" colored version of the picture in light gray using Inkscape. As a result of that, light gray color was defined explicitly in "style=" but the original color was left defined in "class=". Here is an example from attached SVG:
where class "fil24" is defined as:
In attached zip archive you will find screenshots of the document displayed in LO Writer version 4.0.5 and 4.1.1. It seems that "class=" is taking precedence over "style=" so picture is displayed colored instead of light gray.
The SVG picture is displayed correctly (light gray) in version 4.1.1 of LO Draw so only Writer is affected
Attached SVG picture should be displayed light gray.
Operating System: Ubuntu
Version: 22.214.171.124 release
Partially reproduced with LibO 126.96.36.199 on Win7. The following cases fail (i.e. the drawing is colored):
- drag&drop the "Background - Gray.svg" file into an opened Writer
- loading this file with "Insert > Image > From file" into Writer,
- loading this file with "Insert > Image > From file" into Calc,
- drag&drop that file into an opened Draw
- loading this file with "Insert > Image > From file" into Draw
Opening the "Front_page.odt" with Writer also fails.
Note that the Windows icon associated with the "Front_page.odt" is grey, not colored. I'm not sure if my computer drawn it or if I got it with your file in the ZIP container.
The attached .svg file does not validate in http://validator.w3.org
If you do not use the special "inkscape svg" with all its special namespaces, but use normal standard svg, then the graphic is shown correctly.
Dear Dominique, thanks for bug confirmation.
SVG being valid or not is not an issue here. SVG parser should ignore everything it does not understand (ie. Inskscape specific things). If you convert attached SVG to "standard svg" then it's displayed correctly but only because Inkscape removes CSS classes from SVG and leaves "style" attributes. Both "class" and "style" attributes are standard, not Inkscape specifc. Take a look at:
sections 6.11 and 6.12
Here, I'll attach a simple version of the SVG picture that is completely valid and does not have anything Inkscape specific but still causes the same bug - "class" attribute is taking precedence over "style" attribute.
Created attachment 87887 [details]
Simple version of the SVG picture
The style attribute has a higher specificity than the class selector. Therefore the rules of the style attribute has to be used.
Dear Bojan, examples files should not contain more than needed to understand the problem and reproduce the bug. Therefore I was annoyed to get a more than 2000 lines long file.
Created attachment 87899 [details]
example with class, only style attribute and both
Sorry for the large (and bad) example files but I was short on time and not too eager to dive into "misteries of SVG". I hope that it's clear now what the bug is all about :).
so LO 188.8.131.52 preferred the style, whereas LO 4.1.x all prefer the class.
this was fixed in LO 4.2.0 by this commit:
Author: Armin Le Grand <firstname.lastname@example.org>
AuthorDate: Wed Oct 30 11:22:20 2013 +0000
Resolves: #i123510# changed priority in style preparation
... and introduced in 4.1.0 by this one:
Author: Armin Le Grand <email@example.com>
AuthorDate: Wed Jul 25 08:28:44 2012 +0000
Fix #120334# Added support for multiple CSS styles per graphic primitive
thanks Regina for getting this fixed :)
Armin Le Grand committed a patch related to this issue.
It has been pushed to "libreoffice-4-1":
Resolves: fdo#69271 i#123510 changed priority in style preparation
It will be available in LibreOffice 4.1.6.
The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
Affected users are encouraged to test the fix and report feedback.
I can confirm it's fixed in LO 4.2.
Thank you all!