Codechange: Pass WindowDesc by reference instead of pointer. (#12771)

WindowDesc as passed to Windows is not optional so don't allow to it to be nullptr.
This commit is contained in:
Peter Nelson
2024-06-11 08:58:03 +01:00
committed by GitHub
parent 18bce69623
commit 4cf6d1dd79
68 changed files with 293 additions and 301 deletions
+4 -4
View File
@@ -142,7 +142,7 @@ struct SignListWindow : Window, SignList {
int text_offset; ///< Offset of the sign text relative to the left edge of the WID_SIL_LIST widget.
Scrollbar *vscroll;
SignListWindow(WindowDesc *desc, WindowNumber window_number) : Window(desc), filter_editbox(MAX_LENGTH_SIGN_NAME_CHARS * MAX_CHAR_LENGTH, MAX_LENGTH_SIGN_NAME_CHARS)
SignListWindow(WindowDesc &desc, WindowNumber window_number) : Window(desc), filter_editbox(MAX_LENGTH_SIGN_NAME_CHARS * MAX_CHAR_LENGTH, MAX_LENGTH_SIGN_NAME_CHARS)
{
this->CreateNestedTree();
this->vscroll = this->GetScrollbar(WID_SIL_SCROLLBAR);
@@ -398,7 +398,7 @@ static WindowDesc _sign_list_desc(
*/
Window *ShowSignList()
{
return AllocateWindowDescFront<SignListWindow>(&_sign_list_desc, 0);
return AllocateWindowDescFront<SignListWindow>(_sign_list_desc, 0);
}
/**
@@ -418,7 +418,7 @@ struct SignWindow : Window, SignList {
QueryString name_editbox;
SignID cur_sign;
SignWindow(WindowDesc *desc, const Sign *si) : Window(desc), name_editbox(MAX_LENGTH_SIGN_NAME_CHARS * MAX_CHAR_LENGTH, MAX_LENGTH_SIGN_NAME_CHARS)
SignWindow(WindowDesc &desc, const Sign *si) : Window(desc), name_editbox(MAX_LENGTH_SIGN_NAME_CHARS * MAX_CHAR_LENGTH, MAX_LENGTH_SIGN_NAME_CHARS)
{
this->querystrings[WID_QES_TEXT] = &this->name_editbox;
this->name_editbox.caption = STR_EDIT_SIGN_CAPTION;
@@ -582,7 +582,7 @@ void ShowRenameSignWindow(const Sign *si)
/* Delete all other edit windows */
CloseWindowByClass(WC_QUERY_STRING);
new SignWindow(&_query_sign_edit_desc, si);
new SignWindow(_query_sign_edit_desc, si);
}
/**