aboutsummaryrefslogtreecommitdiff
path: root/guilib
diff options
context:
space:
mode:
authorjmarshallnz <jmarshallnz@svn>2010-12-06 07:25:10 +0000
committerjmarshallnz <jmarshallnz@svn>2010-12-06 07:25:10 +0000
commit1766b7156a860aa80385ebdf79800a969d732988 (patch)
tree55dd31fb7196416e3ebcf246f6d8337e23565009 /guilib
parent7b85dd8823397c6105bde4f963e4634ceddad4f2 (diff)
fixed: #10841 - Control.SetFocus(id,position) failed for position > items.size()
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@35579 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'guilib')
-rw-r--r--guilib/GUIListContainer.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/guilib/GUIListContainer.cpp b/guilib/GUIListContainer.cpp
index f37fc7e930..306f9ce7a6 100644
--- a/guilib/GUIListContainer.cpp
+++ b/guilib/GUIListContainer.cpp
@@ -126,7 +126,10 @@ bool CGUIListContainer::OnMessage(CGUIMessage& message)
else if (message.GetMessage() == GUI_MSG_SETFOCUS)
{
if (message.GetParam1()) // subfocus item is specified, so set the offset appropriately
- m_cursor = (int)message.GetParam1() - 1;
+ {
+ int item = std::min(m_offset + (int)message.GetParam1() - 1, (int)m_items.size() - 1);
+ SelectItem(item);
+ }
}
}
return CGUIBaseContainer::OnMessage(message);