Issue 125258

Summary: [SVG] svg node does not consider styles from a style element
Product: Draw Reporter: Regina Henschel <rb.henschel>
Component: open-importAssignee: Armin Le Grand <Armin.Le.Grand>
Status: CLOSED FIXED QA Contact:
Severity: Normal    
Priority: P3 CC: Armin.Le.Grand, jsc
Version: 4.1.0Flags: jsc: 4.1.1_release_blocker+
Target Milestone: 4.1.1   
Hardware: All   
OS: Windows 7   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
Test files with g and with svg as parent
none
Similar solution as in svggnode.cxx none

Description Regina Henschel 2014-07-15 11:26:15 UTC
Created attachment 83691 [details]
Test files with g and with svg as parent

The svg node does not consider styles given in a style element.

Open the attachment and insert the given svg-graphics into a Draw document. Notice, that in case of the g element the style is found, but in case of the svg element not.
Comment 1 Armin Le Grand 2014-07-15 16:36:49 UTC
Got it. Investigating...
Comment 2 Regina Henschel 2014-07-15 17:11:47 UTC
Created attachment 83694 [details]
Similar solution as in svggnode.cxx

The attached patch would solve this singular problem, but please look at issue 125259 [SVG] inherit style from rule in style element makes AOO freeze. I guess there is something more not correct.
Comment 3 Armin Le Grand 2014-07-16 08:44:47 UTC
SvgSvgNode::getSvgStyleAttributes() is one part of the solution; it will make the svg main element find it's CssStyle (if any). It is not sufficient since from the found element carrying the CssStyle (a style element) the parent would be the svg node again, leading to a loop of parent stales. So there has to be a mechanism added which breaks this potential loop.
There are more problems when using this.
The initialization of the style from the outmost svg element needs to be handled, default is black filled. When this element uses a CssStyle this (and potentially others) are not allowed to be set since as a hard attribute would hide the CssStyle setting from this (e.g. RectWithParentStyles.svg).
Also SvgGNode represents defs and g elements, thus some methods have to handle things different if it's not a group (getSvgStyleAttributes, decomposeSvgNode).
Added this changes, all docs from bugdoc of Issue 125254 load as expected, the crash is fixed, too.
Douing some more tests...
Comment 4 Armin Le Grand 2014-07-16 09:40:09 UTC
Checked with all my test files, preparing checkin...
Comment 5 SVN Robot 2014-07-16 09:42:11 UTC
"alg" committed SVN revision 1610953 into trunk:
i125258 reworked some of the style hierarchy stuff
Comment 6 Armin Le Grand 2014-07-16 09:43:34 UTC
Okay, done.
Comment 7 Armin Le Grand 2014-07-17 08:25:19 UTC
Since one of the test files from issue 125254 leads to a crash (endless loop) I would like to consider this fix for AOO411: It fixes a crash, it is not a regression, it is limited to and tested with SVG import.
Comment 8 jsc 2014-07-17 09:01:15 UTC
grant showstopper flag, potential crash and fix available
Comment 9 Armin Le Grand 2014-07-18 09:00:56 UTC
Merged to AOO411, checked with bugdocs and my SVG test stuff, works well. Comitted, done.
Comment 10 SVN Robot 2014-07-18 09:10:27 UTC
"alg" committed SVN revision 1611567 into branches/AOO410:
i125258 reworked some of the style hierarchy stuff
Comment 11 jsc 2014-07-21 12:23:48 UTC
grant showstopper flag
Comment 12 Regina Henschel 2014-08-01 13:13:23 UTC
Verified on AOO411m4(Build:9774)  -  Rev. 1614049 (=RC 1)