Add the curly braces in AssDialogueBlockOverride::GetText

All of the calling code added them, so there's no reason not to just do
it in one place.
This commit is contained in:
Thomas Goyne 2012-12-04 19:49:05 -08:00
parent 17ffacb6a0
commit c1ed667025
3 changed files with 5 additions and 10 deletions

View file

@ -289,14 +289,8 @@ void AssDialogue::StripTag(wxString const& tag_name) {
void AssDialogue::UpdateText(boost::ptr_vector<AssDialogueBlock>& blocks) { void AssDialogue::UpdateText(boost::ptr_vector<AssDialogueBlock>& blocks) {
if (blocks.empty()) return; if (blocks.empty()) return;
Text.clear(); Text.clear();
for (auto& block : blocks) { for (auto& block : blocks)
if (block.GetType() == BLOCK_OVERRIDE) { Text += block.GetText();
Text += "{";
Text += block.GetText();
Text += "}";
}
else Text += block.GetText();
}
} }
void AssDialogue::SetMarginString(wxString const& origvalue, int which) { void AssDialogue::SetMarginString(wxString const& origvalue, int which) {

View file

@ -92,9 +92,10 @@ void AssDialogueBlockOverride::AddTag(wxString const& tag) {
} }
wxString AssDialogueBlockOverride::GetText() { wxString AssDialogueBlockOverride::GetText() {
text.clear(); text = "{";
for (auto tag : Tags) for (auto tag : Tags)
text += *tag; text += *tag;
text += "}";
return text; return text;
} }

View file

@ -254,7 +254,7 @@ void DialogTranslation::UpdateDisplay() {
} }
} }
else if (block.GetType() == BLOCK_OVERRIDE) else if (block.GetType() == BLOCK_OVERRIDE)
original_text->AppendText("{" + block.GetText() + "}"); original_text->AppendText(block.GetText());
++i; ++i;
} }