aboutsummaryrefslogtreecommitdiff
path: root/lib/gui/elistbox.cpp
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2005-12-21 02:51:16 +0000
committerFelix Domke <tmbinc@elitedvb.net>2005-12-21 02:51:16 +0000
commit8589eb49ec20d3503a476f398ec84d7ad0307d26 (patch)
tree0db449b7a1505fad104fa0eedc0281d4bb87fc89 /lib/gui/elistbox.cpp
parent28104e76ac84755e4b068cd1316808848882b996 (diff)
downloadenigma2-8589eb49ec20d3503a476f398ec84d7ad0307d26.tar.gz
enigma2-8589eb49ec20d3503a476f398ec84d7ad0307d26.zip
listbox: validate m_items_per_page a bit more
Diffstat (limited to 'lib/gui/elistbox.cpp')
-rw-r--r--lib/gui/elistbox.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/gui/elistbox.cpp b/lib/gui/elistbox.cpp
index bfa09b88..aba74432 100644
--- a/lib/gui/elistbox.cpp
+++ b/lib/gui/elistbox.cpp
@@ -15,6 +15,8 @@ eListbox::eListbox(eWidget *parent)
m_itemheight = 25;
m_selection_enabled = 1;
+ m_items_per_page = 0;
+
ptr->bindAction("ListboxActions", 0, 0, this);
}
@@ -281,6 +283,10 @@ void eListbox::recalcSize()
m_prev_scrollbar_page=-1;
m_content->setSize(eSize(size().width(), m_itemheight));
m_items_per_page = size().height() / m_itemheight;
+
+ if (m_items_per_page < 0) /* TODO: whyever - our size could be invalid, or itemheigh could be wrongly specified. */
+ m_items_per_page = 0;
+
moveSelection(justCheck);
}