From eb548306e9835339829f3d45e7af5b7aecb18310 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Mon, 24 Mar 2014 12:39:50 -0700 Subject: [PATCH] Don't skip the first dialogue line in the kanji timer --- src/dialog_kara_timing_copy.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/dialog_kara_timing_copy.cpp b/src/dialog_kara_timing_copy.cpp index 7bb615cc3..05ac952b8 100644 --- a/src/dialog_kara_timing_copy.cpp +++ b/src/dialog_kara_timing_copy.cpp @@ -557,8 +557,13 @@ void DialogKanjiTimer::OnStart(wxCommandEvent &) { else if (SourceStyle->GetValue() == DestStyle->GetValue()) wxMessageBox(_("The source and destination styles must be different."),_("Error"),wxICON_EXCLAMATION | wxOK); else { - currentSourceLine = FindNextStyleMatch(&*subs->Events.begin(), from_wx(SourceStyle->GetValue())); - currentDestinationLine = FindNextStyleMatch(&*subs->Events.begin(), from_wx(DestStyle->GetValue())); + currentDestinationLine = currentSourceLine = &*subs->Events.begin(); + auto sourceStyle = from_wx(SourceStyle->GetValue()); + auto destStyle = from_wx(DestStyle->GetValue()); + if (currentSourceLine->Style != sourceStyle) + currentSourceLine = FindNextStyleMatch(currentSourceLine, sourceStyle); + if (currentDestinationLine->Style != destStyle) + currentDestinationLine = FindNextStyleMatch(currentDestinationLine, destStyle); ResetForNewLine(); } LinesToChange.clear();