]> git.lyx.org Git - features.git/commitdiff
Fix copy-paste errors.
authorRichard Heck <rgheck@comcast.net>
Wed, 9 Jan 2008 23:06:16 +0000 (23:06 +0000)
committerRichard Heck <rgheck@comcast.net>
Wed, 9 Jan 2008 23:06:16 +0000 (23:06 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22457 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiSelectionManager.cpp

index 88946f501ec7a76eea4ecf31d1ab71971d2c45e1..a762aad26babbb4de3f32be93e489bbc8bb32613 100644 (file)
@@ -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();