mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
Fix crash in selection manager
Patch by Patrick De Visschere
This commit is contained in:
parent
18dd597feb
commit
5d45c10fc7
@ -285,7 +285,6 @@ void GuiSelectionManager::addPB_clicked()
|
||||
return;
|
||||
|
||||
QModelIndex const idxToAdd = selIdx.first();
|
||||
QModelIndex const idx = selectedLV->currentIndex();
|
||||
int const srows = selectedModel->rowCount();
|
||||
|
||||
QMap<int, QVariant> qm = availableModel->itemData(idxToAdd);
|
||||
@ -293,6 +292,7 @@ void GuiSelectionManager::addPB_clicked()
|
||||
|
||||
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();
|
||||
|
Loading…
Reference in New Issue
Block a user