From 6dc2553bed13da144b58acf44242557a4442861a Mon Sep 17 00:00:00 2001 From: Louis Simard Date: Mon, 7 Feb 2011 13:20:04 -0500 Subject: [PATCH] Apply a fix proposed by Jan Thor in bug 702423, to correct a code error that may be part of a bug whereby non-duplicate gradients are removed when using --disable-style-to-xml. --- scour.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scour.py b/scour.py index 7b20244..c41f8fd 100755 --- a/scour.py +++ b/scour.py @@ -1054,11 +1054,12 @@ def removeDuplicateGradientStops(doc): color = stop.getAttribute('stop-color') opacity = stop.getAttribute('stop-opacity') + style = stop.getAttribute('style') if stops.has_key(offset) : oldStop = stops[offset] - if oldStop[0] == color and oldStop[1] == opacity: + if oldStop[0] == color and oldStop[1] == opacity and oldStop[2] == style: stopsToRemove.append(stop) - stops[offset] = [color, opacity] + stops[offset] = [color, opacity, style] for stop in stopsToRemove: stop.parentNode.removeChild(stop) @@ -1166,7 +1167,7 @@ def removeDuplicateGradients(doc): if stopsNotEqual: break stop = stops.item(i) ostop = ostops.item(i) - for attr in ['offset', 'stop-color', 'stop-opacity']: + for attr in ['offset', 'stop-color', 'stop-opacity', 'style']: if stop.getAttribute(attr) != ostop.getAttribute(attr): stopsNotEqual = True break