From f9a41fe4b5ceabf7e6cb99d3d4b83454e05b74ad Mon Sep 17 00:00:00 2001 From: Waldi Ravens Date: Sun, 21 Jun 2015 19:10:03 +0200 Subject: [PATCH] Formatting (whitespace only) --- src/Forms/FixCommonErrors.cs | 12 ------------ src/Forms/VobSubNOcrTrain.cs | 6 +----- src/Forms/VobSubOcr.cs | 14 -------------- src/Logic/DetectEncoding/EncodingTools.cs | 11 ----------- src/Logic/NikseBitmapImageSplitter.cs | 6 ------ 5 files changed, 1 insertion(+), 48 deletions(-) diff --git a/src/Forms/FixCommonErrors.cs b/src/Forms/FixCommonErrors.cs index 6e49ca91b..093dd5054 100644 --- a/src/Forms/FixCommonErrors.cs +++ b/src/Forms/FixCommonErrors.cs @@ -741,7 +741,6 @@ namespace Nikse.SubtitleEdit.Forms double diff = prev.EndTime.TotalMilliseconds - p.StartTime.TotalMilliseconds; if (!prev.StartTime.IsMaxTime && !p.StartTime.IsMaxTime && diff >= 0 && !(canBeEqual && diff == 0)) { - int diffHalf = (int)(diff / 2); if (!Configuration.Settings.Tools.FixCommonErrorsFixOverlapAllowEqualEndStart && p.StartTime.TotalMilliseconds == prev.EndTime.TotalMilliseconds && prev.Duration.TotalMilliseconds > 100) @@ -1578,7 +1577,6 @@ namespace Nikse.SubtitleEdit.Forms AddFixToListView(p, fixAction, oldText, p.Text); } } - } if (missingSpaces > 0) { @@ -1771,7 +1769,6 @@ namespace Nikse.SubtitleEdit.Forms p.Text = oldText; } } - } } UpdateFixStatus(noOfFixes, fixAction, _language.XMissingQuotesAdded); @@ -1899,7 +1896,6 @@ namespace Nikse.SubtitleEdit.Forms } } } - } } match = match.NextMatch(); @@ -1985,7 +1981,6 @@ namespace Nikse.SubtitleEdit.Forms missigPeriodsAtEndOfLine++; AddFixToListView(p, fixAction, oldText, p.Text); } - } } } @@ -3830,7 +3825,6 @@ namespace Nikse.SubtitleEdit.Forms fixCount++; AddFixToListView(p, fixAction, oldText, p.Text); } - } UpdateFixStatus(fixCount, _language.FixSpanishInvertedQuestionAndExclamationMarks, fixCount.ToString(CultureInfo.InvariantCulture)); } @@ -3938,7 +3932,6 @@ namespace Nikse.SubtitleEdit.Forms p.Text = p.Text.Remove(j, markIndex - j + 1).Insert(j, speaker + st.Pre + temp + st.StrippedText + st.Post); markIndex += addToIndex; } - } } } @@ -4052,7 +4045,6 @@ namespace Nikse.SubtitleEdit.Forms private void Next() { - RunSelectedActions(); buttonBack.Enabled = true; @@ -4139,7 +4131,6 @@ namespace Nikse.SubtitleEdit.Forms GoToNextSynaxError(); e.SuppressKeyPress = true; } - } private void GoToNextSynaxError() @@ -4203,7 +4194,6 @@ namespace Nikse.SubtitleEdit.Forms private static string[] MakeDiffHtml(string before, string after) { - before = before.Replace("
", "↲"); after = after.Replace("
", "↲"); before = before.Replace(Environment.NewLine, "↲"); @@ -4829,7 +4819,6 @@ namespace Nikse.SubtitleEdit.Forms if (deSelectedFixes.Contains(item.SubItems[1].Text + item.SubItems[2].Text + item.SubItems[3].Text)) item.Checked = false; } - } } @@ -4898,7 +4887,6 @@ namespace Nikse.SubtitleEdit.Forms else if (subtitleListView1.SelectedItems.Count == 2 && subtitleListView1.SelectedItems[0].Index == subtitleListView1.SelectedItems[1].Index - 1) { - mergeSelectedLinesToolStripMenuItem.Visible = true; toolStripSeparator1.Visible = true; } diff --git a/src/Forms/VobSubNOcrTrain.cs b/src/Forms/VobSubNOcrTrain.cs index 2ecb207a8..9f8161e26 100644 --- a/src/Forms/VobSubNOcrTrain.cs +++ b/src/Forms/VobSubNOcrTrain.cs @@ -37,14 +37,12 @@ namespace Nikse.SubtitleEdit.Forms } } comboBoxSubtitleFontSize.SelectedIndex = 10; - } internal void Initialize(NOcrDb _nOcrDb) { if (_nOcrDb != null) { - } } @@ -89,7 +87,6 @@ namespace Nikse.SubtitleEdit.Forms var charactersLearned = new List(); foreach (ListViewItem item in listViewFonts.Items) { - if (item.Checked) { _subtitleFontName = item.Text; @@ -128,7 +125,6 @@ namespace Nikse.SubtitleEdit.Forms NOcrChar match = nOcrD.GetMatch(list[0].NikseBitmap); if (match == null) { - pictureBox1.Image = list[0].NikseBitmap.GetBitmap(); this.Refresh(); Application.DoEvents(); @@ -237,4 +233,4 @@ namespace Nikse.SubtitleEdit.Forms } } -} \ No newline at end of file +} diff --git a/src/Forms/VobSubOcr.cs b/src/Forms/VobSubOcr.cs index 234efac40..8bff2adc9 100644 --- a/src/Forms/VobSubOcr.cs +++ b/src/Forms/VobSubOcr.cs @@ -2080,7 +2080,6 @@ namespace Nikse.SubtitleEdit.Forms return oc; } } - } if (tryItalicScaling) @@ -2630,7 +2629,6 @@ namespace Nikse.SubtitleEdit.Forms return oc; } } - } if (tryItalicScaling) @@ -2686,7 +2684,6 @@ namespace Nikse.SubtitleEdit.Forms // return c; // } // } - } return null; @@ -3826,7 +3823,6 @@ namespace Nikse.SubtitleEdit.Forms } else if (index + 1 < list.Count && list[index + 1].NikseBitmap != null) // only allow expand to EndOfLine or space { - index++; expandSelectionList.Add(list[index]); } @@ -3864,7 +3860,6 @@ namespace Nikse.SubtitleEdit.Forms matches.Add(new CompareMatch("*", false, 0, null)); } _italicCheckedLast = _vobSubOcrCharacter.IsItalic; - } else if (item.NikseBitmap == null) { @@ -4199,7 +4194,6 @@ namespace Nikse.SubtitleEdit.Forms private void SaveNOcr() { - try { _nOcrDb.Save(); @@ -4328,7 +4322,6 @@ namespace Nikse.SubtitleEdit.Forms } else if (index + 1 < list.Count && list[index + 1].NikseBitmap != null) // only allow expand to EndOfLine or space { - index++; expandSelectionList.Add(list[index]); } @@ -4375,7 +4368,6 @@ namespace Nikse.SubtitleEdit.Forms matches.Add(new CompareMatch("*", false, 0, null)); } _italicCheckedLast = _vobSubOcrNOcrCharacter.IsItalic; - } else if (item.NikseBitmap == null) { @@ -5118,7 +5110,6 @@ namespace Nikse.SubtitleEdit.Forms } bitmap.Dispose(); p.Result = GetStringWithItalicTags(matches); - } private void ImageCompareThreadRunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) @@ -5597,7 +5588,6 @@ namespace Nikse.SubtitleEdit.Forms _mainOcrIndex++; _mainOcrTimer.Start(); } - } private void LoadNOcrWithCurrentLanguage() @@ -6214,7 +6204,6 @@ namespace Nikse.SubtitleEdit.Forms { unItalicText += "!"; } - } } if (line.EndsWith('?') && !unItalicText.EndsWith('?') && !unItalicText.EndsWith("?")) @@ -6818,7 +6807,6 @@ namespace Nikse.SubtitleEdit.Forms { using (var formVobSubEditCharacters = new VobSubEditCharacters(comboBoxCharacterDatabase.SelectedItem.ToString(), null, _binaryOcrDb)) { - formVobSubEditCharacters.Initialize(name, text); DialogResult result = formVobSubEditCharacters.ShowDialog(); if (result == DialogResult.OK) @@ -7281,7 +7269,6 @@ namespace Nikse.SubtitleEdit.Forms current.Text = old.Text; break; } - } } subtitleListView1.Fill(_subtitle); @@ -7490,7 +7477,6 @@ namespace Nikse.SubtitleEdit.Forms } index++; } - } } diff --git a/src/Logic/DetectEncoding/EncodingTools.cs b/src/Logic/DetectEncoding/EncodingTools.cs index 2f31181bf..c8e9cf1ba 100644 --- a/src/Logic/DetectEncoding/EncodingTools.cs +++ b/src/Logic/DetectEncoding/EncodingTools.cs @@ -22,7 +22,6 @@ namespace Nikse.SubtitleEdit.Logic.DetectEncoding /// static EncodingTools() { - List streamEcodings = new List(); List allEncodings = new List(); List mimeEcodings = new List(); @@ -65,7 +64,6 @@ namespace Nikse.SubtitleEdit.Logic.DetectEncoding // all singlebyte encodings foreach (EncodingInfo enc in Encoding.GetEncodings()) { - if (!enc.GetEncoding().IsSingleByte) continue; @@ -155,7 +153,6 @@ namespace Nikse.SubtitleEdit.Logic.DetectEncoding } else { - } return enc; } @@ -182,7 +179,6 @@ namespace Nikse.SubtitleEdit.Logic.DetectEncoding private static Encoding DetectOutgoingEncoding(string input, int[] preferredEncodings, bool preserveOrder) { - if (input == null) throw new ArgumentNullException("input"); @@ -234,7 +230,6 @@ namespace Nikse.SubtitleEdit.Logic.DetectEncoding Marshal.Copy(pDetectedEncs, theResult, 0, theResult.Length); result = Encoding.GetEncoding(theResult[0]); } - } finally { @@ -252,7 +247,6 @@ namespace Nikse.SubtitleEdit.Logic.DetectEncoding public static Encoding[] DetectOutgoingEncodings(string input, int[] preferredEncodings, bool preserveOrder) { - if (input == null) throw new ArgumentNullException("input"); @@ -304,9 +298,7 @@ namespace Nikse.SubtitleEdit.Logic.DetectEncoding // get the encodings for the codepages for (int i = 0; i < detectedCodepages; i++) result.Add(Encoding.GetEncoding(theResult[i])); - } - } finally { @@ -353,7 +345,6 @@ namespace Nikse.SubtitleEdit.Logic.DetectEncoding /// an array of Encoding with assumed encodings public static Encoding[] DetectInputCodepages(byte[] input, int maxEncodings) { - if (maxEncodings < 1) throw new ArgumentOutOfRangeException("maxEncodings", "at least one encoding must be returned"); @@ -477,9 +468,7 @@ namespace Nikse.SubtitleEdit.Logic.DetectEncoding stream.Seek(0, SeekOrigin.Begin); return new StreamReader(stream, detectedEncoding); - } } - } diff --git a/src/Logic/NikseBitmapImageSplitter.cs b/src/Logic/NikseBitmapImageSplitter.cs index b0b59d73e..722119aa3 100644 --- a/src/Logic/NikseBitmapImageSplitter.cs +++ b/src/Logic/NikseBitmapImageSplitter.cs @@ -183,7 +183,6 @@ namespace Nikse.SubtitleEdit.Logic { size++; } - } if (size > 2) { @@ -198,7 +197,6 @@ namespace Nikse.SubtitleEdit.Logic { parts.Add(new ImageSplitterItem(0, startY, bmp.CopyRectangle(new Rectangle(0, startY, bmp.Width, size + 1)))); } - } return parts; } @@ -243,7 +241,6 @@ namespace Nikse.SubtitleEdit.Logic { size++; } - } if (size > 2) { @@ -295,7 +292,6 @@ namespace Nikse.SubtitleEdit.Logic { size++; } - } if (size > 2) { @@ -355,7 +351,6 @@ namespace Nikse.SubtitleEdit.Logic x < bmp.Width - 2 && !IsVerticalLineTransparent(bmp, ref tempY, x + 1)) { - //Add space? if (lastEndX > 0 && lastEndX + xOrMorePixelsMakesSpace < startX) { @@ -751,7 +746,6 @@ namespace Nikse.SubtitleEdit.Logic { return null; } - } else if (x < bmp.Width - 1 && y == bmp.Height - 1 && bmp.GetAlpha(x + 1, y) == 0 && bmp.GetAlpha(x + 1, y - 1) == 0) {