Commit 3c1c44f1 authored by Thomas Holder's avatar Thomas Holder

Fix "Path > Reverse" with node selections

Object-to-path will only re-select if anything was converted. This
preserves node selections if all selected objects are paths.

Fixes #1125
parent da27a4f9
Pipeline #151382533 failed with stages
in 125 minutes and 5 seconds
......@@ -311,13 +311,14 @@ void ObjectSet::toCurves(bool skip_undo)
}
std::vector<SPItem*> selected(items().begin(), items().end());
std::vector<Inkscape::XML::Node*> to_select;
clear();
std::vector<SPItem*> items(selected);
did = sp_item_list_to_curves(items, selected, to_select);
setReprList(to_select);
addList(selected);
if (did) {
setReprList(to_select);
addList(selected);
}
if (desktop()) {
desktop()->clearWaitingCursor();
......@@ -389,13 +390,16 @@ sp_item_list_to_curves(const std::vector<SPItem*> &items, std::vector<SPItem*>&
SPLPEItem *lpeitem = dynamic_cast<SPLPEItem *>(item);
if (lpeitem) {
selected.erase(remove(selected.begin(), selected.end(), item), selected.end());
lpeitem->removeAllPathEffects(true);
SPObject *elemref = document->getObjectById(id);
if (elemref) {
//If the LPE item is a shape is converted to a path so we need to reupdate the item
item = dynamic_cast<SPItem *>(elemref);
selected.push_back(item);
if (elemref != item) {
selected.erase(remove(selected.begin(), selected.end(), item), selected.end());
if (elemref) {
//If the LPE item is a shape is converted to a path so we need to reupdate the item
item = dynamic_cast<SPItem *>(elemref);
selected.push_back(item);
did = true;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment