summaryrefslogtreecommitdiffstats
path: root/src/sp-item.cpp
diff options
context:
space:
mode:
authorMaximilian Albert <maximilian.albert@gmail.com>2008-01-15 22:09:09 +0000
committercilix42 <cilix42@users.sourceforge.net>2008-01-15 22:09:09 +0000
commit566872ee9828e208e987e84bf7b72c79f6958662 (patch)
tree8351960957ffa8a0b25bf5e4b92367525765eab5 /src/sp-item.cpp
parenthopefully fix compile error on linux (diff)
downloadinkscape-566872ee9828e208e987e84bf7b72c79f6958662.tar.gz
inkscape-566872ee9828e208e987e84bf7b72c79f6958662.zip
Slightly more 'object-oriented' way to invoke item-specific conversion-to-guides methods
(bzr r4499)
Diffstat (limited to 'src/sp-item.cpp')
-rw-r--r--src/sp-item.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/sp-item.cpp b/src/sp-item.cpp
index 7b3687607..078ff6c59 100644
--- a/src/sp-item.cpp
+++ b/src/sp-item.cpp
@@ -1368,6 +1368,22 @@ sp_item_set_item_transform(SPItem *item, NR::Matrix const &transform)
}
}
+void
+sp_item_convert_item_to_guides(SPItem *item) {
+ g_return_if_fail(item != NULL);
+ g_return_if_fail(SP_IS_ITEM(item));
+
+ /* Use derived method if present ... */
+ if (((SPItemClass *) G_OBJECT_GET_CLASS(item))->convert_to_guides) {
+ (*((SPItemClass *) G_OBJECT_GET_CLASS(item))->convert_to_guides)(item);
+ return;
+ }
+
+ /* .. otherwise simply place the guides around the item's bounding box */
+
+ sp_item_convert_to_guides(item);
+}
+
/**
* \pre \a ancestor really is an ancestor (\>=) of \a object, or NULL.