Comment 8 for bug 1318657

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

OK, I finally see what the problem is. For future reference the issue is this:

1. in the SVG <defs> there are two records with id's linearGradient4100 and linearGradient18282 *IN THAT ORDER*
2. linearGradient18282 has an xlink:href to linearGradient4100
3. at some point during import the order of these records is REVERSED
4. within importDefs() in one cycle linearGradient18282 is encountered and is copied from the clipboard to the document
5. in a later cycle linearGradient4100 is encountered and found to be identical to another record already in <defs>,
consequently all references to linearGradient4100 are changed to that preexisting record *IN THE CLIPBOARD XML*

Which is too late, because the record where it matters has already been transferred to the document. A classic case of shutting the barn door after the horse has left.

Now to see if I can fix this without too much trauma. Perhaps one full pass through the clipboard to resolve all of the duplicates and then a second pass to copy over the new ones.