summaryrefslogtreecommitdiffstats
path: root/src/ui/tools/eraser-tool.cpp
diff options
context:
space:
mode:
authorMarc Jeanmougin <mc>2015-02-19 03:25:21 +0000
committerMarc Jeanmougin <mc>2015-02-19 03:25:21 +0000
commit5fd00cab14d48beaf2279a2b8f3ad5b02b76c87b (patch)
treeff77bac142c02624cbdfaa2ebd01422e8697205a /src/ui/tools/eraser-tool.cpp
parentI can't really understand why, but i can now launch inkscape without it segfa... (diff)
downloadinkscape-5fd00cab14d48beaf2279a2b8f3ad5b02b76c87b.tar.gz
inkscape-5fd00cab14d48beaf2279a2b8f3ad5b02b76c87b.zip
Put a few std::vector<SPitem*>
(bzr r13922.1.5)
Diffstat (limited to 'src/ui/tools/eraser-tool.cpp')
-rw-r--r--src/ui/tools/eraser-tool.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/ui/tools/eraser-tool.cpp b/src/ui/tools/eraser-tool.cpp
index 3526e015a..520b93e72 100644
--- a/src/ui/tools/eraser-tool.cpp
+++ b/src/ui/tools/eraser-tool.cpp
@@ -676,8 +676,7 @@ void EraserTool::set_to_accumulated() {
Geom::OptRect eraserBbox = acid->visualBounds();
Geom::Rect bounds = (*eraserBbox) * desktop->doc2dt();
std::vector<SPItem*> remainingItems;
- SelContainer toWorkOn;
-
+ std::vector<SPItem*> toWorkOn;
if (selection->isEmpty()) {
if ( eraserMode ) {
toWorkOn = desktop->getDocument()->getItemsPartiallyInBox(desktop->dkey, bounds);
@@ -685,16 +684,15 @@ void EraserTool::set_to_accumulated() {
Inkscape::Rubberband *r = Inkscape::Rubberband::get(desktop);
toWorkOn = desktop->getDocument()->getItemsAtPoints(desktop->dkey, r->getPoints());
}
-
- toWorkOn.remove(static_cast<SPObject*>(acid) );
+ toWorkOn.erase(find(toWorkOn.begin(),toWorkOn.end(),acid));
} else {
- toWorkOn = selection->itemList();
+ toWorkOn= selection->itemList();
wasSelection = true;
}
if ( !toWorkOn.empty() ) {
if ( eraserMode ) {
- for (SelContainer::const_iterator i = toWorkOn.begin();i!=toWorkOn.end();i++) {
+ for (std::vector<SPItem*>::const_iterator i = toWorkOn.begin();i!=toWorkOn.end();i++) {
SPItem *item = SP_ITEM(*i);
if ( eraserMode ) {
@@ -712,8 +710,8 @@ void EraserTool::set_to_accumulated() {
if ( !selection->isEmpty() ) {
// If the item was not completely erased, track the new remainder.
- SelContainer nowSel(selection->itemList());
- for (SelContainer::const_iterator i2 = nowSel.begin();i!=nowSel.end();i++) {
+ std::vector<SPItem*> nowSel(selection->itemList());
+ for (std::vector<SPItem*>::const_iterator i2 = nowSel.begin();i!=nowSel.end();i2++) {
remainingItems.push_back(SP_ITEM(*i2));
}
}
@@ -723,11 +721,11 @@ void EraserTool::set_to_accumulated() {
}
}
} else {
- for (SelContainer::const_iterator i = toWorkOn.begin();i!=toWorkOn.end();i++) {
+ for (std::vector<SPItem*> ::const_iterator i = toWorkOn.begin();i!=toWorkOn.end();i++) {
sp_object_ref( SP_ITEM(*i), 0 );
}
- for (SelContainer::const_iterator i = toWorkOn.begin();i!=toWorkOn.end();i++) {
+ for (std::vector<SPItem*>::const_iterator i = toWorkOn.begin();i!=toWorkOn.end();i++) {
SPItem *item = SP_ITEM(*i);
item->deleteObject(true);
sp_object_unref(item);