mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +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;
|
return;
|
||||||
|
|
||||||
QModelIndex const idxToAdd = selIdx.first();
|
QModelIndex const idxToAdd = selIdx.first();
|
||||||
QModelIndex const idx = selectedLV->currentIndex();
|
|
||||||
int const srows = selectedModel->rowCount();
|
int const srows = selectedModel->rowCount();
|
||||||
|
|
||||||
QMap<int, QVariant> qm = availableModel->itemData(idxToAdd);
|
QMap<int, QVariant> qm = availableModel->itemData(idxToAdd);
|
||||||
@ -293,6 +292,7 @@ void GuiSelectionManager::addPB_clicked()
|
|||||||
|
|
||||||
selectionChanged(); //signal
|
selectionChanged(); //signal
|
||||||
|
|
||||||
|
QModelIndex const idx = selectedLV->currentIndex();
|
||||||
if (idx.isValid())
|
if (idx.isValid())
|
||||||
selectedLV->setCurrentIndex(idx);
|
selectedLV->setCurrentIndex(idx);
|
||||||
|
|
||||||
@ -344,8 +344,7 @@ void GuiSelectionManager::upPB_clicked()
|
|||||||
selectedModel->removeRow(pos);
|
selectedModel->removeRow(pos);
|
||||||
insertRowToSelected(pos - 1, qms);
|
insertRowToSelected(pos - 1, qms);
|
||||||
|
|
||||||
selectionChanged(); //signal
|
idx = selIdx.first();
|
||||||
|
|
||||||
selectedLV->setCurrentIndex(idx.sibling(idx.row() - 1, idx.column()));
|
selectedLV->setCurrentIndex(idx.sibling(idx.row() - 1, idx.column()));
|
||||||
selectedHasFocus_ = true;
|
selectedHasFocus_ = true;
|
||||||
updateHook();
|
updateHook();
|
||||||
@ -372,8 +371,7 @@ void GuiSelectionManager::downPB_clicked()
|
|||||||
selectedModel->removeRow(pos);
|
selectedModel->removeRow(pos);
|
||||||
insertRowToSelected(pos + 1, qms);
|
insertRowToSelected(pos + 1, qms);
|
||||||
|
|
||||||
selectionChanged(); //signal
|
idx = selIdx.first();
|
||||||
|
|
||||||
selectedLV->setCurrentIndex(idx.sibling(idx.row() + 1, idx.column()));
|
selectedLV->setCurrentIndex(idx.sibling(idx.row() + 1, idx.column()));
|
||||||
selectedHasFocus_ = true;
|
selectedHasFocus_ = true;
|
||||||
updateHook();
|
updateHook();
|
||||||
|
Loading…
Reference in New Issue
Block a user