Comment 9 for bug 1318657

Revision history for this message
David Mathog (mathog) wrote :

The logic to handle this is getting more and more complex. Consider this scenario:

1. paste clipboard into a document
2. paste it into the same document a second time
3. paste it into a new document

Current processing marks up the XML in the clipboard. If at (1) there is a gradient "B" similar to a gradient "A"
in the document, then all references to "B" are changed to "A" and the gradient "B" is marked for omission.
That is fine at (2). However it all goes wrong at (3) because the new document does not have "A", yet all of the references
to "B" have been removed, and "B" itself has been marked as a duplicate!

So it looks like to do this safely one must make a 2nd copy of the clipboard on every paste operation, mark it up to remove duplicates / change references, and then throw it away.

There are also problems not only with the clipboard containing duplicates of definitions in the document, but containing duplicates of definitions within itself. When this logic is working right Inkscape will not make these, but there is nothing to prevent other applications from creating such an SVG, like the example for this bug.