From 82ca2a4b7091f2f158081f48161f3bea0a7867dc Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Fri, 8 Oct 2010 06:06:44 +0000 Subject: [PATCH] Fix issues with the edit box buttons and omitted tag parameters Originally committed to SVN as r4795. --- aegisub/src/subs_edit_box.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/aegisub/src/subs_edit_box.cpp b/aegisub/src/subs_edit_box.cpp index 36e08375e..03b85b369 100644 --- a/aegisub/src/subs_edit_box.cpp +++ b/aegisub/src/subs_edit_box.cpp @@ -120,11 +120,11 @@ template static T get_value(AssDialogue const& line, int blockn, T initial, wxString tag, wxString alt = "") { for (int i = blockn; i >= 0; i--) { AssDialogueBlockOverride *ovr = dynamic_cast(line.Blocks[i]); - if (ovr) { - for (int j = (int)ovr->Tags.size() - 1; j >= 0; j--) { - if (ovr->Tags[j]->Name == tag || ovr->Tags[j]->Name == alt) { - return ovr->Tags[j]->Params[0]->Get(); - } + if (!ovr) continue; + + for (int j = (int)ovr->Tags.size() - 1; j >= 0; j--) { + if (ovr->Tags[j]->Name == tag || ovr->Tags[j]->Name == alt) { + return ovr->Tags[j]->Params[0]->Get(initial); } } } @@ -735,6 +735,7 @@ void SubsEditBox::SetTag(wxString tag, wxString value, bool atEnd) { } else { ovr->Tags[i]->Params[0]->Set(value); + ovr->Tags[i]->Params[0]->omitted = false; found = true; } }