Changeset - r13767:c61ac7ca125e
[Not reviewed]
master
0 1 0
frosch - 15 years ago 2009-11-26 22:46:13
frosch@openttd.org
(svn r18303) -Fix: Widget indices are valid when >= 0.
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/widget.cpp
Show inline comments
 
@@ -1589,7 +1589,7 @@ NWidgetCore *NWidgetBackground::GetWidge
 

	
 
Scrollbar *NWidgetBackground::FindScrollbar(Window *w, bool allow_next) const
 
{
 
	if (this->index > 0 && allow_next && this->child == NULL && (uint)(this->index) + 1 < w->nested_array_size) {
 
	if (this->index >= 0 && allow_next && this->child == NULL && (uint)(this->index) + 1 < w->nested_array_size) {
 
		const NWidgetCore *next_wid = w->GetWidget<NWidgetCore>(this->index + 1);
 
		if (next_wid != NULL) return next_wid->FindScrollbar(w, false);
 
	}
 
@@ -2058,7 +2058,7 @@ Scrollbar *NWidgetLeaf::FindScrollbar(Wi
 
	if (this->type == WWT_SCROLLBAR) return &w->vscroll;
 
	if (this->type == WWT_SCROLL2BAR) return &w->vscroll2;
 

	
 
	if (this->index > 0 && allow_next && (uint)(this->index) + 1 < w->nested_array_size) {
 
	if (this->index >= 0 && allow_next && (uint)(this->index) + 1 < w->nested_array_size) {
 
		const NWidgetCore *next_wid = w->GetWidget<NWidgetCore>(this->index + 1);
 
		if (next_wid != NULL) return next_wid->FindScrollbar(w, false);
 
	}
0 comments (0 inline, 0 general)