diff options
author | Aleks Kissinger <aleks0@gmail.com> | 2018-04-15 12:11:19 +0300 |
---|---|---|
committer | Aleks Kissinger <aleks0@gmail.com> | 2018-04-15 12:11:19 +0300 |
commit | 34b60b77d3f9830ddb6a0107bd65aa3c79701305 (patch) | |
tree | 9a3bf10d31c199017249437e0f6880b3803addb9 /src/gui/undocommands.cpp | |
parent | 10d739ce2ac904501a6f78b127f91c944a774a18 (diff) |
fixed crash on paste
Diffstat (limited to 'src/gui/undocommands.cpp')
-rw-r--r-- | src/gui/undocommands.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/undocommands.cpp b/src/gui/undocommands.cpp index 6d3162c..daa2fee 100644 --- a/src/gui/undocommands.cpp +++ b/src/gui/undocommands.cpp @@ -279,7 +279,7 @@ void ApplyStyleToNodesCommand::redo() PasteCommand::PasteCommand(TikzScene *scene, Graph *graph, QUndoCommand *parent) : GraphUpdateCommand(scene, parent), _graph(graph) { - _oldSelection = scene->selectedItems(); + scene->getSelection(_oldSelectedNodes, _oldSelectedEdges); } void PasteCommand::undo() @@ -304,7 +304,8 @@ void PasteCommand::undo() _scene->graph()->removeNode(n); } - foreach (auto it, _oldSelection) it->setSelected(true); + foreach(Node *n, _oldSelectedNodes) _scene->nodeItems()[n]->setSelected(true); + foreach(Edge *e, _oldSelectedEdges) _scene->edgeItems()[e]->setSelected(true); GraphUpdateCommand::undo(); } |