summaryrefslogtreecommitdiff
path: root/src/signs_gui.cpp
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2012-11-14 22:50:17 +0000
committerfrosch <frosch@openttd.org>2012-11-14 22:50:17 +0000
commitf6d4200f86e93828a4a58a957d6ae7d9d5497a86 (patch)
tree2d940ae42f1f273a19c2c33f2858feab9122d9c2 /src/signs_gui.cpp
parent0ea21523556a345d38933ee2dd6dcdca0ec08514 (diff)
downloadopenttd-f6d4200f86e93828a4a58a957d6ae7d9d5497a86.tar.xz
(svn r24738) -Codechange: Remove Textbuf::Initialize in favour of a constructor.
Diffstat (limited to 'src/signs_gui.cpp')
-rw-r--r--src/signs_gui.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp
index a7af05dbf..09739e6f5 100644
--- a/src/signs_gui.cpp
+++ b/src/signs_gui.cpp
@@ -159,8 +159,6 @@ struct SignListWindow : QueryStringBaseWindow, SignList {
this->ok_button = WID_SIL_FILTER_ENTER_BTN;
this->cancel_button = WID_SIL_FILTER_CLEAR_BTN;
this->afilter = CS_ALPHANUMERAL;
- this->text.Initialize(this->edit_str_buf, MAX_LENGTH_SIGN_NAME_CHARS * MAX_CHAR_LENGTH, MAX_LENGTH_SIGN_NAME_CHARS);
- ClearFilterTextWidget();
/* Initialize the filtering variables */
this->SetFilterString("");
@@ -450,19 +448,15 @@ struct SignWindow : QueryStringBaseWindow, SignList {
void UpdateSignEditWindow(const Sign *si)
{
- char *last_of = &this->edit_str_buf[this->edit_str_size - 1]; // points to terminating '\0'
-
/* Display an empty string when the sign hasnt been edited yet */
if (si->name != NULL) {
SetDParam(0, si->index);
- GetString(this->edit_str_buf, STR_SIGN_NAME, last_of);
+ this->text.Assign(STR_SIGN_NAME);
} else {
- GetString(this->edit_str_buf, STR_EMPTY, last_of);
+ this->text.DeleteAll();
}
- *last_of = '\0';
this->cur_sign = si->index;
- this->text.Initialize(this->edit_str_buf, this->edit_str_size, this->max_chars);
this->SetWidgetDirty(WID_QES_TEXT);
this->SetFocusedWidget(WID_QES_TEXT);