From 566872ee9828e208e987e84bf7b72c79f6958662 Mon Sep 17 00:00:00 2001 From: Maximilian Albert Date: Tue, 15 Jan 2008 22:09:09 +0000 Subject: Slightly more 'object-oriented' way to invoke item-specific conversion-to-guides methods (bzr r4499) --- src/sp-item.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/sp-item.cpp') 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. -- cgit v1.2.3