Merge branch 'master' into jgrpp
# Conflicts: # cmake/CompileFlags.cmake # src/cargomonitor.cpp # src/core/CMakeLists.txt # src/economy.cpp # src/landscape.cpp # src/linkgraph/flowmapper.cpp # src/linkgraph/linkgraph_gui.cpp # src/linkgraph/linkgraphschedule.cpp # src/misc_gui.cpp # src/newgrf_generic.cpp # src/newgrf_storage.cpp # src/rail_gui.cpp # src/saveload/afterload.cpp # src/saveload/station_sl.cpp # src/script/script_gui.cpp # src/station_cmd.cpp # src/station_gui.cpp # src/string_func.h # src/terraform_cmd.cpp
This commit is contained in:
@@ -1052,7 +1052,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;
|
||||
@@ -1114,14 +1114,10 @@ struct QueryStringWindow : public Window
|
||||
|
||||
void OnOk()
|
||||
{
|
||||
if (this->editbox.orig == nullptr || strcmp(this->editbox.text.buf, this->editbox.orig) != 0) {
|
||||
/* If the parent is nullptr, the editbox is handled by general function
|
||||
* HandleOnEditText */
|
||||
if (this->parent != nullptr) {
|
||||
this->parent->OnQueryTextFinished(this->editbox.text.buf);
|
||||
} else {
|
||||
NOT_REACHED();
|
||||
}
|
||||
if (!this->editbox.orig.has_value() || this->editbox.text.buf != this->editbox.orig) {
|
||||
assert(this->parent != nullptr);
|
||||
|
||||
this->parent->OnQueryTextFinished(this->editbox.text.buf);
|
||||
this->editbox.handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user