2014-04-06 2:07 GMT+02:00 Johan Engelen <jbc.engelen@...2592...>:
Hi all, I am trying to fix this bug: https://bugs.launchpad.net/inkscape/+bug/1299461
What I see is some weird behaviour. It seems a "ghost" object is lingering around after creating a clone. What I see is that after cloning a path, every change to that path now triggers /two/ calls to SPPath::set. The second call is on an SPObject with no id set (getId() == null), but it's repr points to the original path (1st path id == 2nd path->getRepr()->attribute("id")). This second object is triggering an LPE calculation before everything is set up correctly, leading to the bug reported.
I don't know how this ghost object arises, and I believe it should be killed. At the very least it is triggering duplicate operations; and at worst, it bugs normal operation.
This object exists because every SPUse actually contains a deep copy of the SPObject to which it refers. This is required for SVG conformance, because styles defined at the place where the svg:use occurs may cascade into the cloned objects and override the properties which are undefined or inherited for them.
The ghost object cannot be removed until someone invents a way to correctly compute the style cascade without the object tree. For now, the LPE calculation should be fixed to occur at the correct moment.
(Aside: the current implementation of LPEs is extremely invasive and requires special special code all over the SP tree, which is not a good thing. Ideally the fact that LPEs exist should be transparent to almost all code that doesn't deal with them directly.)
Regards, Krzysztof