From cbc44da105ce8ccd6d098ba64218af028f11e38e Mon Sep 17 00:00:00 2001 From: Martin Owens Date: Tue, 24 Sep 2013 12:32:55 -0400 Subject: Make sure selection->setList checks for dupes by routing to selection->addList. Fixed bugs: - https://launchpad.net/bugs/1229678 (bzr r12586) --- src/selection.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'src/selection.cpp') diff --git a/src/selection.cpp b/src/selection.cpp index 1335c5fca..aea5f539c 100644 --- a/src/selection.cpp +++ b/src/selection.cpp @@ -238,14 +238,7 @@ void Selection::_remove(SPObject *obj) { void Selection::setList(GSList const *list) { _clear(); - - if ( list != NULL ) { - for ( GSList const *iter = list ; iter != NULL ; iter = iter->next ) { - _add(reinterpret_cast(iter->data)); - } - } - - _emitChanged(); + addList(list); } void Selection::addList(GSList const *list) { @@ -257,9 +250,7 @@ void Selection::addList(GSList const *list) { for ( GSList const *iter = list ; iter != NULL ; iter = iter->next ) { SPObject *obj = reinterpret_cast(iter->data); - if (includes(obj)) { - continue; - } + if (includes(obj)) continue; _add (obj); } -- cgit v1.2.3