Commit 15c4ca93 authored by Clément Fauconnier's avatar Clément Fauconnier

fixed a crash when replacing active document during import

parent efbba6dc
......@@ -238,6 +238,12 @@ QDialog::DialogCode UBPersistenceManager::processInteractiveReplacementDialog(UB
if (i != -1) { //replace
QModelIndex replaceIndex = mDocumentTreeStructureModel->index(i, 0, parentIndex);
UBDocumentProxy *replaceProxy = mDocumentTreeStructureModel->proxyData(replaceIndex);
if (mDocumentTreeStructureModel->currentIndex() == replaceIndex)
{
UBApplication::documentController->selectDocument(pProxy, true, true);
}
if (replaceProxy) {
deleteDocument(replaceProxy);
}
......
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