mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-21 03:12:41 +01:00
Codechange: Use EnumBitSet for StringValidationSettings. (#13974)
This commit is contained in:
@@ -353,7 +353,7 @@ namespace ScriptObjectInternal {
|
||||
if constexpr (std::is_same_v<std::string, T>) {
|
||||
/* The string must be valid, i.e. not contain special codes. Since some
|
||||
* can be made with GSText, make sure the control codes are removed. */
|
||||
::StrMakeValidInPlace(data, SVS_NONE);
|
||||
::StrMakeValidInPlace(data, {});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -204,7 +204,7 @@ void ScriptText::ParamCheck::Encode(std::back_insert_iterator<std::string> &outp
|
||||
void operator()(std::string value)
|
||||
{
|
||||
Utf8Encode(this->output, SCC_ENCODED_STRING);
|
||||
StrMakeValidInPlace(value, SVS_REPLACE_WITH_QUESTION_MARK | SVS_ALLOW_NEWLINE | SVS_REPLACE_TAB_CR_NL_WITH_SPACE);
|
||||
StrMakeValidInPlace(value, {StringValidationSetting::ReplaceWithQuestionMark, StringValidationSetting::AllowNewline, StringValidationSetting::ReplaceTabCrNlWithSpace});
|
||||
fmt::format_to(this->output, "{}", value);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user