From: Juergen Spitzmueller Date: Tue, 19 Nov 2019 12:47:32 +0000 (+0100) Subject: Fix crash in selection manager X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=fbc41ecc66201f80678357ae26cd570eb531efe1;p=features.git Fix crash in selection manager Patch by Patrick De Visschere --- diff --git a/src/frontends/qt/GuiSelectionManager.cpp b/src/frontends/qt/GuiSelectionManager.cpp index 4a735ed2d6..d77acbadc6 100644 --- a/src/frontends/qt/GuiSelectionManager.cpp +++ b/src/frontends/qt/GuiSelectionManager.cpp @@ -285,14 +285,14 @@ void GuiSelectionManager::addPB_clicked() return; QModelIndex const idxToAdd = selIdx.first(); - QModelIndex const idx = selectedLV->currentIndex(); int const srows = selectedModel->rowCount(); QMap qm = availableModel->itemData(idxToAdd); insertRowToSelected(srows, qm); selectionChanged(); //signal - + + QModelIndex const idx = selectedLV->currentIndex(); if (idx.isValid()) selectedLV->setCurrentIndex(idx); @@ -344,8 +344,7 @@ void GuiSelectionManager::upPB_clicked() selectedModel->removeRow(pos); insertRowToSelected(pos - 1, qms); - selectionChanged(); //signal - + idx = selIdx.first(); selectedLV->setCurrentIndex(idx.sibling(idx.row() - 1, idx.column())); selectedHasFocus_ = true; updateHook(); @@ -372,8 +371,7 @@ void GuiSelectionManager::downPB_clicked() selectedModel->removeRow(pos); insertRowToSelected(pos + 1, qms); - selectionChanged(); //signal - + idx = selIdx.first(); selectedLV->setCurrentIndex(idx.sibling(idx.row() + 1, idx.column())); selectedHasFocus_ = true; updateHook();