diff options
author | frosch <frosch@openttd.org> | 2012-11-14 22:50:21 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2012-11-14 22:50:21 +0000 |
commit | 6653ac6b362cf88a6b77a4e8dd3c6926885c6b5f (patch) | |
tree | 390b2ccf0ad8f69cd6682320ebdbcbdda0ae31ce /src/network | |
parent | f6d4200f86e93828a4a58a957d6ae7d9d5497a86 (diff) | |
download | openttd-6653ac6b362cf88a6b77a4e8dd3c6926885c6b5f.tar.xz |
(svn r24739) -Codechange: Simplify some code by using Textbuf::Assign.
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/network_chat_gui.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/network/network_chat_gui.cpp b/src/network/network_chat_gui.cpp index af5782037..d3caed015 100644 --- a/src/network/network_chat_gui.cpp +++ b/src/network/network_chat_gui.cpp @@ -437,14 +437,11 @@ struct NetworkChatWindow : public QueryStringBaseWindow { /* Change to the found name. Add ': ' if we are at the start of the line (pretty) */ if (pre_buf == tb_buf) { - snprintf(tb->buf, this->edit_str_size, "%s: ", cur_name); + this->text.Print("%s: ", cur_name); } else { - snprintf(tb->buf, this->edit_str_size, "%s %s", pre_buf, cur_name); + this->text.Print("%s %s", pre_buf, cur_name); } - /* Update the textbuffer */ - this->text.UpdateSize(); - this->SetDirty(); free(pre_buf); return; @@ -453,12 +450,9 @@ struct NetworkChatWindow : public QueryStringBaseWindow { if (second_scan) { /* We walked all posibilities, and the user presses tab again.. revert to original text */ - strcpy(tb->buf, _chat_tab_completion_buf); + this->text.Assign(_chat_tab_completion_buf); _chat_tab_completion_active = false; - /* Update the textbuffer */ - this->text.UpdateSize(); - this->SetDirty(); } free(pre_buf); |