summaryrefslogtreecommitdiffstats
path: root/src/sp-switch.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/sp-switch.cpp')
-rw-r--r--src/sp-switch.cpp24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/sp-switch.cpp b/src/sp-switch.cpp
index db6db9909..0090f1855 100644
--- a/src/sp-switch.cpp
+++ b/src/sp-switch.cpp
@@ -55,21 +55,22 @@ SPObject *SPSwitch::_evaluateFirst() {
return first;
}
-GSList *SPSwitch::_childList(bool add_ref, SPObject::Action action) {
+SelContainer SPSwitch::_childList(bool add_ref, SPObject::Action action) {
if ( action != SPObject::ActionGeneral ) {
return this->childList(add_ref, action);
}
SPObject *child = _evaluateFirst();
+ SelContainer x;
if (NULL == child)
- return NULL;
+ return x;
if (add_ref) {
//g_object_ref (G_OBJECT (child));
sp_object_ref(child);
}
-
- return g_slist_prepend (NULL, child);
+ x.push_front(child);
+ return x;
}
const char *SPSwitch::displayName() const {
@@ -109,10 +110,9 @@ void SPSwitch::_reevaluate(bool /*add_to_drawing*/) {
_releaseLastItem(_cached_item);
- for ( GSList *l = _childList(false, SPObject::ActionShow);
- NULL != l ; l = g_slist_remove (l, l->data))
- {
- SPObject *o = SP_OBJECT (l->data);
+ SelContainer item_list = _childList(false, SPObject::ActionShow);
+ for ( SelContainer::const_iterator iter=item_list.begin();iter!=item_list.end();iter++) {
+ SPObject *o = SP_OBJECT (*iter);
if ( !SP_IS_ITEM (o) ) {
continue;
}
@@ -144,10 +144,10 @@ void SPSwitch::_releaseLastItem(SPObject *obj)
void SPSwitch::_showChildren (Inkscape::Drawing &drawing, Inkscape::DrawingItem *ai, unsigned int key, unsigned int flags) {
SPObject *evaluated_child = this->_evaluateFirst();
- GSList *l = this->_childList(false, SPObject::ActionShow);
+ SelContainer l = this->_childList(false, SPObject::ActionShow);
- while (l) {
- SPObject *o = SP_OBJECT (l->data);
+ for ( SelContainer::const_iterator iter=l.begin();iter!=l.end();iter++) {
+ SPObject *o = SP_OBJECT (*iter);
if (SP_IS_ITEM (o)) {
SPItem * child = SP_ITEM(o);
@@ -158,8 +158,6 @@ void SPSwitch::_showChildren (Inkscape::Drawing &drawing, Inkscape::DrawingItem
ai->appendChild(ac);
}
}
-
- l = g_slist_remove (l, o);
}
}