Merge pull request #4945 from OmrSi/assa-categories-cancel-fix

Fix categories styles changes being saved even when canceling
This commit is contained in:
Nikolaj Olsson 2021-04-05 16:39:24 +02:00 committed by GitHub
commit ef0eb7298e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -243,7 +243,13 @@ namespace Nikse.SubtitleEdit.Forms.Styles
foreach (var category in storedCategories)
{
comboboxStorageCategories.Items.Add(category.Name);
_storageCategories.Add(category);
var categoryCopy = new AssaStorageCategory
{
IsDefault = category.IsDefault,
Name = category.Name,
Styles = category.Styles.ConvertAll(style => new SsaStyle(style))
};
_storageCategories.Add(categoryCopy);
}
_currentCategory = _storageCategories.Single(category => category.IsDefault);