From 1ac752300ae23c56c5f37e2a340f141f200d9b73 Mon Sep 17 00:00:00 2001 From: ivandrofly Date: Fri, 6 Feb 2015 14:50:18 +0000 Subject: [PATCH] Some AllowFix reverted --- src/Forms/FixCommonErrors.cs | 46 ++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/src/Forms/FixCommonErrors.cs b/src/Forms/FixCommonErrors.cs index dc4a69bd1..a485ef265 100644 --- a/src/Forms/FixCommonErrors.cs +++ b/src/Forms/FixCommonErrors.cs @@ -1020,7 +1020,7 @@ namespace Nikse.SubtitleEdit.Forms noOfInvalidHtmlTags++; AddFixToListView(Subtitle.Paragraphs[i], fixAction, oldText, text); } - } + } } } listViewFixes.EndUpdate(); @@ -2633,16 +2633,13 @@ namespace Nikse.SubtitleEdit.Forms for (int i = 0; i < Subtitle.Paragraphs.Count; i++) { Paragraph p = Subtitle.Paragraphs[i]; - if (AllowFix(p, fixAction)) + string oldText = p.Text; + var text = FixCommonErrorsHelper.FixDialogsOnOneLine(oldText, language); + if (oldText != text && AllowFix(p, fixAction)) { - string oldText = p.Text; - var text = FixCommonErrorsHelper.FixDialogsOnOneLine(oldText, language); - if (oldText != text) - { - p.Text = text; - noOfFixes++; - AddFixToListView(p, fixAction, oldText, p.Text); - } + p.Text = text; + noOfFixes++; + AddFixToListView(p, fixAction, oldText, p.Text); } } UpdateFixStatus(noOfFixes, _language.FixCommonOcrErrors, _language.FixDialogsOneLineExample); @@ -2655,22 +2652,19 @@ namespace Nikse.SubtitleEdit.Forms for (int i = 0; i < Subtitle.Paragraphs.Count; i++) { Paragraph p = Subtitle.Paragraphs[i]; - if (AllowFix(p, fixAction)) + string text = p.Text; + string oldText = text; + text = text.Replace("Ý", "İ"); + text = text.Replace("Ð", "Ğ"); + text = text.Replace("Þ", "Ş"); + text = text.Replace("ý", "ı"); + text = text.Replace("ð", "ğ"); + text = text.Replace("þ", "ş"); + if (oldText != text && AllowFix(p, fixAction)) { - string text = p.Text; - string oldText = text; - text = text.Replace("Ý", "İ"); - text = text.Replace("Ð", "Ğ"); - text = text.Replace("Þ", "Ş"); - text = text.Replace("ý", "ı"); - text = text.Replace("ð", "ğ"); - text = text.Replace("þ", "ş"); - if (oldText != text) - { - p.Text = text; - noOfFixes++; - AddFixToListView(p, fixAction, oldText, p.Text); - } + p.Text = text; + noOfFixes++; + AddFixToListView(p, fixAction, oldText, p.Text); } } UpdateFixStatus(noOfFixes, _language.FixCommonOcrErrors, _language.FixTurkishAnsi); @@ -2821,7 +2815,7 @@ namespace Nikse.SubtitleEdit.Forms for (int i = 0; i < Subtitle.Paragraphs.Count; i++) { Paragraph p = Subtitle.Paragraphs[i]; - if (AllowFix(p, fixAction) && Utilities.CountTagInText(p.Text, Environment.NewLine) > 1) + if (Utilities.CountTagInText(p.Text, Environment.NewLine) > 1 && AllowFix(p, fixAction)) { string oldText = p.Text; p.Text = Utilities.AutoBreakLine(p.Text);