summaryrefslogtreecommitdiff
path: root/src/widgets
diff options
context:
space:
mode:
authorHenry Wilson <m3henry@googlemail.com>2018-09-23 12:23:54 +0100
committerPeterN <peter@fuzzle.org>2019-03-26 20:15:57 +0000
commita690936ed75e96627be0e2ecafee2360a71e8d3c (patch)
tree1221c131b8fe3a51cf43a6bd7d89a51c431c559d /src/widgets
parent56ae855dc20b27593c9a454d5a09d8f892a6c71f (diff)
downloadopenttd-a690936ed75e96627be0e2ecafee2360a71e8d3c.tar.xz
Codechange: Replace SmallVector::Length() with std::vector::size()
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/dropdown.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/widgets/dropdown.cpp b/src/widgets/dropdown.cpp
index f789b47b7..6acbd79c2 100644
--- a/src/widgets/dropdown.cpp
+++ b/src/widgets/dropdown.cpp
@@ -151,7 +151,7 @@ struct DropdownWindow : Window {
DropdownWindow(Window *parent, const DropDownList *list, int selected, int button, bool instant_close, const Point &position, const Dimension &size, Colours wi_colour, bool scroll)
: Window(&_dropdown_desc)
{
- assert(list->Length() > 0);
+ assert(list->size() > 0);
this->position = position;
@@ -180,8 +180,8 @@ struct DropdownWindow : Window {
}
/* Capacity is the average number of items visible */
- this->vscroll->SetCapacity(size.height * (uint16)list->Length() / list_height);
- this->vscroll->SetCount((uint16)list->Length());
+ this->vscroll->SetCapacity(size.height * (uint16)list->size() / list_height);
+ this->vscroll->SetCount((uint16)list->size());
this->parent_wnd_class = parent->window_class;
this->parent_wnd_num = parent->window_number;
@@ -418,7 +418,7 @@ void ShowDropDownListAt(Window *w, const DropDownList *list, int selected, int b
/* If the dropdown doesn't fully fit, we need a dropdown. */
if (height > available_height) {
scroll = true;
- uint avg_height = height / list->Length();
+ uint avg_height = height / list->size();
/* Check at least there is space for one item. */
assert(available_height >= avg_height);
@@ -514,7 +514,7 @@ void ShowDropDownMenu(Window *w, const StringID *strings, int selected, int butt
}
/* No entries in the list? */
- if (list->Length() == 0) {
+ if (list->size() == 0) {
delete list;
return;
}