summaryrefslogtreecommitdiff
path: root/osdbase.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2005-01-07 16:19:29 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2005-01-07 16:19:29 +0100
commit5b2aaeaedd5c73edd60afdaaa505b813753f0d32 (patch)
tree7f878e4cc009970e94481a8b42391d2f8fda6881 /osdbase.c
parent4162bff1e773ffa9b86304faeffb4399f838553f (diff)
downloadvdr-5b2aaeaedd5c73edd60afdaaa505b813753f0d32.tar.gz
vdr-5b2aaeaedd5c73edd60afdaaa505b813753f0d32.tar.bz2
Fixed deleting a menu item in case the next item is not selectable
Diffstat (limited to 'osdbase.c')
-rw-r--r--osdbase.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/osdbase.c b/osdbase.c
index 42fda30e..ec04adb8 100644
--- a/osdbase.c
+++ b/osdbase.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: osdbase.c 1.14 2004/07/17 13:29:13 kls Exp $
+ * $Id: osdbase.c 1.15 2005/01/07 16:16:41 kls Exp $
*/
#include "osdbase.h"
@@ -149,8 +149,13 @@ void cOsdMenu::SetHelp(const char *Red, const char *Green, const char *Yellow, c
void cOsdMenu::Del(int Index)
{
cList<cOsdItem>::Del(Get(Index));
- if (current == Count())
- current--;
+ int count = Count();
+ while (current < count && !SelectableItem(current))
+ current++;
+ if (current == count) {
+ while (current > 0 && !SelectableItem(current))
+ current--;
+ }
if (Index == first && first > 0)
first--;
}