Add "undo" for ASS style changes

This commit is contained in:
Nikolaj Olsson 2017-09-06 16:51:15 +02:00
parent ee78090499
commit f52895fc51
2 changed files with 10 additions and 0 deletions

View File

@ -221,6 +221,7 @@ namespace Nikse.SubtitleEdit.Core
fileModified = _history[index].FileModified;
originalSubtitle = new Subtitle(_history[index].OriginalSubtitle);
originalSubtitleFileName = _history[index].OriginalSubtitleFileName;
Header = _history[index].Subtitle.Header;
return FileName;
}

View File

@ -19724,6 +19724,11 @@ namespace Nikse.SubtitleEdit.Forms
styles = new SubStationAlphaStyles(_subtitle, format);
if (styles.ShowDialog(this) == DialogResult.OK)
{
if (_subtitle.Header != styles.Header)
{
MakeHistoryForUndo(styles.Text);
}
_subtitle.Header = styles.Header;
var styleList = AdvancedSubStationAlpha.GetStylesFromHeader(_subtitle.Header);
if (styleList.Count > 0)
@ -19745,6 +19750,10 @@ namespace Nikse.SubtitleEdit.Forms
styles = new TimedTextStyles(_subtitle);
if (styles.ShowDialog(this) == DialogResult.OK)
{
if (_subtitle.Header != styles.Header)
{
MakeHistoryForUndo(styles.Text);
}
_subtitle.Header = styles.Header;
}
}