Bug 98599

Summary: SVG: attributes of defs are not considered, but childs may inherit them
Product: LibreOffice Reporter: Regina Henschel <rb.henschel>
Component: DrawAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: h3734236, xiscofauli
Priority: medium Keywords: filter:svg
Version: 3.3.4 release   
Hardware: All   
OS: All   
Whiteboard: target:5.2.0
Crash report or crash signature: Regression By:
Attachments: inheritance from a attribute of defs
inheritance from a style attribute of defs

Description Regina Henschel 2016-03-11 10:40:30 UTC
Created attachment 123493 [details]
inheritance from a attribute of defs

The defs element acts same as the g element in regard to inheritance. Therefore its attributes have to be considered.

In the attached file (see also bug 47446) the middle marker has no own fill attribute but inherits it from the defs element and therefore it should be filled yellow.
Comment 1 Regina Henschel 2016-03-11 10:41:04 UTC
Created attachment 123494 [details]
inheritance from a style attribute of defs
Comment 2 Regina Henschel 2016-03-14 23:47:22 UTC
It seems, that it is in the case distinction

     if (SVGTokenDefs == getType())

in SvgGNode::getSvgStyleAttributes()

If I use

   return checkForCssStyle("defs", maSvgStyleAttributes);

in case SVGTokenDefs, then I get the yellow fill inherit from the defs element to the marker.

@XISCO: Do you see any problems with this solution?
Comment 3 Commit Notification 2016-03-17 07:45:58 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=f5d4a688346a939a58b1df69d771dede177b3370

tdf#98599 SVG: consider attributes of 'defs' element

It will be available in 5.2.0.

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:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2016-04-12 22:03:31 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=de32fe50299a8891102528379e291919d2b66f56

SVG: Add unittest for tdf#47446 and tdf#98599

It will be available in 5.2.0.

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:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.