Apache OpenOffice (AOO) Bugzilla – Issue 125258
[SVG] svg node does not consider styles from a style element
Last modified: 2017-05-20 10:35:12 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.
Got it. Investigating...
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.
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...
Checked with all my test files, preparing checkin...
"alg" committed SVN revision 1610953 into trunk: i125258 reworked some of the style hierarchy stuff
Okay, done.
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.
grant showstopper flag, potential crash and fix available
Merged to AOO411, checked with bugdocs and my SVG test stuff, works well. Comitted, done.
"alg" committed SVN revision 1611567 into branches/AOO410: i125258 reworked some of the style hierarchy stuff
grant showstopper flag
Verified on AOO411m4(Build:9774) - Rev. 1614049 (=RC 1)