Codechange: return std::string_view for Textbuf::GetText()

This commit is contained in:
Rubidium
2025-04-29 17:31:32 +02:00
committed by rubidium42
parent 261e09a549
commit ef71ce0a9d
12 changed files with 52 additions and 48 deletions
+4 -1
View File
@@ -2112,7 +2112,10 @@ struct SavePresetWindow : public Window {
case WID_SVP_SAVE: {
Window *w = FindWindowById(WC_GAME_OPTIONS, WN_GAME_OPTIONS_NEWGRF_STATE);
if (w != nullptr && !StrEmpty(this->presetname_editbox.text.GetText())) w->OnQueryTextFinished(this->presetname_editbox.text.GetText());
if (w != nullptr) {
auto text = this->presetname_editbox.text.GetText();
if (!text.empty()) w->OnQueryTextFinished(std::string{text});
}
this->Close();
break;
}