Fix bug 702423, "Scour corrupts icons with gradients when --disable-style-to-xml is used". Add 2 more full tests gathered from the bug reports, as well as 1 more unit test.
This commit is contained in:
parent
fcbb2b0332
commit
437dbf991c
5 changed files with 489 additions and 0 deletions
6
scour.py
6
scour.py
|
|
@ -1291,6 +1291,12 @@ def removeDuplicateGradients(doc):
|
|||
elem.setAttribute(attr, 'url(#'+master_id+')')
|
||||
if elem.getAttributeNS(NS['XLINK'], 'href') == '#'+dup_id:
|
||||
elem.setAttributeNS(NS['XLINK'], 'href', '#'+master_id)
|
||||
styles = _getStyle(elem)
|
||||
for style in styles:
|
||||
v = styles[style]
|
||||
if v == 'url(#'+dup_id+')' or v == 'url("#'+dup_id+'")' or v == "url('#"+dup_id+"')":
|
||||
styles[style] = 'url(#'+master_id+')'
|
||||
_setStyle(elem, styles)
|
||||
|
||||
# now that all referencing elements have been re-mapped to the master
|
||||
# it is safe to remove this gradient from the document
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue