mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Added StringView type (similar to std::string_view)
This commit is contained in:
@@ -153,18 +153,18 @@ unique_ptr<TextValueAction> toggle_format_action(const TextValueP& value, const
|
||||
// Are we inside the tag we are toggling?
|
||||
if (!is_in_tag(str, _("<") + tag, start_i, end_i)) {
|
||||
// we are not inside this tag, add it
|
||||
new_value = str.substr(0, start_i);
|
||||
new_value = substr(str, 0, start_i);
|
||||
new_value += _("<") + tag + _(">");
|
||||
new_value += str.substr(start_i, end_i - start_i);
|
||||
new_value += substr(str, start_i, end_i - start_i);
|
||||
new_value += _("</") + tag + _(">");
|
||||
new_value += str.substr(end_i);
|
||||
new_value += substr(str, end_i);
|
||||
} else {
|
||||
// we are inside this tag, 'remove' it
|
||||
new_value = str.substr(0, start_i);
|
||||
new_value = substr(str, 0, start_i);
|
||||
new_value += _("</") + tag + _(">");
|
||||
new_value += str.substr(start_i, end_i - start_i);
|
||||
new_value += substr(str, start_i, end_i - start_i);
|
||||
new_value += _("<") + tag + _(">");
|
||||
new_value += str.substr(end_i);
|
||||
new_value += substr(str, end_i);
|
||||
}
|
||||
// Build action
|
||||
if (start != end) {
|
||||
|
||||
@@ -65,7 +65,7 @@ void read_compat(Reader& handler, Keyword* k) {
|
||||
size_t start = separator.find_first_of('[');
|
||||
size_t end = separator.find_first_of(']');
|
||||
if (start != String::npos && end != String::npos) {
|
||||
k->match += separator.substr(start + 1, end - start - 1);
|
||||
k->match += substr(separator, start + 1, end - start - 1);
|
||||
}
|
||||
if (parameter == _("no parameter")) {
|
||||
parameter.clear(); // was used for magic to indicate absence of parameter
|
||||
|
||||
Reference in New Issue
Block a user