From 370b98618129c74fd0039b6c023d027c5d8ad981 Mon Sep 17 00:00:00 2001 From: harukalover Date: Thu, 14 May 2009 17:29:07 +0000 Subject: [PATCH] * Fixed the styling assistant marking the script as modified when it was unfocused and the Enable preview checkbox was unchecked even if no changes actually were made in the styling assistant. * Removed some no longer needed code in the styling assistant. Originally committed to SVN as r2923. --- aegisub/src/dialog_styling_assistant.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/aegisub/src/dialog_styling_assistant.cpp b/aegisub/src/dialog_styling_assistant.cpp index 715754e20..6393453a4 100644 --- a/aegisub/src/dialog_styling_assistant.cpp +++ b/aegisub/src/dialog_styling_assistant.cpp @@ -154,11 +154,6 @@ wxDialog (parent, -1, _("Styling assistant"), wxDefaultPosition, wxDefaultSize, // h4x origColour = TypeBox->GetBackgroundColour(); - - // Set selection - wxArrayInt sel = grid->GetSelection(); - if (sel.Count() > 0) JumpToLine(sel[0]); - else JumpToLine(0); } @@ -253,9 +248,10 @@ END_EVENT_TABLE() void DialogStyling::OnActivate(wxActivateEvent &event) { // Dialog lost focus if (!event.GetActive()) { - if (!PreviewCheck->IsChecked()) { + if (needCommit) { grid->ass->FlagAsModified(_("styling assistant")); grid->CommitChanges(); + needCommit = false; } return; } @@ -268,8 +264,7 @@ void DialogStyling::OnActivate(wxActivateEvent &event) { // Fix style list Styles->Set(grid->ass->GetStyles()); // Fix line selection - linen = grid->GetFirstSelRow(); - JumpToLine(linen); + JumpToLine(grid->GetFirstSelRow()); }