Commit bbb9b085 authored by Joris Steyn's avatar Joris Steyn
Browse files

Fix crash when moving diagram after paste

This also makes the behaviour of the (still partly broken) diagram duplication
a bit more acceptable/usable untill bug 327670 has been resolved.

CCBUG: 327669
parent 5f06e9ae
......@@ -2777,6 +2777,11 @@ bool UMLDoc::addUMLView(UMLView * pView)
return false;
}
// Todo: find better way to update listview item. Depending on how we
// handle bug 327670, the diagram does not need a new ID.
Uml::ID::Type oldID = pView->umlScene()->ID();
UMLListViewItem* listViewItem = UMLApp::app()->listView()->findItem(oldID);
int i = 0;
QString viewName = pView->umlScene()->name();
QString name = viewName;
......@@ -2785,9 +2790,12 @@ bool UMLDoc::addUMLView(UMLView * pView)
}
if (i) { //If name was modified
pView->umlScene()->setName(name);
listViewItem->setText(name);
}
Uml::ID::Type result = assignNewID(pView->umlScene()->ID());
pView->umlScene()->setID(result);
Uml::ID::Type newID = assignNewID(oldID);
pView->umlScene()->setID(newID);
listViewItem->setID(newID);
pView->umlScene()->activateAfterLoad(true);
pView->umlScene()->endPartialWidgetPaste();
......
Supports Markdown
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