From b9f2b76b38e36469dc9d74dd08a3594d021948a0 Mon Sep 17 00:00:00 2001 From: Waldi Ravens Date: Fri, 8 Jul 2016 21:36:25 +0200 Subject: [PATCH] Formatting (whitespace only) --- Changelog.txt | 2 +- libse/Forms/RemoveTextForHI.cs | 3 +- libse/LanguageStructure.cs | 2 +- .../AdvancedSubStationAlpha.cs | 3 +- libse/SubtitleFormats/AribB24Decoder.cs | 2 +- libse/SubtitleFormats/AribB36.cs | 3 +- libse/SubtitleFormats/MediaTransData.cs | 265 +++++++++--------- src/Forms/GoogleTranslate.cs | 2 +- src/Forms/Main.cs | 6 +- src/Forms/RestoreAutoBackup.cs | 2 +- src/Logic/CommandLineConvert.cs | 1 - src/Logic/NikseBitmapImageSplitter.cs | 6 +- 12 files changed, 146 insertions(+), 151 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 31a51c2a3..37498b7c3 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -23,7 +23,7 @@ * Fixed unwanted reset of header in format "Timed Text 1.0" - thx Krystian * Fixed crash in OCR - thx dreamday * Minor spell check fix - thx JC - * Better support for wsrt files - thx serpico1 + * Better support for wsrt files - thx serpico1 * Fixed EBU justification so setting from UI is used - thx Lucas * Fix for "Remove text for HI" - thx Peta * Fixed issue in DCinema interop regarding italics - thx Marko diff --git a/libse/Forms/RemoveTextForHI.cs b/libse/Forms/RemoveTextForHI.cs index 79cefb646..bdce078e6 100644 --- a/libse/Forms/RemoveTextForHI.cs +++ b/libse/Forms/RemoveTextForHI.cs @@ -534,14 +534,13 @@ namespace Nikse.SubtitleEdit.Core.Forms if (s.Contains("") && !s.Contains("") && st.Post.Contains("")) st.Post = st.Post.Replace("", string.Empty); - if (lineNumber == parts.Length -1) + if (lineNumber == parts.Length - 1) { if (st.Post.Replace("♪", string.Empty).Replace("♫", string.Empty).Trim().Length == 0) { st.Post = string.Empty; } } - } lineNumber++; } diff --git a/libse/LanguageStructure.cs b/libse/LanguageStructure.cs index d037872c4..d4f92da96 100644 --- a/libse/LanguageStructure.cs +++ b/libse/LanguageStructure.cs @@ -1872,7 +1872,7 @@ public string MainListViewVideoGoToPositionMinus1SecAndPlay { get; set; } public string MainListViewEditTextAndPause { get; set; } public string AutoBackup { get; set; } - + public string AutoBackupEveryMinute { get; set; } public string AutoBackupEveryFiveMinutes { get; set; } public string AutoBackupEveryFifteenMinutes { get; set; } diff --git a/libse/SubtitleFormats/AdvancedSubStationAlpha.cs b/libse/SubtitleFormats/AdvancedSubStationAlpha.cs index e65d9f93d..4c3c71900 100644 --- a/libse/SubtitleFormats/AdvancedSubStationAlpha.cs +++ b/libse/SubtitleFormats/AdvancedSubStationAlpha.cs @@ -776,7 +776,6 @@ Format: Layer, Start, End, Style, Actor, MarginL, MarginR, MarginV, Effect, Text } else if (!string.IsNullOrEmpty(rest)) { - unknownTags += "\\" + rest; rest = string.Empty; } @@ -1599,7 +1598,7 @@ Format: Layer, Start, End, Style, Actor, MarginL, MarginR, MarginV, Effect, Text } } } - if (styleName != null && style.Name != null && (styleName.Equals(style.Name, StringComparison.OrdinalIgnoreCase) || + if (styleName != null && style.Name != null && (styleName.Equals(style.Name, StringComparison.OrdinalIgnoreCase) || (styleName.Equals("*Default", StringComparison.OrdinalIgnoreCase) && style.Name.Equals("Default", StringComparison.OrdinalIgnoreCase)))) { style.LoadedFromHeader = true; diff --git a/libse/SubtitleFormats/AribB24Decoder.cs b/libse/SubtitleFormats/AribB24Decoder.cs index 03aeaa0b8..a8177e1db 100644 --- a/libse/SubtitleFormats/AribB24Decoder.cs +++ b/libse/SubtitleFormats/AribB24Decoder.cs @@ -41,7 +41,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats { sb.Append(" "); } - else if (b >= 0x21 && b <= 0x7e) // GL - Graphic-set left + else if (b >= 0x21 && b <= 0x7e) // GL - Graphic-set left { ParseGlArea(sb, b, ref pos, buffer); } diff --git a/libse/SubtitleFormats/AribB36.cs b/libse/SubtitleFormats/AribB36.cs index e3c34cd10..007d51e86 100644 --- a/libse/SubtitleFormats/AribB36.cs +++ b/libse/SubtitleFormats/AribB36.cs @@ -29,7 +29,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats public string Sound { get; set; } // 1 byte public string TotalNumberOfPages { get; set; } // 4 bytes public string ProgramDataAmount { get; set; } // 8 bytes - public string TimingPresent { get; set; } // 1 byte - Space: No, *: Yes + public string TimingPresent { get; set; } // 1 byte - Space: No, *: Yes public string TimingType { get; set; } // 2 bytes public string TimingUnit { get; set; } // 1 byte - T: Time UnitF: Frame @@ -137,7 +137,6 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats return GetTime(EraseTiming, SpecifiedTimingUnit); } - } public class CaptionTextPageManagement diff --git a/libse/SubtitleFormats/MediaTransData.cs b/libse/SubtitleFormats/MediaTransData.cs index 8859bca78..816be64a8 100644 --- a/libse/SubtitleFormats/MediaTransData.cs +++ b/libse/SubtitleFormats/MediaTransData.cs @@ -33,141 +33,140 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats { const string xmpTemplate = @" - - - - 2 - For editing SDTV video - Standard PAL video (4:3interlaced) - - - SDTV - 25.00 fps - True - 720 - 400 - 720/400 - D1/DV PAL (1.067) - - | - - - - Default - Default - 24Bit PNG - 0001 - False - - 0 - 1 - False - Default - FOX-HD-Malaysia - Default - False - - - - 2500 - FALSE - 00:00:00:00 - 1 - 09:59:35:00 - 1 - - - - C:\Project\uknown.mpg - 29.97DF - - - 1 - - - Track 1 - True - False - - - 7 - - No - 40 - False - - False - - - In - 64 - False - - False - - - Out - 66 - False - - False - - - Style - 15 - False - - False - - - StyleEx - 96 - False - - False - - - Comment - 77 - False - - False - - - Language 01 - 349 - False - - False - - - - 4096 - - - [COUNT] - - - - 0 - - - - -"; + + + + 2 + For editing SDTV video + Standard PAL video (4:3interlaced) + + + SDTV + 25.00 fps + True + 720 + 400 + 720/400 + D1/DV PAL (1.067) + + | + + + + Default + Default + 24Bit PNG + 0001 + False + + 0 + 1 + False + Default + FOX-HD-Malaysia + Default + False + + + + 2500 + FALSE + 00:00:00:00 + 1 + 09:59:35:00 + 1 + + + + C:\Project\uknown.mpg + 29.97DF + + + 1 + + + Track 1 + True + False + + + 7 + + No + 40 + False + + False + + + In + 64 + False + + False + + + Out + 66 + False + + False + + + Style + 15 + False + + False + + + StyleEx + 96 + False + + False + + + Comment + 77 + False + + False + + + Language 01 + 349 + False + + False + + + + 4096 + + + [COUNT] + + + 0 + + + +"; const string paragraphTemplate = @" - 10:21:15:06 - 10:21:16:18 - - - - - - Text - Line1|Line2 - - "; +10:21:15:06 +10:21:16:18 + + + + + + Text + Line1|Line2 + +"; + var xml = new XmlDocument(); xml.LoadXml(xmpTemplate.Replace('\'', '"').Replace("[COUNT]", subtitle.Paragraphs.Count.ToString())); var paragraphInsertNode = xml.DocumentElement.SelectSingleNode("Tracks/Track1/Data"); diff --git a/src/Forms/GoogleTranslate.cs b/src/Forms/GoogleTranslate.cs index 4ccadb041..35c480035 100644 --- a/src/Forms/GoogleTranslate.cs +++ b/src/Forms/GoogleTranslate.cs @@ -181,7 +181,7 @@ namespace Nikse.SubtitleEdit.Forms foreach (Paragraph p in _translatedSubtitle.Paragraphs) p.Text = string.Empty; - _targetTwoLetterIsoLanguageName = (comboBoxTo.SelectedItem as ComboBoxItem).Value; + _targetTwoLetterIsoLanguageName = (comboBoxTo.SelectedItem as ComboBoxItem).Value; if (!_googleTranslate) { string from = (comboBoxFrom.SelectedItem as ComboBoxItem).Value; diff --git a/src/Forms/Main.cs b/src/Forms/Main.cs index b02708e21..160a495e6 100644 --- a/src/Forms/Main.cs +++ b/src/Forms/Main.cs @@ -3675,8 +3675,8 @@ namespace Nikse.SubtitleEdit.Forms var oldAllowEditOfOriginalSubtitle = Configuration.Settings.General.AllowEditOfOriginalSubtitle; using (var settings = new Settings()) { - settings.Initialize(Icon, toolStripButtonFileNew.Image, toolStripButtonFileOpen.Image, toolStripButtonSave.Image, toolStripButtonSaveAs.Image, toolStripButtonFind.Image, - toolStripButtonReplace.Image, toolStripButtonFixCommonErrors.Image, toolStripButtonRemoveTextForHi.Image, toolStripButtonVisualSync.Image, + settings.Initialize(Icon, toolStripButtonFileNew.Image, toolStripButtonFileOpen.Image, toolStripButtonSave.Image, toolStripButtonSaveAs.Image, toolStripButtonFind.Image, + toolStripButtonReplace.Image, toolStripButtonFixCommonErrors.Image, toolStripButtonRemoveTextForHi.Image, toolStripButtonVisualSync.Image, toolStripButtonSpellCheck.Image, toolStripButtonSettings.Image, toolStripButtonHelp.Image); settings.ShowDialog(this); } @@ -20001,7 +20001,7 @@ namespace Nikse.SubtitleEdit.Forms private void MenuClosed(object sender, EventArgs e) { IsMenuOpen = false; - } + } } } diff --git a/src/Forms/RestoreAutoBackup.cs b/src/Forms/RestoreAutoBackup.cs index f9fe5cbc2..f73757cb4 100644 --- a/src/Forms/RestoreAutoBackup.cs +++ b/src/Forms/RestoreAutoBackup.cs @@ -163,7 +163,7 @@ namespace Nikse.SubtitleEdit.Forms } catch (Exception) { - // ignore + // ignore } } } diff --git a/src/Logic/CommandLineConvert.cs b/src/Logic/CommandLineConvert.cs index 0b6ee9884..e6a9dd415 100644 --- a/src/Logic/CommandLineConvert.cs +++ b/src/Logic/CommandLineConvert.cs @@ -95,7 +95,6 @@ namespace Nikse.SubtitleEdit.Logic { var pattern = arguments[2].Trim(); - var targetFormat = arguments[3].Trim().Replace(" ", string.Empty).ToLowerInvariant(); if (targetFormat == "ass") { diff --git a/src/Logic/NikseBitmapImageSplitter.cs b/src/Logic/NikseBitmapImageSplitter.cs index 4216e8009..efbbd33d8 100644 --- a/src/Logic/NikseBitmapImageSplitter.cs +++ b/src/Logic/NikseBitmapImageSplitter.cs @@ -252,7 +252,7 @@ namespace Nikse.SubtitleEdit.Logic } /// - /// // split into lines + /// split into lines /// public static List SplitVertical(NikseBitmap bmp, int minLineHeight, double averageLineHeight = -1) { @@ -382,7 +382,7 @@ namespace Nikse.SubtitleEdit.Logic if (leftX >= rightX) { allTransparent = true; - } + } } if (allTransparent) @@ -408,7 +408,7 @@ namespace Nikse.SubtitleEdit.Logic } } if (size > 2) - { + { if (size == bmp.Height) { if (size > 100)