summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 39b365a)
raw | patch | inline | side by side (parent: 39b365a)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Sun, 11 Feb 2007 02:00:45 +0000 (02:00 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Sun, 11 Feb 2007 02:00:45 +0000 (02:00 +0000) |
src/sp-object.cpp | patch | blob | history | |
src/sp-root.cpp | patch | blob | history |
diff --git a/src/sp-object.cpp b/src/sp-object.cpp
index 9294a2e9f442c9f83f6f9bbc1f2c49587139b56c..9b6c249172b18839ebd50548171d2c55132f08a4 100644 (file)
--- a/src/sp-object.cpp
+++ b/src/sp-object.cpp
{
debug("id=%x, typename=%s", object, g_type_name_from_instance((GTypeInstance*)object));
SPObject *ochild = sp_object_get_child_by_repr(object, child);
- g_return_if_fail(ochild != NULL);
- sp_object_detach(object, ochild);
+ g_return_if_fail (ochild != NULL || !strcmp("comment", child->name())); // comments have no objects
+ if (ochild)
+ sp_object_detach(object, ochild);
}
/**
diff --git a/src/sp-root.cpp b/src/sp-root.cpp
index d6e423edcabf53582627a1fdbc18fdaa5bae5552..c555c78a00bce3c97f12f468225fcad3730b8d93 100644 (file)
--- a/src/sp-root.cpp
+++ b/src/sp-root.cpp
@@ -353,9 +353,9 @@ sp_root_child_added(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML:
(* ((SPObjectClass *) (parent_class))->child_added)(object, child, ref);
SPObject *co = object->document->getObjectByRepr(child);
- g_assert(co != NULL);
+ g_assert (co != NULL || !strcmp("comment", child->name())); // comment repr node has no object
- if (SP_IS_DEFS(co)) {
+ if (co && SP_IS_DEFS(co)) {
SPObject *c;
/* We search for first <defs> node - it is not beautiful, but works */
for (c = sp_object_first_child(SP_OBJECT(group)) ; c != NULL; c = SP_OBJECT_NEXT(c) ) {