From 78cc57cd5a7e4e7d60f0313d132e362e6b3f037c Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Wed, 9 Jan 2008 23:06:16 +0000 Subject: [PATCH] Fix copy-paste errors. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22457 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiSelectionManager.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/frontends/qt4/GuiSelectionManager.cpp b/src/frontends/qt4/GuiSelectionManager.cpp index 88946f501e..a762aad26b 100644 --- a/src/frontends/qt4/GuiSelectionManager.cpp +++ b/src/frontends/qt4/GuiSelectionManager.cpp @@ -90,6 +90,10 @@ void GuiSelectionManager::updateAddPB() void GuiSelectionManager::updateDelPB() { int const srows = selectedLV->model()->rowCount(); + if (srows == 0) { + deletePB->setEnabled(false); + return; + } QModelIndexList const selSels = selectedLV->selectionModel()->selectedIndexes(); int const sel_nr = selSels.empty() ? -1 : selSels.first().row(); @@ -97,9 +101,13 @@ void GuiSelectionManager::updateDelPB() } -void GuiSelectionManager::updateDownPB() +void GuiSelectionManager::updateUpPB() { int const srows = selectedLV->model()->rowCount(); + if (srows == 0) { + upPB->setEnabled(false); + return; + } QModelIndexList const selSels = selectedLV->selectionModel()->selectedIndexes(); int const sel_nr = selSels.empty() ? -1 : selSels.first().row(); @@ -107,9 +115,13 @@ void GuiSelectionManager::updateDownPB() } -void GuiSelectionManager::updateUpPB() +void GuiSelectionManager::updateDownPB() { int const srows = selectedLV->model()->rowCount(); + if (srows == 0) { + downPB->setEnabled(false); + return; + } QModelIndexList const selSels = selectedLV->selectionModel()->selectedIndexes(); int const sel_nr = selSels.empty() ? -1 : selSels.first().row();