summaryrefslogtreecommitdiff
path: root/src/news_gui.cpp
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2009-07-15 22:17:08 +0000
committeralberth <alberth@openttd.org>2009-07-15 22:17:08 +0000
commit92206f2d18257feb4e95ecce2e48f447bd240201 (patch)
tree8db565fa08a867000f2853bcd886ea33f3c3e66c /src/news_gui.cpp
parentf085d7775b12e77b8012ab09ae72b850367a3237 (diff)
downloadopenttd-92206f2d18257feb4e95ecce2e48f447bd240201.tar.xz
(svn r16837) -Codechange: Collect largest used index while constructing nested widget tree.
Diffstat (limited to 'src/news_gui.cpp')
-rw-r--r--src/news_gui.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/news_gui.cpp b/src/news_gui.cpp
index a91155220..0704d838c 100644
--- a/src/news_gui.cpp
+++ b/src/news_gui.cpp
@@ -1081,7 +1081,13 @@ NEWS_SETTINGS_LINE(28, NT_GENERAL),
{ WIDGETS_END},
};
-static NWidgetBase *MakeNewsSettingLines()
+/**
+ * Make nested widget tree for the news settings.
+ * @param biggest_index Storage for collecting the biggest index used in the returned tree.
+ * @return Panel with rows of news settings.
+ * @postcond \c *biggest_index contains the largest used index in the tree.
+ */
+static NWidgetBase *MakeNewsSettingLines(int *biggest_index)
{
const int NEWS_SETTING_HEIGHT = 12; // Height of one line.
NWidgetVertical *vert = new NWidgetVertical;
@@ -1110,6 +1116,7 @@ static NWidgetBase *MakeNewsSettingLines()
vert->Add(hor);
}
+ *biggest_index = widnum - 1;
return vert;
}