Don't try to use the active line in a handler for COMMIT_NEW as it may not be valid
Originally committed to SVN as r5874.
This commit is contained in:
parent
28c7e7dec3
commit
c119d2d84b
1 changed files with 3 additions and 1 deletions
|
@ -340,7 +340,6 @@ void SubsEditBox::Update(int type) {
|
|||
if (type == AssFile::COMMIT_NEW || type & AssFile::COMMIT_STYLES) {
|
||||
StyleBox->Clear();
|
||||
StyleBox->Append(c->ass->GetStyles());
|
||||
StyleBox->Select(StyleBox->FindString(line->Style));
|
||||
}
|
||||
|
||||
if (type == AssFile::COMMIT_NEW) {
|
||||
|
@ -351,6 +350,9 @@ void SubsEditBox::Update(int type) {
|
|||
SetEvtHandlerEnabled(true);
|
||||
return;
|
||||
}
|
||||
else if (type & AssFile::COMMIT_STYLES)
|
||||
StyleBox->Select(StyleBox->FindString(line->Style));
|
||||
|
||||
if (!(type ^ AssFile::COMMIT_ORDER)) return;
|
||||
|
||||
SetControlsState(!!line);
|
||||
|
|
Loading…
Reference in a new issue