summaryrefslogtreecommitdiffstats
path: root/src/selection-chemistry.cpp
diff options
context:
space:
mode:
authorMarc Jeanmougin <marc@jeanmougin.fr>2015-04-26 23:12:03 +0000
committerMarc Jeanmougin <mc@M0nst3r.bouyguesbox.fr>2015-04-26 23:12:03 +0000
commit60bdd590969d1c32c392a8fed15f4ceac4a678d2 (patch)
tree87b14c9b5238e99cb319ff9245caa37b8b1d3c6a /src/selection-chemistry.cpp
parentfix (diff)
downloadinkscape-60bdd590969d1c32c392a8fed15f4ceac4a678d2.tar.gz
inkscape-60bdd590969d1c32c392a8fed15f4ceac4a678d2.zip
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 a<b, 0 if a==b and 1 if a>b, now they return (bool)(a<b) (bzr r13922.1.15)
Diffstat (limited to 'src/selection-chemistry.cpp')
-rw-r--r--src/selection-chemistry.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp
index 0100e1040..c1d4f58e4 100644
--- a/src/selection-chemistry.cpp
+++ b/src/selection-chemistry.cpp
@@ -337,10 +337,7 @@ static void sp_selection_copy_impl(std::vector<SPItem*> const &items, std::vecto
g_assert_not_reached();
}
}
- std::vector<Inkscape::XML::Node*> tmp(clip);
- for(int i=0;i<tmp.size();i++){
- clip[i]=tmp[tmp.size()-i-1];
- }
+ reverse(clip.begin(),clip.end());
}
// TODO check if parent parameter should be changed to SPItem, of if the code should handle non-items.
@@ -1418,7 +1415,6 @@ void sp_selection_to_layer(SPDesktop *dt, SPObject *moveto, bool suppressDone)
sp_selection_delete_impl(items, false, false);
std::vector<Inkscape::XML::Node*> copied = sp_selection_paste_impl(dt->getDocument(), moveto, temp_clip);
selection->setReprList(copied);
- copied.clear();
if (!temp_clip.empty()) temp_clip.clear();
if (moveto) dt->setCurrentLayer(moveto);
if ( !suppressDone ) {
@@ -2051,7 +2047,7 @@ std::vector<SPItem*> sp_get_same_style(SPItem *sel, std::vector<SPItem*> &src, S
sel_style_for_width = new SPStyle(SP_ACTIVE_DOCUMENT);
objects_query_strokewidth (objects, sel_style_for_width);
}
- bool match_g;
+ bool match_g;
for (std::vector<SPItem*>::const_iterator i=src.begin();i!=src.end();i++) {
SPItem *iter = *i;
if (iter) {
@@ -3186,7 +3182,7 @@ void sp_selection_unsymbol(SPDesktop *desktop)
}
}
- for (std::vector<SPObject*>::const_iterator i=children.begin();i!=children.end();i++){
+ for (std::vector<SPObject*>::const_reverse_iterator i=children.rbegin();i!=children.rend();i++){
Inkscape::XML::Node *repr = (*i)->getRepr();
repr->parent()->removeChild(repr);
group->addChild(repr,NULL);