diff src/textfile_gui.cpp @ 20335:cadf6aaa0573 draft

(svn r25287) -Codechange: Keep a reference to the WindowDesc in the Window after construction.
author frosch <frosch@openttd.org>
date Sun, 26 May 2013 19:23:42 +0000
parents 2a11204038e3
children 491ddf49f744
line wrap: on
line diff
--- a/src/textfile_gui.cpp
+++ b/src/textfile_gui.cpp
@@ -42,19 +42,19 @@
 };
 
 /** Window definition for the textfile window */
-static const WindowDesc _textfile_desc(
+static WindowDesc _textfile_desc(
 	WDP_CENTER, 630, 460,
 	WC_TEXTFILE, WC_NONE,
 	0,
 	_nested_textfile_widgets, lengthof(_nested_textfile_widgets)
 );
 
-TextfileWindow::TextfileWindow(TextfileType file_type) : Window(), file_type(file_type)
+TextfileWindow::TextfileWindow(TextfileType file_type) : Window(&_textfile_desc), file_type(file_type)
 {
-	this->CreateNestedTree(&_textfile_desc);
+	this->CreateNestedTree();
 	this->vscroll = this->GetScrollbar(WID_TF_VSCROLLBAR);
 	this->hscroll = this->GetScrollbar(WID_TF_HSCROLLBAR);
-	this->FinishInitNested(&_textfile_desc);
+	this->FinishInitNested();
 	this->GetWidget<NWidgetCore>(WID_TF_CAPTION)->SetDataTip(STR_TEXTFILE_README_CAPTION + file_type, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS);
 }