From ef4502cc02b4a1b287b6710826f04f953fd4691b Mon Sep 17 00:00:00 2001 From: louis Date: Sun, 2 Nov 2014 11:41:41 +0100 Subject: [PATCH] fixed Bug with menuselection Patch --- HISTORY | 1 + views/displaymenulistview.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/HISTORY b/HISTORY index f81da89..0693f0e 100644 --- a/HISTORY +++ b/HISTORY @@ -53,4 +53,5 @@ Version 0.0.3 - optimized performance when creating a menu list - fixed Bug that displaychannel was not shown after closing displaymenu with "backspace" (with active menuorg plugin) +- fixed Bug with menuselection Patch diff --git a/views/displaymenulistview.c b/views/displaymenulistview.c index eb8581e..c5f1506 100644 --- a/views/displaymenulistview.c +++ b/views/displaymenulistview.c @@ -95,6 +95,8 @@ void cDisplayMenuListView::Clear(void) { } void cDisplayMenuListView::AddDefaultMenuItem(int index, string *tabTexts, bool current, bool selectable) { + if (index >= itemCount) + return; if (menuItems[index]) { cDisplayMenuItemDefaultView *menuItem = dynamic_cast(menuItems[index]); if (!menuItem) @@ -114,6 +116,8 @@ void cDisplayMenuListView::AddDefaultMenuItem(int index, string *tabTexts, bool } void cDisplayMenuListView::AddMainMenuItem(int index, const char *itemText, bool current, bool selectable) { + if (index >= itemCount) + return; if (menuItems[index]) { menuItems[index]->SetCurrent(current); return; @@ -123,6 +127,8 @@ void cDisplayMenuListView::AddMainMenuItem(int index, const char *itemText, bool } void cDisplayMenuListView::AddSetupMenuItem(int index, const char *itemText, bool current, bool selectable) { + if (index >= itemCount) + return; if (menuItems[index]) { menuItems[index]->SetCurrent(current); return; @@ -133,6 +139,8 @@ void cDisplayMenuListView::AddSetupMenuItem(int index, const char *itemText, boo void cDisplayMenuListView::AddSchedulesMenuItem(int index, const cEvent *event, const cChannel *channel, eTimerMatch timerMatch, eMenuCategory cat, bool current, bool selectable) { + if (index >= itemCount) + return; if (menuItems[index]) { menuItems[index]->SetCurrent(current); return; @@ -142,6 +150,8 @@ void cDisplayMenuListView::AddSchedulesMenuItem(int index, const cEvent *event, } void cDisplayMenuListView::AddChannelsMenuItem(int index, const cChannel *channel, bool withProvider, bool current, bool selectable) { + if (index >= itemCount) + return; if (menuItems[index]) { menuItems[index]->SetCurrent(current); return; @@ -151,6 +161,8 @@ void cDisplayMenuListView::AddChannelsMenuItem(int index, const cChannel *channe } void cDisplayMenuListView::AddTimersMenuItem(int index, const cTimer *timer, bool current, bool selectable) { + if (index >= itemCount) + return; if (menuItems[index]) { menuItems[index]->SetCurrent(current); return; @@ -160,6 +172,8 @@ void cDisplayMenuListView::AddTimersMenuItem(int index, const cTimer *timer, boo } void cDisplayMenuListView::AddRecordingMenuItem(int index, const cRecording *recording, int level, int total, int isNew, bool current, bool selectable) { + if (index >= itemCount) + return; if (menuItems[index]) { menuItems[index]->SetCurrent(current); return; @@ -169,6 +183,8 @@ void cDisplayMenuListView::AddRecordingMenuItem(int index, const cRecording *rec } void cDisplayMenuListView::AddTracksMenuItem(int index, const char *title, bool current, bool selectable) { + if (index >= itemCount) + return; if (menuItems[index]) { menuItems[index]->SetCurrent(current); return;