mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -04:00
Use Regex instead of wxRegEx everywhere
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1199 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -100,6 +100,7 @@ struct TextElementsFromString {
|
||||
// text element before this tag?
|
||||
addText(te, text, text_start, pos, style, ctx);
|
||||
}
|
||||
// a (formatting) tag
|
||||
size_t tag_start = pos;
|
||||
pos = skip_tag(text, tag_start);
|
||||
if (is_substr(text, tag_start, _( "<b"))) bold += 1;
|
||||
@@ -177,18 +178,21 @@ struct TextElementsFromString {
|
||||
} else {
|
||||
// ignore other tags
|
||||
}
|
||||
// text starts again after the tag
|
||||
text_start = pos;
|
||||
} else {
|
||||
// normal text
|
||||
pos += 1;
|
||||
}
|
||||
}
|
||||
if (text_start < end) {
|
||||
// remaining text at the end
|
||||
addText(te, text, text_start, end, style, ctx);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
/// Create a text element for a piece of text
|
||||
/// Create a text element for a piece of text, text[start..end)
|
||||
void addText(TextElements& te, const String& text, size_t start, size_t end, const TextStyle& style, Context& ctx) {
|
||||
String content = untag(text.substr(start, end - start));
|
||||
assert(content.size() == end-start);
|
||||
|
||||
Reference in New Issue
Block a user