From: Richard Heck Date: Wed, 9 Jan 2008 23:06:16 +0000 (+0000) Subject: Fix copy-paste errors. X-Git-Tag: 1.6.10~6689 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=78cc57cd5a7e4e7d60f0313d132e362e6b3f037c;p=features.git Fix copy-paste errors. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22457 a592a061-630c-0410-9148-cb99ea01b6c8 --- 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();