* 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.
This commit is contained in:
harukalover 2009-05-14 17:29:07 +00:00
parent 2acf887157
commit ce15bc55bc

View file

@ -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());
}