Code

Another take to fixing pdf import crash, likely without memory leak
[inkscape.git] / src / sp-use.cpp
index e31af93564372615836ec57489a1d94e5a62084a..0e1c257eb04eae40c8039664667293bd984b9917 100644 (file)
@@ -48,6 +48,7 @@ static void sp_use_update(SPObject *object, SPCtx *ctx, guint flags);
 static void sp_use_modified(SPObject *object, guint flags);
 
 static void sp_use_bbox(SPItem const *item, NRRect *bbox, NR::Matrix const &transform, unsigned const flags);
+static void sp_use_snappoints(SPItem const *item, SnapPointsIter p);
 static void sp_use_print(SPItem *item, SPPrintContext *ctx);
 static gchar *sp_use_description(SPItem *item);
 static NRArenaItem *sp_use_show(SPItem *item, NRArena *arena, unsigned key, unsigned flags);
@@ -107,6 +108,7 @@ sp_use_class_init(SPUseClass *classname)
     item_class->print = sp_use_print;
     item_class->show = sp_use_show;
     item_class->hide = sp_use_hide;
+    item_class->snappoints = sp_use_snappoints;
 }
 
 static void
@@ -445,7 +447,7 @@ sp_use_get_parent_transform(SPUse *use)
  * clone's transform.
  */
 static void
-sp_use_move_compensate(NR::Matrix const *mp, SPItem *original, SPUse *self)
+sp_use_move_compensate(NR::Matrix const *mp, SPItem */*original*/, SPUse *self)
 {
     // the clone is orphaned; or this is not a real use, but a clone of another use;
     // we skip it, otherwise duplicate compensation will occur
@@ -495,7 +497,7 @@ sp_use_move_compensate(NR::Matrix const *mp, SPItem *original, SPUse *self)
 }
 
 static void
-sp_use_href_changed(SPObject *old_ref, SPObject *ref, SPUse *use)
+sp_use_href_changed(SPObject */*old_ref*/, SPObject */*ref*/, SPUse *use)
 {
     SPItem *item = SP_ITEM(use);
 
@@ -536,7 +538,7 @@ sp_use_href_changed(SPObject *old_ref, SPObject *ref, SPUse *use)
 }
 
 static void
-sp_use_delete_self(SPObject *deleted, SPUse *self)
+sp_use_delete_self(SPObject */*deleted*/, SPUse *self)
 {
     // always delete uses which are used in flowtext
     if (SP_OBJECT_PARENT(self) && SP_IS_FLOWREGION(SP_OBJECT_PARENT(self))) {
@@ -727,6 +729,22 @@ sp_use_get_original(SPUse *use)
     return ref;
 }
 
+static void
+sp_use_snappoints(SPItem const *item, SnapPointsIter p)
+{
+    g_assert (item != NULL);
+    g_assert (SP_IS_ITEM(item));
+    g_assert (SP_IS_USE(item));
+    
+    SPUse *use = SP_USE(item);
+    SPItem *root = sp_use_root(use);
+    
+    SPItemClass const &item_class = *(SPItemClass const *) G_OBJECT_GET_CLASS(root);
+    if (item_class.snappoints) {
+        item_class.snappoints(root, p);
+    }
+}
+
 
 /*
   Local Variables: