From 3998a11ea19189ed8736c0692a1cf6d03728163e Mon Sep 17 00:00:00 2001 From: bulia byak Date: Wed, 22 Mar 2006 15:01:15 +0000 Subject: more information on objects selected in groups (bzr r270) --- src/selection.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/selection.cpp') diff --git a/src/selection.cpp b/src/selection.cpp index 09f6a18e3..87e0788d8 100644 --- a/src/selection.cpp +++ b/src/selection.cpp @@ -435,6 +435,20 @@ guint Selection::numberOfLayers() { return ret; } +guint Selection::numberOfParents() { + GSList const *items = const_cast(this)->itemList(); + GSList *parents = NULL; + for (GSList const *iter = items; iter != NULL; iter = iter->next) { + SPObject *parent = SP_OBJECT_PARENT(iter->data); + if (g_slist_find (parents, parent) == NULL) { + parents = g_slist_prepend (parents, parent); + } + } + guint ret = g_slist_length (parents); + g_slist_free (parents); + return ret; +} + } /* -- cgit v1.2.3