From 04da0f68fb5caa0d8e98ce2f5d73d136ecdef5d7 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Wed, 24 Mar 2010 13:00:35 +0000 Subject: [PATCH] This should give us the selected index, not the current index. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33850 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiSelectionManager.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/frontends/qt4/GuiSelectionManager.cpp b/src/frontends/qt4/GuiSelectionManager.cpp index ca408b9cd7..2f202d40f9 100644 --- a/src/frontends/qt4/GuiSelectionManager.cpp +++ b/src/frontends/qt4/GuiSelectionManager.cpp @@ -94,22 +94,22 @@ void GuiSelectionManager::update() QModelIndex GuiSelectionManager::getSelectedIndex() const { - bool const have_avl = - !availableLV->selectionModel()->selectedIndexes().isEmpty(); - bool const have_sel = - !selectedLV->selectionModel()->selectedIndexes().isEmpty(); + QModelIndexList avail = availableLV->selectionModel()->selectedIndexes(); + QModelIndexList sel = selectedLV->selectionModel()->selectedIndexes(); + bool const have_avl = !avail.isEmpty(); + bool const have_sel = !sel.isEmpty(); if (selectedFocused()) { if (have_sel) - return selectedLV->currentIndex(); + return sel.front(); if (have_avl) - return availableLV->currentIndex(); + return avail.front(); } else { // available has focus if (have_avl) - return availableLV->currentIndex(); + return avail.front(); if (have_sel) - return selectedLV->currentIndex(); + return sel.front(); } return QModelIndex(); }