From b580ead08036ec65fece878163d0c092d340d0c8 Mon Sep 17 00:00:00 2001 From: Jinhao Date: Mon, 28 Nov 2016 07:59:18 +0800 Subject: [PATCH] remove useless code --- source/gui/widgets/listbox.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/source/gui/widgets/listbox.cpp b/source/gui/widgets/listbox.cpp index 35f4300c..226c3ae5 100644 --- a/source/gui/widgets/listbox.cpp +++ b/source/gui/widgets/listbox.cpp @@ -2255,12 +2255,9 @@ namespace nana /// @param with_rest: Means whether including extra one item that is not completely contained in reset pixels. size_type number_of_lister_items(bool with_rest) const { - unsigned lister_s = content_area().height - header_visible_px() - (scroll.h.empty() ? 0 : scroll.scale); - - auto item_px = (std::max)(static_castitem_height)>(1), scheme_ptr->item_height); - item_px = scheme_ptr->item_height; - - return (lister_s / item_px) + (with_rest && (lister_s % item_px) ? 1 : 0); + unsigned exposed_px = content_area().height - header_visible_px() - (scroll.h.empty() ? 0 : scroll.scale); + auto const item_px = (std::max)(static_castitem_height)>(1), scheme_ptr->item_height); + return (exposed_px / item_px) + (with_rest && (exposed_px % item_px) ? 1 : 0); } //keep the first selected item in the display area: the distances are in display positions!