Merge pull request #1036 from ivandrofly/patch-40

Patch 40
This commit is contained in:
Nikolaj Olsson 2015-07-22 20:53:50 +02:00
commit 428d7e4e12
2 changed files with 6 additions and 12 deletions

View File

@ -1,5 +1,4 @@
using System.Runtime.InteropServices;
using Nikse.SubtitleEdit.Controls;
using Nikse.SubtitleEdit.Controls;
using Nikse.SubtitleEdit.Core;
using Nikse.SubtitleEdit.Forms.Styles;
using Nikse.SubtitleEdit.Logic;
@ -5233,8 +5232,8 @@ namespace Nikse.SubtitleEdit.Forms
if (!undo)
{
if (_subtitle.HistoryItems[_undoIndex].RedoParagraphs != null)
// TODO: Sometimes redo paragraphs can be null - how?
if (_subtitle.HistoryItems[_undoIndex].RedoParagraphs != null)
{
_subtitle.Paragraphs.Clear();
if (Configuration.Settings.General.AllowEditOfOriginalSubtitle && _subtitleAlternate != null)

View File

@ -256,15 +256,10 @@ namespace Nikse.SubtitleEdit.Forms
private void AddToPreviewListView(Paragraph p, string newText)
{
var item = new ListViewItem("") { Tag = p, Checked = true };
var subItem = new ListViewItem.ListViewSubItem(item, p.Number.ToString(CultureInfo.InvariantCulture));
item.SubItems.Add(subItem);
subItem = new ListViewItem.ListViewSubItem(item, p.Text.Replace(Environment.NewLine, Configuration.Settings.General.ListViewLineSeparatorString));
item.SubItems.Add(subItem);
subItem = new ListViewItem.ListViewSubItem(item, newText.Replace(Environment.NewLine, Configuration.Settings.General.ListViewLineSeparatorString));
item.SubItems.Add(subItem);
var item = new ListViewItem(string.Empty) { Tag = p, Checked = true };
item.SubItems.Add(p.Number.ToString(CultureInfo.InvariantCulture));
item.SubItems.Add(p.Text.Replace(Environment.NewLine, Configuration.Settings.General.ListViewLineSeparatorString));
item.SubItems.Add(newText.Replace(Environment.NewLine, Configuration.Settings.General.ListViewLineSeparatorString));
listViewFixes.Items.Add(item);
}