fixed a crash when replacing active document during import

preferencesAboutTextFull
Clément Fauconnier 5 years ago
parent efbba6dce4
commit 15c4ca9323
  1. 6
      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);
}

Loading…
Cancel
Save