mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-07 12:32:26 +00:00
Use selectedIndex rather than currentIndex. The latter can be invalid if
the focus has never gotten here. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33856 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
2455df7cdc
commit
0b5ec3d92e
@ -281,7 +281,11 @@ void GuiSelectionManager::deletePB_clicked()
|
||||
|
||||
void GuiSelectionManager::upPB_clicked()
|
||||
{
|
||||
QModelIndex idx = selectedLV->currentIndex();
|
||||
QModelIndexList selIdx =
|
||||
selectedLV->selectionModel()->selectedIndexes();
|
||||
if (selIdx.isEmpty())
|
||||
return;
|
||||
QModelIndex idx = selIdx.first();
|
||||
|
||||
int const pos = idx.row();
|
||||
if (pos <= 0)
|
||||
@ -302,7 +306,11 @@ void GuiSelectionManager::upPB_clicked()
|
||||
|
||||
void GuiSelectionManager::downPB_clicked()
|
||||
{
|
||||
QModelIndex idx = selectedLV->currentIndex();
|
||||
QModelIndexList selIdx =
|
||||
selectedLV->selectionModel()->selectedIndexes();
|
||||
if (selIdx.isEmpty())
|
||||
return;
|
||||
QModelIndex idx = selIdx.first();
|
||||
|
||||
int const pos = idx.row();
|
||||
if (pos >= selectedModel->rowCount() - 1)
|
||||
|
Loading…
Reference in New Issue
Block a user