On Tue, 2006-10-24 at 17:01 -0300, bulia byak wrote:
but it started to fire only recently. Mental, do you have an idea of why this became a problem? And is it really a problem - maybe we can just remove the g_warning?
As long as nobody tries to do anything with root->defs until the document has been reconstructed, you're okay, but if anyone tries anything in the interim you're kind of screwed, whether it's crashing or failing to create needed gradient/whatever objects.
For example, try dragging svg:defs away from root to become a child of some other element (thus breaking the root->defs link). [There are some simplistic checks in place to prevent direct accidental deletion of it.] Then draw a shape and try to open the fill and stroke dialog...
FWIW, that commit you linked to didn't change any fundamental behavior in this regard. I just added the warning then because I first noticed the potential for problems when I was working in that area of the code.
In the particular case of tearing down and recreating the document, is it a problem right now? No. Can we offer a strong guarantee that if some order of operations is later changed somewhere in SPObject/SPItem that it will still be okay? No.
There isn't really a simple fix -- our whole handling of svg:defs is fundamentally broken by design, and needs to be systematically rethought. We can certainly remove the warning if it's doing more harm than good, but...
-mental