diff options
| author | Nicolas Dufour <nicoduf@yahoo.fr> | 2013-03-23 16:41:06 +0000 |
|---|---|---|
| committer | JazzyNico <nicoduf@yahoo.fr> | 2013-03-23 16:41:06 +0000 |
| commit | 8f8482850789d8c9ffb2a43751818eac7fa6b274 (patch) | |
| tree | 73d3e4f0ad7ff4942e3cc3a676e5b736d2a84b85 | |
| parent | Fix more clang warnings (diff) | |
| download | inkscape-8f8482850789d8c9ffb2a43751818eac7fa6b274.tar.gz inkscape-8f8482850789d8c9ffb2a43751818eac7fa6b274.zip | |
Extensions. Fix for old Bug #166697 (Effects dirty document even when they do nothing).
(bzr r12236)
| -rwxr-xr-x | share/extensions/inkex.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/share/extensions/inkex.py b/share/extensions/inkex.py index 4ba88c3bb..c1feba5ae 100755 --- a/share/extensions/inkex.py +++ b/share/extensions/inkex.py @@ -157,6 +157,7 @@ class Effect: def __init__(self, *args, **kwargs): self.document=None + self.original_document=None self.ctx=None self.selected={} self.doc_ids={} @@ -184,6 +185,7 @@ class Effect: except: stream = sys.stdin self.document = etree.parse(stream) + self.original_document = copy.deepcopy(self.document) stream.close() def getposinlayer(self): @@ -249,7 +251,10 @@ class Effect: def output(self): """Serialize document into XML on stdout""" - self.document.write(sys.stdout) + original = etree.tostring(self.original_document) + result = etree.tostring(self.document) + if original != result: + self.document.write(sys.stdout) def affect(self, args=sys.argv[1:], output=True): """Affect an SVG document with a callback effect""" |
