Code

do not try to remove resource if the object is cloned
authorbuliabyak <buliabyak@users.sourceforge.net>
Sun, 12 Feb 2006 06:23:23 +0000 (06:23 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Sun, 12 Feb 2006 06:23:23 +0000 (06:23 +0000)
src/document.cpp

index f69c480f75e4a3f108cfdc9ce792283d166a3d4f..e5c0cd82495e1a91b5c925a315f157d124d9457c 100644 (file)
@@ -986,6 +986,9 @@ sp_document_remove_resource(SPDocument *document, gchar const *key, SPObject *ob
     g_return_val_if_fail(object != NULL, FALSE);
     g_return_val_if_fail(SP_IS_OBJECT(object), FALSE);
 
+    if (SP_OBJECT_IS_CLONED(object))
+        return FALSE;
+
     rlist = (GSList*)g_hash_table_lookup(document->priv->resources, key);
     g_return_val_if_fail(rlist != NULL, FALSE);
     g_return_val_if_fail(g_slist_find(rlist, object), FALSE);