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,14 +285,14 @@ 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);
|
||||
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();
|
||||
|
Loading…
Reference in New Issue
Block a user