mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Always pass raw strings to TextFilter's AddLine(). (#13666)
Remove StringID overload, so callers have to preformat the string.pull/13667/head
parent
b376e2655a
commit
8813a798e7
|
@ -234,9 +234,8 @@ bool SettingEntry::UpdateFilterState(SettingFilter &filter, bool force_visible)
|
||||||
/* Process the search text filter for this item. */
|
/* Process the search text filter for this item. */
|
||||||
filter.string.ResetState();
|
filter.string.ResetState();
|
||||||
|
|
||||||
SetDParam(0, STR_EMPTY);
|
filter.string.AddLine(GetString(sd->GetTitle(), STR_EMPTY));
|
||||||
filter.string.AddLine(sd->GetTitle());
|
filter.string.AddLine(GetString(sd->GetHelp()));
|
||||||
filter.string.AddLine(sd->GetHelp());
|
|
||||||
|
|
||||||
visible = filter.string.GetState();
|
visible = filter.string.GetState();
|
||||||
}
|
}
|
||||||
|
@ -530,7 +529,7 @@ bool SettingsPage::UpdateFilterState(SettingFilter &filter, bool force_visible)
|
||||||
{
|
{
|
||||||
if (!force_visible && !filter.string.IsEmpty()) {
|
if (!force_visible && !filter.string.IsEmpty()) {
|
||||||
filter.string.ResetState();
|
filter.string.ResetState();
|
||||||
filter.string.AddLine(this->title);
|
filter.string.AddLine(GetString(this->title));
|
||||||
force_visible = filter.string.GetState();
|
force_visible = filter.string.GetState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -123,29 +123,3 @@ void StringFilter::AddLine(const char *str)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Pass another text line from the current item to the filter.
|
|
||||||
*
|
|
||||||
* You can call this multiple times for a single item, if the filter shall apply to multiple things.
|
|
||||||
* Before processing the next item you have to call ResetState().
|
|
||||||
*
|
|
||||||
* @param str Another line from the item.
|
|
||||||
*/
|
|
||||||
void StringFilter::AddLine(const std::string &str)
|
|
||||||
{
|
|
||||||
AddLine(str.c_str());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Pass another text line from the current item to the filter.
|
|
||||||
*
|
|
||||||
* You can call this multiple times for a single item, if the filter shall apply to multiple things.
|
|
||||||
* Before processing the next item you have to call ResetState().
|
|
||||||
*
|
|
||||||
* @param str Another line from the item.
|
|
||||||
*/
|
|
||||||
void StringFilter::AddLine(StringID str)
|
|
||||||
{
|
|
||||||
AddLine(GetString(str));
|
|
||||||
}
|
|
||||||
|
|
|
@ -58,8 +58,7 @@ public:
|
||||||
|
|
||||||
void ResetState();
|
void ResetState();
|
||||||
void AddLine(const char *str);
|
void AddLine(const char *str);
|
||||||
void AddLine(const std::string &str);
|
void AddLine(const std::string &str) { this->AddLine(str.c_str()); }
|
||||||
void AddLine(StringID str);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the matching state of the current item.
|
* Get the matching state of the current item.
|
||||||
|
|
Loading…
Reference in New Issue