summaryrefslogtreecommitdiffstats
path: root/src/selection.cpp
diff options
context:
space:
mode:
authormc <>2015-02-18 10:25:23 +0000
committerMarc Jeanmougin <mc>2015-02-18 10:25:23 +0000
commit9e21d00fb1053897420f80d05a9815c5b2bbf312 (patch)
tree9c0f61257c24e936d07526bd4b71a399825519b6 /src/selection.cpp
parentOMG IT'S COMPILING. (diff)
downloadinkscape-9e21d00fb1053897420f80d05a9815c5b2bbf312.tar.gz
inkscape-9e21d00fb1053897420f80d05a9815c5b2bbf312.zip
I can't really understand why, but i can now launch inkscape without it segfaulting.
That's an improvement. Next thing: code cleaning, replacing containers with vectors (bzr r13922.1.4)
Diffstat (limited to 'src/selection.cpp')
-rw-r--r--src/selection.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/selection.cpp b/src/selection.cpp
index b509f4272..cbde9a799 100644
--- a/src/selection.cpp
+++ b/src/selection.cpp
@@ -43,7 +43,7 @@ namespace Inkscape {
Selection::Selection(LayerModel *layers, SPDesktop *desktop) :
_objs(SelContainer()),
- _reprs(SelContainer()),
+ _reprs(std::vector<XML::Node*>()),
_items(SelContainer()),
_layers(layers),
_desktop(desktop),
@@ -296,15 +296,13 @@ SelContainer const &Selection::itemList() {
return _items;
}
-SelContainer const &Selection::reprList() {
+std::vector<XML::Node*> const &Selection::reprList() {
if (!_reprs.empty()) { return _reprs; }
SelContainer list = itemList();
for ( SelContainer::const_iterator iter=list.begin();iter!=list.end();iter++ ) {
SPObject *obj=reinterpret_cast<SPObject *>(*iter);
- _reprs.push_front(dynamic_cast<SPObject*>(obj->getRepr()));
+ _reprs.push_back(obj->getRepr());
}
- _reprs.reverse();
-
return _reprs;
}
@@ -343,7 +341,7 @@ SPObject *Selection::single() {
SPItem *Selection::singleItem() {
SelContainer const items=itemList();
- if ( !items.size()==1) {
+ if ( items.size()==1) {
return reinterpret_cast<SPItem *>(items.front());
} else {
return NULL;