From a7f2b2ba3f13ceb60376802f4a31e104153839e8 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Tue, 17 Feb 2015 03:00:37 +0100 Subject: At first, I was thinking "I just have to go to the selection file, and change that GSList* with a std::list, then resolve the few problems" So, i tried that. And I will continue tomorrow, and the days after, on and on. (bzr r13922.1.1) --- src/ui/dialog/find.cpp | 92 +++++++++++++++++++++++++------------------------- 1 file changed, 46 insertions(+), 46 deletions(-) (limited to 'src/ui/dialog/find.cpp') diff --git a/src/ui/dialog/find.cpp b/src/ui/dialog/find.cpp index 951cb01ea..43ecb60ac 100644 --- a/src/ui/dialog/find.cpp +++ b/src/ui/dialog/find.cpp @@ -549,7 +549,7 @@ bool Find::item_font_match(SPItem *item, const gchar *text, bool exact, bool cas } -GSList *Find::filter_fields (GSList *l, bool exact, bool casematch) +SelContainer Find::filter_fields (SelContainer &l, bool exact, bool casematch) { Glib::ustring tmp = entry_find.getEntry()->get_text(); if (tmp.empty()) { @@ -557,17 +557,17 @@ GSList *Find::filter_fields (GSList *l, bool exact, bool casematch) } gchar* text = g_strdup(tmp.c_str()); - GSList *in = l; - GSList *out = NULL; + SelContainer in = l; + SelContainer out; if (check_searchin_text.get_active()) { - for (GSList *i = in; i != NULL; i = i->next) { - SPObject *obj = reinterpret_cast(i->data); + for(SelContainer::const_iterator i=in.begin(); in.end() != i; i++) { + SPObject *obj = SP_OBJECT (*i); SPItem *item = dynamic_cast(obj); g_assert(item != NULL); if (item_text_match(item, text, exact, casematch)) { - if (!g_slist_find(out, i->data)) { - out = g_slist_prepend (out, i->data); + if (out.end()==find(out.begin(),out.end(), *i)) { + out.push_front(*i); if (_action_replace) { item_text_match(item, text, exact, casematch, _action_replace); } @@ -584,12 +584,12 @@ GSList *Find::filter_fields (GSList *l, bool exact, bool casematch) bool attrvalue = check_attributevalue.get_active(); if (ids) { - for (GSList *i = in; i != NULL; i = i->next) { - SPObject *obj = reinterpret_cast(i->data); + for(SelContainer::const_iterator i=in.begin(); in.end() != i; i++) { + SPObject *obj = SP_OBJECT (*i); SPItem *item = dynamic_cast(obj); if (item_id_match(item, text, exact, casematch)) { - if (!g_slist_find(out, i->data)) { - out = g_slist_prepend (out, i->data); + if (out.end()==find(out.begin(),out.end(), *i)) { + out.push_front(*i); if (_action_replace) { item_id_match(item, text, exact, casematch, _action_replace); } @@ -600,14 +600,13 @@ GSList *Find::filter_fields (GSList *l, bool exact, bool casematch) if (style) { - for (GSList *i = in; i != NULL; i = i->next) { - SPObject *obj = reinterpret_cast(i->data); + for(SelContainer::const_iterator i=in.begin(); in.end() != i; i++) { + SPObject *obj = SP_OBJECT (*i); SPItem *item = dynamic_cast(obj); g_assert(item != NULL); if (item_style_match(item, text, exact, casematch)) { - if (!g_slist_find(out, i->data)) - if (!g_slist_find(out, i->data)) { - out = g_slist_prepend (out, i->data); + if (out.end()==find(out.begin(),out.end(), *i)){ + out.push_front(*i); if (_action_replace) { item_style_match(item, text, exact, casematch, _action_replace); } @@ -618,13 +617,13 @@ GSList *Find::filter_fields (GSList *l, bool exact, bool casematch) if (attrname) { - for (GSList *i = in; i != NULL; i = i->next) { - SPObject *obj = reinterpret_cast(i->data); + for(SelContainer::const_iterator i=in.begin(); in.end() != i; i++) { + SPObject *obj = SP_OBJECT (*i); SPItem *item = dynamic_cast(obj); g_assert(item != NULL); if (item_attr_match(item, text, exact, casematch)) { - if (!g_slist_find(out, i->data)) { - out = g_slist_prepend (out, i->data); + if (out.end()==find(out.begin(),out.end(), *i)) { + out.push_front(*i); if (_action_replace) { item_attr_match(item, text, exact, casematch, _action_replace); } @@ -635,13 +634,13 @@ GSList *Find::filter_fields (GSList *l, bool exact, bool casematch) if (attrvalue) { - for (GSList *i = in; i != NULL; i = i->next) { - SPObject *obj = reinterpret_cast(i->data); + for(SelContainer::const_iterator i=in.begin(); in.end() != i; i++) { + SPObject *obj = SP_OBJECT (*i); SPItem *item = dynamic_cast(obj); g_assert(item != NULL); if (item_attrvalue_match(item, text, exact, casematch)) { - if (!g_slist_find(out, i->data)) { - out = g_slist_prepend (out, i->data); + if (out.end()==find(out.begin(),out.end(), *i)) { + out.push_front(*i); if (_action_replace) { item_attrvalue_match(item, text, exact, casematch, _action_replace); } @@ -652,13 +651,13 @@ GSList *Find::filter_fields (GSList *l, bool exact, bool casematch) if (font) { - for (GSList *i = in; i != NULL; i = i->next) { - SPObject *obj = reinterpret_cast(i->data); + for(SelContainer::const_iterator i=in.begin(); in.end() != i; i++) { + SPObject *obj = SP_OBJECT (*i); SPItem *item = dynamic_cast(obj); g_assert(item != NULL); if (item_font_match(item, text, exact, casematch)) { - if (!g_slist_find(out, i->data)) { - out = g_slist_prepend (out, i->data); + if (out.end()==find(out.begin(),out.end(),*i)) { + out.push_front(*i); if (_action_replace) { item_font_match(item, text, exact, casematch, _action_replace); } @@ -716,29 +715,29 @@ bool Find::item_type_match (SPItem *item) return false; } -GSList *Find::filter_types (GSList *l) +SelContainer Find::filter_types (SelContainer &l) { - GSList *n = NULL; - for (GSList *i = l; i != NULL; i = i->next) { - SPObject *obj = reinterpret_cast(i->data); + SelContainer n; + for(SelContainer::const_iterator i=l.begin(); l.end() != i; i++) { + SPObject *obj = SP_OBJECT (*i); SPItem *item = dynamic_cast(obj); g_assert(item != NULL); if (item_type_match(item)) { - n = g_slist_prepend (n, i->data); + n.push_front(*i); } } return n; } -GSList *Find::filter_list (GSList *l, bool exact, bool casematch) +SelContainer &Find::filter_list (SelContainer &l, bool exact, bool casematch) { l = filter_types (l); l = filter_fields (l, exact, casematch); return l; } -GSList *Find::all_items (SPObject *r, GSList *l, bool hidden, bool locked) +SelContainer &Find::all_items (SPObject *r, SelContainer &l, bool hidden, bool locked) { if (dynamic_cast(r)) { return l; // we're not interested in items in defs @@ -752,7 +751,7 @@ GSList *Find::all_items (SPObject *r, GSList *l, bool hidden, bool locked) SPItem *item = dynamic_cast(child); if (item && !child->cloned && !desktop->isLayer(item)) { if ((hidden || !desktop->itemIsHidden(item)) && (locked || !item->isLocked())) { - l = g_slist_prepend (l, child); + l.push_front(child); } } l = all_items (child, l, hidden, locked); @@ -760,16 +759,17 @@ GSList *Find::all_items (SPObject *r, GSList *l, bool hidden, bool locked) return l; } -GSList *Find::all_selection_items (Inkscape::Selection *s, GSList *l, SPObject *ancestor, bool hidden, bool locked) +SelContainer &Find::all_selection_items (Inkscape::Selection *s, SelContainer &l, SPObject *ancestor, bool hidden, bool locked) { - for (GSList *i = (GSList *) s->itemList(); i != NULL; i = i->next) { - SPObject *obj = reinterpret_cast(i->data); + SelContainer itemlist=s->itemList(); + for(SelContainer::const_iterator i=itemlist.begin(); itemlist.end() != i; i++) { + SPObject *obj = SP_OBJECT (*i); SPItem *item = dynamic_cast(obj); g_assert(item != NULL); if (item && !item->cloned && !desktop->isLayer(item)) { if (!ancestor || ancestor->isAncestorOf(item)) { if ((hidden || !desktop->itemIsHidden(item)) && (locked || !item->isLocked())) { - l = g_slist_prepend (l, i->data); + l.push_back(*i); } } } @@ -817,7 +817,7 @@ void Find::onAction() bool casematch = check_case_sensitive.get_active(); blocked = true; - GSList *l = NULL; + SelContainer l; if (check_scope_selection.get_active()) { if (check_scope_layer.get_active()) { l = all_selection_items (desktop->selection, l, desktop->currentLayer(), hidden, locked); @@ -831,12 +831,12 @@ void Find::onAction() l = all_items(desktop->getDocument()->getRoot(), l, hidden, locked); } } - guint all = g_slist_length (l); + guint all = l.size(); - GSList *n = filter_list (l, exact, casematch); + SelContainer n = filter_list (l, exact, casematch); - if (n != NULL) { - int count = g_slist_length (n); + if (!n.empty()) { + int count = n.size(); desktop->messageStack()->flashF(Inkscape::NORMAL_MESSAGE, // TRANSLATORS: "%s" is replaced with "exact" or "partial" when this string is displayed ngettext("%d object found (out of %d), %s match.", @@ -857,7 +857,7 @@ void Find::onAction() Inkscape::Selection *selection = desktop->getSelection(); selection->clear(); selection->setList(n); - SPObject *obj = reinterpret_cast(n->data); + SPObject *obj = reinterpret_cast(n.front()); SPItem *item = dynamic_cast(obj); g_assert(item != NULL); scroll_to_show_item(desktop, item); -- cgit v1.2.3 From 5fd00cab14d48beaf2279a2b8f3ad5b02b76c87b Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Thu, 19 Feb 2015 04:25:21 +0100 Subject: Put a few std::vector (bzr r13922.1.5) --- src/ui/dialog/find.cpp | 54 +++++++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'src/ui/dialog/find.cpp') diff --git a/src/ui/dialog/find.cpp b/src/ui/dialog/find.cpp index 43ecb60ac..283d79c0d 100644 --- a/src/ui/dialog/find.cpp +++ b/src/ui/dialog/find.cpp @@ -549,7 +549,7 @@ bool Find::item_font_match(SPItem *item, const gchar *text, bool exact, bool cas } -SelContainer Find::filter_fields (SelContainer &l, bool exact, bool casematch) +std::vector Find::filter_fields (std::vector &l, bool exact, bool casematch) { Glib::ustring tmp = entry_find.getEntry()->get_text(); if (tmp.empty()) { @@ -557,17 +557,17 @@ SelContainer Find::filter_fields (SelContainer &l, bool exact, bool casematch) } gchar* text = g_strdup(tmp.c_str()); - SelContainer in = l; - SelContainer out; + std::vector in = l; + std::vector out; if (check_searchin_text.get_active()) { - for(SelContainer::const_iterator i=in.begin(); in.end() != i; i++) { + for(std::vector::const_reverse_iterator i=in.rbegin(); in.rend() != i; i++) { SPObject *obj = SP_OBJECT (*i); SPItem *item = dynamic_cast(obj); g_assert(item != NULL); if (item_text_match(item, text, exact, casematch)) { if (out.end()==find(out.begin(),out.end(), *i)) { - out.push_front(*i); + out.push_back(*i); if (_action_replace) { item_text_match(item, text, exact, casematch, _action_replace); } @@ -584,12 +584,12 @@ SelContainer Find::filter_fields (SelContainer &l, bool exact, bool casematch) bool attrvalue = check_attributevalue.get_active(); if (ids) { - for(SelContainer::const_iterator i=in.begin(); in.end() != i; i++) { + for(std::vector::const_reverse_iterator i=in.rbegin(); in.rend() != i; i++) { SPObject *obj = SP_OBJECT (*i); SPItem *item = dynamic_cast(obj); if (item_id_match(item, text, exact, casematch)) { if (out.end()==find(out.begin(),out.end(), *i)) { - out.push_front(*i); + out.push_back(*i); if (_action_replace) { item_id_match(item, text, exact, casematch, _action_replace); } @@ -600,13 +600,13 @@ SelContainer Find::filter_fields (SelContainer &l, bool exact, bool casematch) if (style) { - for(SelContainer::const_iterator i=in.begin(); in.end() != i; i++) { + for(std::vector::const_reverse_iterator i=in.rbegin(); in.rend() != i; i++) { SPObject *obj = SP_OBJECT (*i); SPItem *item = dynamic_cast(obj); g_assert(item != NULL); if (item_style_match(item, text, exact, casematch)) { if (out.end()==find(out.begin(),out.end(), *i)){ - out.push_front(*i); + out.push_back(*i); if (_action_replace) { item_style_match(item, text, exact, casematch, _action_replace); } @@ -617,13 +617,13 @@ SelContainer Find::filter_fields (SelContainer &l, bool exact, bool casematch) if (attrname) { - for(SelContainer::const_iterator i=in.begin(); in.end() != i; i++) { + for(std::vector::const_reverse_iterator i=in.rbegin(); in.rend() != i; i++) { SPObject *obj = SP_OBJECT (*i); SPItem *item = dynamic_cast(obj); g_assert(item != NULL); if (item_attr_match(item, text, exact, casematch)) { if (out.end()==find(out.begin(),out.end(), *i)) { - out.push_front(*i); + out.push_back(*i); if (_action_replace) { item_attr_match(item, text, exact, casematch, _action_replace); } @@ -634,13 +634,13 @@ SelContainer Find::filter_fields (SelContainer &l, bool exact, bool casematch) if (attrvalue) { - for(SelContainer::const_iterator i=in.begin(); in.end() != i; i++) { + for(std::vector::const_reverse_iterator i=in.rbegin(); in.rend() != i; i++) { SPObject *obj = SP_OBJECT (*i); SPItem *item = dynamic_cast(obj); g_assert(item != NULL); if (item_attrvalue_match(item, text, exact, casematch)) { if (out.end()==find(out.begin(),out.end(), *i)) { - out.push_front(*i); + out.push_back(*i); if (_action_replace) { item_attrvalue_match(item, text, exact, casematch, _action_replace); } @@ -651,13 +651,13 @@ SelContainer Find::filter_fields (SelContainer &l, bool exact, bool casematch) if (font) { - for(SelContainer::const_iterator i=in.begin(); in.end() != i; i++) { + for(std::vector::const_reverse_iterator i=in.rbegin(); in.rend() != i; i++) { SPObject *obj = SP_OBJECT (*i); SPItem *item = dynamic_cast(obj); g_assert(item != NULL); if (item_font_match(item, text, exact, casematch)) { if (out.end()==find(out.begin(),out.end(),*i)) { - out.push_front(*i); + out.push_back(*i); if (_action_replace) { item_font_match(item, text, exact, casematch, _action_replace); } @@ -715,29 +715,29 @@ bool Find::item_type_match (SPItem *item) return false; } -SelContainer Find::filter_types (SelContainer &l) +std::vector Find::filter_types (std::vector &l) { - SelContainer n; - for(SelContainer::const_iterator i=l.begin(); l.end() != i; i++) { + std::vector n; + for(std::vector::const_reverse_iterator i=l.rbegin(); l.rend() != i; i++) { SPObject *obj = SP_OBJECT (*i); SPItem *item = dynamic_cast(obj); g_assert(item != NULL); if (item_type_match(item)) { - n.push_front(*i); + n.push_back(*i); } } return n; } -SelContainer &Find::filter_list (SelContainer &l, bool exact, bool casematch) +std::vector &Find::filter_list (std::vector &l, bool exact, bool casematch) { l = filter_types (l); l = filter_fields (l, exact, casematch); return l; } -SelContainer &Find::all_items (SPObject *r, SelContainer &l, bool hidden, bool locked) +std::vector &Find::all_items (SPObject *r, std::vector &l, bool hidden, bool locked) { if (dynamic_cast(r)) { return l; // we're not interested in items in defs @@ -751,7 +751,7 @@ SelContainer &Find::all_items (SPObject *r, SelContainer &l, bool hidden, bool l SPItem *item = dynamic_cast(child); if (item && !child->cloned && !desktop->isLayer(item)) { if ((hidden || !desktop->itemIsHidden(item)) && (locked || !item->isLocked())) { - l.push_front(child); + l.insert(l.begin(),(SPItem*)child); } } l = all_items (child, l, hidden, locked); @@ -759,10 +759,10 @@ SelContainer &Find::all_items (SPObject *r, SelContainer &l, bool hidden, bool l return l; } -SelContainer &Find::all_selection_items (Inkscape::Selection *s, SelContainer &l, SPObject *ancestor, bool hidden, bool locked) +std::vector &Find::all_selection_items (Inkscape::Selection *s, std::vector &l, SPObject *ancestor, bool hidden, bool locked) { - SelContainer itemlist=s->itemList(); - for(SelContainer::const_iterator i=itemlist.begin(); itemlist.end() != i; i++) { + std::vector itemlist=s->itemList(); + for(std::vector::const_iterator i=itemlist.begin(); itemlist.end() != i; i++) { SPObject *obj = SP_OBJECT (*i); SPItem *item = dynamic_cast(obj); g_assert(item != NULL); @@ -817,7 +817,7 @@ void Find::onAction() bool casematch = check_case_sensitive.get_active(); blocked = true; - SelContainer l; + std::vector l; if (check_scope_selection.get_active()) { if (check_scope_layer.get_active()) { l = all_selection_items (desktop->selection, l, desktop->currentLayer(), hidden, locked); @@ -833,7 +833,7 @@ void Find::onAction() } guint all = l.size(); - SelContainer n = filter_list (l, exact, casematch); + std::vector n = filter_list (l, exact, casematch); if (!n.empty()) { int count = n.size(); -- cgit v1.2.3 From 9a7fa4d1899d30ec745107823f307b2a0bf3172f Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Fri, 27 Feb 2015 03:10:36 +0100 Subject: corrected the casts (hopefully) (bzr r13922.1.10) --- src/ui/dialog/find.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ui/dialog/find.cpp') diff --git a/src/ui/dialog/find.cpp b/src/ui/dialog/find.cpp index 283d79c0d..dde040036 100644 --- a/src/ui/dialog/find.cpp +++ b/src/ui/dialog/find.cpp @@ -857,7 +857,7 @@ void Find::onAction() Inkscape::Selection *selection = desktop->getSelection(); selection->clear(); selection->setList(n); - SPObject *obj = reinterpret_cast(n.front()); + SPObject *obj = reinterpret_cast(n[0]); SPItem *item = dynamic_cast(obj); g_assert(item != NULL); scroll_to_show_item(desktop, item); -- cgit v1.2.3 From 9bdc157f705ca61516e599cb416580283d21ec35 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Fri, 27 Feb 2015 04:21:48 +0100 Subject: more cast cleanup (bzr r13922.1.11) --- src/ui/dialog/find.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/ui/dialog/find.cpp') diff --git a/src/ui/dialog/find.cpp b/src/ui/dialog/find.cpp index dde040036..173acca93 100644 --- a/src/ui/dialog/find.cpp +++ b/src/ui/dialog/find.cpp @@ -562,7 +562,7 @@ std::vector Find::filter_fields (std::vector &l, bool exact, b if (check_searchin_text.get_active()) { for(std::vector::const_reverse_iterator i=in.rbegin(); in.rend() != i; i++) { - SPObject *obj = SP_OBJECT (*i); + SPObject *obj = *i; SPItem *item = dynamic_cast(obj); g_assert(item != NULL); if (item_text_match(item, text, exact, casematch)) { @@ -585,7 +585,7 @@ std::vector Find::filter_fields (std::vector &l, bool exact, b if (ids) { for(std::vector::const_reverse_iterator i=in.rbegin(); in.rend() != i; i++) { - SPObject *obj = SP_OBJECT (*i); + SPObject *obj = *i; SPItem *item = dynamic_cast(obj); if (item_id_match(item, text, exact, casematch)) { if (out.end()==find(out.begin(),out.end(), *i)) { @@ -601,7 +601,7 @@ std::vector Find::filter_fields (std::vector &l, bool exact, b if (style) { for(std::vector::const_reverse_iterator i=in.rbegin(); in.rend() != i; i++) { - SPObject *obj = SP_OBJECT (*i); + SPObject *obj = *i; SPItem *item = dynamic_cast(obj); g_assert(item != NULL); if (item_style_match(item, text, exact, casematch)) { @@ -618,7 +618,7 @@ std::vector Find::filter_fields (std::vector &l, bool exact, b if (attrname) { for(std::vector::const_reverse_iterator i=in.rbegin(); in.rend() != i; i++) { - SPObject *obj = SP_OBJECT (*i); + SPObject *obj = *i; SPItem *item = dynamic_cast(obj); g_assert(item != NULL); if (item_attr_match(item, text, exact, casematch)) { @@ -635,7 +635,7 @@ std::vector Find::filter_fields (std::vector &l, bool exact, b if (attrvalue) { for(std::vector::const_reverse_iterator i=in.rbegin(); in.rend() != i; i++) { - SPObject *obj = SP_OBJECT (*i); + SPObject *obj = *i; SPItem *item = dynamic_cast(obj); g_assert(item != NULL); if (item_attrvalue_match(item, text, exact, casematch)) { @@ -652,7 +652,7 @@ std::vector Find::filter_fields (std::vector &l, bool exact, b if (font) { for(std::vector::const_reverse_iterator i=in.rbegin(); in.rend() != i; i++) { - SPObject *obj = SP_OBJECT (*i); + SPObject *obj = *i; SPItem *item = dynamic_cast(obj); g_assert(item != NULL); if (item_font_match(item, text, exact, casematch)) { @@ -719,7 +719,7 @@ std::vector Find::filter_types (std::vector &l) { std::vector n; for(std::vector::const_reverse_iterator i=l.rbegin(); l.rend() != i; i++) { - SPObject *obj = SP_OBJECT (*i); + SPObject *obj = *i; SPItem *item = dynamic_cast(obj); g_assert(item != NULL); if (item_type_match(item)) { @@ -763,7 +763,7 @@ std::vector &Find::all_selection_items (Inkscape::Selection *s, std::ve { std::vector itemlist=s->itemList(); for(std::vector::const_iterator i=itemlist.begin(); itemlist.end() != i; i++) { - SPObject *obj = SP_OBJECT (*i); + SPObject *obj = *i; SPItem *item = dynamic_cast(obj); g_assert(item != NULL); if (item && !item->cloned && !desktop->isLayer(item)) { @@ -857,7 +857,7 @@ void Find::onAction() Inkscape::Selection *selection = desktop->getSelection(); selection->clear(); selection->setList(n); - SPObject *obj = reinterpret_cast(n[0]); + SPObject *obj = n[0]; SPItem *item = dynamic_cast(obj); g_assert(item != NULL); scroll_to_show_item(desktop, item); -- cgit v1.2.3 From 60bdd590969d1c32c392a8fed15f4ceac4a678d2 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Mon, 27 Apr 2015 01:12:03 +0200 Subject: Just reread the entire diff against trunk. Given the diff size, i must have forgotten things, but hopefully, there are only very few changes of semantics: ->childList is now in the intuitive order (childList()[0] is now firstChild) -> sp_selection_paste_impl is now in the opposite order (change is local to selection-chemistry.cpp, and simplify a few things) -> selection.setReprList now takes the list in the opposite order. It was always the case (the list was always reversed before handing to it) -> a few comparison functions now work "the c++ way": the C way was to return -1 if ab, now they return (bool)(a &Find::all_items (SPObject *r, std::vector &l, boo std::vector &Find::all_selection_items (Inkscape::Selection *s, std::vector &l, SPObject *ancestor, bool hidden, bool locked) { std::vector itemlist=s->itemList(); - for(std::vector::const_iterator i=itemlist.begin(); itemlist.end() != i; i++) { + for(std::vector::const_reverse_iterator i=itemlist.rbegin(); itemlist.rend() != i; i++) { SPObject *obj = *i; SPItem *item = dynamic_cast(obj); g_assert(item != NULL); -- cgit v1.2.3