From 15c4ca9323473f4a7a67c3833be950343b8fc1e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fauconnier?= Date: Fri, 19 Jul 2019 13:11:48 +0200 Subject: [PATCH] fixed a crash when replacing active document during import --- src/core/UBPersistenceManager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/UBPersistenceManager.cpp b/src/core/UBPersistenceManager.cpp index 75b16376..f64edaec 100644 --- a/src/core/UBPersistenceManager.cpp +++ b/src/core/UBPersistenceManager.cpp @@ -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); }