diff --git a/src/Forms/AddToOcrReplaceList.cs b/src/Forms/AddToOcrReplaceList.cs index ae5be444c..4e4dbed04 100644 --- a/src/Forms/AddToOcrReplaceList.cs +++ b/src/Forms/AddToOcrReplaceList.cs @@ -1,10 +1,7 @@ using Nikse.SubtitleEdit.Logic; using System; -using System.Collections.Generic; using System.Globalization; -using System.IO; using System.Windows.Forms; -using System.Xml; namespace Nikse.SubtitleEdit.Forms { diff --git a/src/Forms/DvdSubRip.cs b/src/Forms/DvdSubRip.cs index 7d21e9a39..4466df283 100644 --- a/src/Forms/DvdSubRip.cs +++ b/src/Forms/DvdSubRip.cs @@ -287,7 +287,7 @@ namespace Nikse.SubtitleEdit.Forms } position += 0x800; - progressBarRip.Value = (int) ((position * 100) / length); + progressBarRip.Value = (int)((position * 100) / length); Application.DoEvents(); lba++; } diff --git a/src/Forms/Settings.cs b/src/Forms/Settings.cs index 193df0c62..b5dae7fdf 100644 --- a/src/Forms/Settings.cs +++ b/src/Forms/Settings.cs @@ -1016,7 +1016,7 @@ namespace Nikse.SubtitleEdit.Forms } if (!found) cultures.Add(culture); - } + } else if (Directory.GetFiles(dir, culture.ThreeLetterISOLanguageName + "_OCRFixReplaceList_User.xml").Length == 1) { bool found = false; @@ -2085,7 +2085,6 @@ namespace Nikse.SubtitleEdit.Forms if (key.Length == 0 || value.Length == 0 || key == value || Utilities.IsInteger(key)) return; - var cb = comboBoxWordListLanguage.Items[comboBoxWordListLanguage.SelectedIndex] as ComboBoxLanguage; if (cb == null) return; @@ -2136,7 +2135,7 @@ namespace Nikse.SubtitleEdit.Forms int index = listBoxOcrFixList.SelectedIndex; string text = listBoxOcrFixList.Items[index].ToString(); string key = text.Substring(0, text.IndexOf(" --> ", StringComparison.Ordinal)); - + if (_ocrFixReplaceList.WordReplaceList.ContainsKey(key) || _ocrFixReplaceList.PartialLineWordBoundaryReplaceList.ContainsKey(key)) { DialogResult result; diff --git a/src/Logic/Configuration.cs b/src/Logic/Configuration.cs index adcf6c222..ca1ebba74 100644 --- a/src/Logic/Configuration.cs +++ b/src/Logic/Configuration.cs @@ -9,7 +9,7 @@ namespace Nikse.SubtitleEdit.Logic public class Configuration { private static readonly Lazy _instance = new Lazy(() => new Configuration()); - + private readonly string _baseDir; private readonly string _dataDir; private readonly Lazy _settings; @@ -160,7 +160,6 @@ namespace Nikse.SubtitleEdit.Logic } } - /// /// Retrieves the specified registry subkey value. /// diff --git a/src/Logic/OCR/OcrFixEngine.cs b/src/Logic/OCR/OcrFixEngine.cs index c590030fc..63f778b5f 100644 --- a/src/Logic/OCR/OcrFixEngine.cs +++ b/src/Logic/OCR/OcrFixEngine.cs @@ -75,7 +75,7 @@ namespace Nikse.SubtitleEdit.Logic.Ocr AutoGuessesUsed = new List(); UnknownWordsFound = new List(); - } + } private void LoadSpellingDictionaries(string threeLetterIsoLanguageName, string hunspellName) { @@ -582,7 +582,7 @@ namespace Nikse.SubtitleEdit.Logic.Ocr } return text; } - + public static string FixLowerCaseLInsideUpperCaseWord(string word) { if (word.Length > 3 && word.Replace("l", string.Empty).ToUpper() == word.Replace("l", string.Empty)) diff --git a/src/Logic/OcrFixReplaceList.cs b/src/Logic/OcrFixReplaceList.cs index b20146a85..6f536aa1d 100644 --- a/src/Logic/OcrFixReplaceList.cs +++ b/src/Logic/OcrFixReplaceList.cs @@ -44,7 +44,6 @@ namespace Nikse.SubtitleEdit.Logic var doc = LoadXmlReplaceListDocument(); var userDoc = LoadXmlReplaceListUserDocument(); - WordReplaceList = LoadReplaceList(doc, "WholeWords"); _partialWordReplaceListAlways = LoadReplaceList(doc, "PartialWordsAlways"); _partialWordReplaceList = LoadReplaceList(doc, "PartialWords"); @@ -780,7 +779,7 @@ namespace Nikse.SubtitleEdit.Logic } } return removed; - } + } private XmlDocument LoadXmlReplaceListDocument() { @@ -900,7 +899,7 @@ namespace Nikse.SubtitleEdit.Logic userDoc.Save(ReplaceListXmlFileNameUser); } return true; - } + } public void AddToWholeLineList(string fromLine, string toLine) { diff --git a/src/Logic/SubtitleFormats/CapMakerPlus.cs b/src/Logic/SubtitleFormats/CapMakerPlus.cs index 52c01d0d1..6f6101d9d 100644 --- a/src/Logic/SubtitleFormats/CapMakerPlus.cs +++ b/src/Logic/SubtitleFormats/CapMakerPlus.cs @@ -110,7 +110,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats text = Utilities.RemoveHtmlTags(text); if (text.Length > 118) text = text.Substring(0, 118); - fs.WriteByte((byte) (text.Length)); + fs.WriteByte((byte)(text.Length)); buffer = Encoding.GetEncoding(1252).GetBytes(text); fs.Write(buffer, 0, buffer.Length); diff --git a/src/Logic/SubtitleFormats/ImageLogicAutocaption.cs b/src/Logic/SubtitleFormats/ImageLogicAutocaption.cs index 9ee7ba11b..00dd8cddb 100644 --- a/src/Logic/SubtitleFormats/ImageLogicAutocaption.cs +++ b/src/Logic/SubtitleFormats/ImageLogicAutocaption.cs @@ -84,7 +84,8 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats System.Windows.Forms.RichTextBox rtBox = null; try { - rtBox = new System.Windows.Forms.RichTextBox { + rtBox = new System.Windows.Forms.RichTextBox + { Rtf = rtf }; diff --git a/src/Logic/SubtitleFormats/SonyDVDArchitect.cs b/src/Logic/SubtitleFormats/SonyDVDArchitect.cs index 6068d8553..43490a636 100644 --- a/src/Logic/SubtitleFormats/SonyDVDArchitect.cs +++ b/src/Logic/SubtitleFormats/SonyDVDArchitect.cs @@ -8,7 +8,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats public class SonyDVDArchitect : SubtitleFormat { - static Regex Regex = new Regex(@"^\d\d:\d\d:\d\d:\d\d[ ]+-[ ]+\d\d:\d\d:\d\d:\d\d", RegexOptions.Compiled); + private static Regex Regex = new Regex(@"^\d\d:\d\d:\d\d:\d\d[ ]+-[ ]+\d\d:\d\d:\d\d:\d\d", RegexOptions.Compiled); public override string Extension { diff --git a/src/Logic/VideoPlayers/MpcHC/MpcHc.cs b/src/Logic/VideoPlayers/MpcHC/MpcHc.cs index 65f529852..905a0b9d5 100644 --- a/src/Logic/VideoPlayers/MpcHC/MpcHc.cs +++ b/src/Logic/VideoPlayers/MpcHC/MpcHc.cs @@ -356,7 +356,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers.MpcHC if (_form != null) { _form.OnCopyData -= OnCopyData; -// _form.Dispose(); this give an error when doing File -> Exit... + //_form.Dispose(); this gives an error when doing File -> Exit... _form = null; } diff --git a/src/Test/Logic/OcrFixReplaceListTest.cs b/src/Test/Logic/OcrFixReplaceListTest.cs index f43e087b9..ef41e11d7 100644 --- a/src/Test/Logic/OcrFixReplaceListTest.cs +++ b/src/Test/Logic/OcrFixReplaceListTest.cs @@ -78,9 +78,9 @@ namespace Test.Logic { File.Delete(fileName); } - catch + catch { - + } } @@ -217,6 +217,5 @@ namespace Test.Logic } } - } }