Codechange: use std::string instead of char* for original editor strings
This commit is contained in:
@@ -971,7 +971,7 @@ struct QueryStringWindow : public Window
|
||||
|
||||
this->editbox.text.UpdateSize();
|
||||
|
||||
if ((flags & QSF_ACCEPT_UNCHANGED) == 0) this->editbox.orig = stredup(this->editbox.text.buf);
|
||||
if ((flags & QSF_ACCEPT_UNCHANGED) == 0) this->editbox.orig = this->editbox.text.buf;
|
||||
|
||||
this->querystrings[WID_QS_TEXT] = &this->editbox;
|
||||
this->editbox.caption = caption;
|
||||
@@ -1033,7 +1033,7 @@ struct QueryStringWindow : public Window
|
||||
|
||||
void OnOk()
|
||||
{
|
||||
if (this->editbox.orig == nullptr || strcmp(this->editbox.text.buf, this->editbox.orig) != 0) {
|
||||
if (!this->editbox.orig.has_value() || this->editbox.text.buf != this->editbox.orig) {
|
||||
assert(this->parent != nullptr);
|
||||
|
||||
this->parent->OnQueryTextFinished(this->editbox.text.buf);
|
||||
|
Reference in New Issue
Block a user