summaryrefslogtreecommitdiff
path: root/src/widgets/dropdown_type.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2013-11-24 14:46:26 +0000
committerrubidium <rubidium@openttd.org>2013-11-24 14:46:26 +0000
commit83eeba28b7272a870f777f2f21bfc1def36e873f (patch)
tree592e23a29d5235307e2984cbd8220d0cd3a1ec76 /src/widgets/dropdown_type.h
parentdb894b0b3fa13413cdb76989cfcd2bb789243b77 (diff)
downloadopenttd-83eeba28b7272a870f777f2f21bfc1def36e873f.tar.xz
(svn r26086) -Codechange: use AutoDeleteSmallVector instead std::list for dropdowns
Diffstat (limited to 'src/widgets/dropdown_type.h')
-rw-r--r--src/widgets/dropdown_type.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/widgets/dropdown_type.h b/src/widgets/dropdown_type.h
index b923445bb..90ecef1fb 100644
--- a/src/widgets/dropdown_type.h
+++ b/src/widgets/dropdown_type.h
@@ -14,8 +14,8 @@
#include "../window_type.h"
#include "../gfx_func.h"
+#include "../core/smallvec_type.hpp"
#include "table/strings.h"
-#include <list>
/**
* Base list item class from which others are derived. If placed in a list it
@@ -50,7 +50,7 @@ public:
virtual void Draw(int left, int right, int top, int bottom, bool sel, int bg_colour) const;
virtual StringID String() const { return this->string; }
- static bool NatSortFunc(const DropDownListItem *first, const DropDownListItem *second);
+ static CDECL int NatSortFunc(const DropDownListItem * const *first, const DropDownListItem * const *second);
};
/**
@@ -83,10 +83,10 @@ public:
/**
* A drop down list is a collection of drop down list items.
*/
-typedef std::list<DropDownListItem *> DropDownList;
+typedef AutoDeleteSmallVector<const DropDownListItem *, 4> DropDownList;
-void ShowDropDownListAt(Window *w, DropDownList *list, int selected, int button, Rect wi_rect, Colours wi_colour, bool auto_width = false, bool instant_close = false);
+void ShowDropDownListAt(Window *w, const DropDownList *list, int selected, int button, Rect wi_rect, Colours wi_colour, bool auto_width = false, bool instant_close = false);
-void ShowDropDownList(Window *w, DropDownList *list, int selected, int button, uint width = 0, bool auto_width = false, bool instant_close = false);
+void ShowDropDownList(Window *w, const DropDownList *list, int selected, int button, uint width = 0, bool auto_width = false, bool instant_close = false);
#endif /* WIDGETS_DROPDOWN_TYPE_H */