Codechange: use std::string instead of char* for original editor strings

This commit is contained in:
Rubidium
2023-05-10 21:05:19 +02:00
committed by rubidium42
parent 7e1123c731
commit 6d1586dd49
3 changed files with 9 additions and 23 deletions

View File

@@ -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);