summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9ba7eae)
raw | patch | inline | side by side (parent: 9ba7eae)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Sat, 24 Feb 2007 19:21:04 +0000 (19:21 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Sat, 24 Feb 2007 19:21:04 +0000 (19:21 +0000) |
src/selection-chemistry.cpp | patch | blob | history |
index cf16aba60a76d84a97e3ce27c648c5b57a8fe1ba..86e6bdc909d5fb0874248da7a84f922004524048 100644 (file)
g_slist_free ((GSList *) items);
}
+bool
+selection_contains_original (SPItem *item, Inkscape::Selection *selection)
+{
+ bool contains_original = false;
+ bool is_use = SP_IS_USE(item);
+ SPItem *item_use = item;
+ SPItem *item_use_first = item;
+ while (is_use && item_use && !contains_original)
+ {
+ item_use = sp_use_get_original (SP_USE(item_use));
+ contains_original |= selection->includes(item_use);
+ if (item_use == item_use_first)
+ break;
+ is_use = SP_IS_USE(item_use);
+ }
+ return contains_original;
+}
+
+
bool
selection_contains_both_clone_and_original (Inkscape::Selection *selection)
{
bool clone_with_original = false;
for (GSList const *l = selection->itemList(); l != NULL; l = l->next) {
SPItem *item = SP_ITEM(l->data);
- bool is_use = SP_IS_USE(item);
- SPItem *item_use = item;
- SPItem *item_use_first = item;
- while (is_use && item_use && !clone_with_original)
- {
- item_use = sp_use_get_original (SP_USE(item_use));
- clone_with_original |= selection->includes(item_use);
- if (item_use == item_use_first)
- break;
- is_use = SP_IS_USE(item_use);
- }
+ clone_with_original |= selection_contains_original(item, selection);
if (clone_with_original)
break;
}