Formatting (whitespace only)

This commit is contained in:
Waldi Ravens 2015-08-26 06:29:50 +02:00
parent 4bec9c5496
commit 9b2eaa68ef
7 changed files with 19 additions and 22 deletions

View File

@ -14,7 +14,7 @@ namespace Nikse.SubtitleEdit.Core
public static bool LineEndsWithHtmlTag(this string text, bool threeLengthTag, bool includeFont = false) public static bool LineEndsWithHtmlTag(this string text, bool threeLengthTag, bool includeFont = false)
{ {
if (text == null) if (text == null)
return false; return false;
var len = text.Length; var len = text.Length;
@ -27,7 +27,6 @@ namespace Nikse.SubtitleEdit.Core
if (includeFont && len > 8 && text[len - 7] == '<' && text[len - 6] == '/') if (includeFont && len > 8 && text[len - 7] == '<' && text[len - 6] == '/')
return true; return true;
return false; return false;
} }
public static bool LineBreakStartsWithHtmlTag(this string text, bool threeLengthTag, bool includeFont = false) public static bool LineBreakStartsWithHtmlTag(this string text, bool threeLengthTag, bool includeFont = false)

View File

@ -80,7 +80,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
<StoryBlock TimingType='Manual'> <StoryBlock TimingType='Manual'>
<SceneBaseBlock NewsID='0' Position='0' NewsRoomInternalID='0'/> <SceneBaseBlock NewsID='0' Position='0' NewsRoomInternalID='0'/>
</StoryBlock> </StoryBlock>
</FileBody> </FileBody>
</XIF>"; </XIF>";
@ -103,7 +103,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
</Content> </Content>
</ThreadedObject> </ThreadedObject>
</ContentBlock>"; </ContentBlock>";
var xml = new XmlDocument(); var xml = new XmlDocument();
var lastTimeCode = new TimeCode(0); var lastTimeCode = new TimeCode(0);
if (subtitle.Paragraphs.Count > 0) if (subtitle.Paragraphs.Count > 0)
@ -163,11 +163,10 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
attrColor.InnerText = "7"; attrColor.InnerText = "7";
foregroundColorNode.Attributes.Append(attrColor); foregroundColorNode.Attributes.Append(attrColor);
paragraphNode.AppendChild(foregroundColorNode); paragraphNode.AppendChild(foregroundColorNode);
var textNode = xml.CreateElement("Text"); var textNode = xml.CreateElement("Text");
textNode.InnerText = line; textNode.InnerText = line;
paragraphNode.AppendChild(textNode); paragraphNode.AppendChild(textNode);
} }
fileBodyNode.AppendChild(content.SelectSingleNode("ContentBlock")); fileBodyNode.AppendChild(content.SelectSingleNode("ContentBlock"));
} }
@ -214,7 +213,6 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
} }
} }
subtitle.Renumber(); subtitle.Renumber();
} }
catch (Exception) catch (Exception)
{ {

View File

@ -414,7 +414,7 @@ namespace Nikse.SubtitleEdit.Forms
private void ListBoxSuggestionsMouseDoubleClick(object sender, MouseEventArgs e) private void ListBoxSuggestionsMouseDoubleClick(object sender, MouseEventArgs e)
{ {
ButtonUseSuggestionAlwaysClick(null, null); ButtonUseSuggestionAlwaysClick(null, null);
} }
public void DoAction(SpellCheckAction action) public void DoAction(SpellCheckAction action)
{ {

View File

@ -88,7 +88,7 @@ namespace Nikse.SubtitleEdit.Forms
labelOtherSubtitleFileName.Visible = false; labelOtherSubtitleFileName.Visible = false;
subtitleListView2.Visible = false; subtitleListView2.Visible = false;
buttonFindTextOther.Visible = false; buttonFindTextOther.Visible = false;
groupBoxImportResult.Width = listBoxSyncPoints.Left + listBoxSyncPoints.Width + 20; groupBoxImportResult.Width = listBoxSyncPoints.Left + listBoxSyncPoints.Width + 20;
Width = groupBoxImportResult.Left + groupBoxImportResult.Width + 15; Width = groupBoxImportResult.Left + groupBoxImportResult.Width + 15;
SubtitleListview1.Anchor = AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top | AnchorStyles.Right; SubtitleListview1.Anchor = AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top | AnchorStyles.Right;
buttonSetSyncPoint.Anchor = AnchorStyles.Right; buttonSetSyncPoint.Anchor = AnchorStyles.Right;
@ -446,4 +446,4 @@ namespace Nikse.SubtitleEdit.Forms
} }
} }
} }

View File

@ -87,7 +87,7 @@ namespace Nikse.SubtitleEdit.Forms
labelTip.Text = _language.Tip; labelTip.Text = _language.Tip;
Utilities.FixLargeFonts(this, buttonCancel); Utilities.FixLargeFonts(this, buttonCancel);
_timerHideSyncLabel.Tick += timerHideSyncLabel_Tick; _timerHideSyncLabel.Tick += timerHideSyncLabel_Tick;
_timerHideSyncLabel.Interval = 1000; _timerHideSyncLabel.Interval = 1000;
} }
private void timerHideSyncLabel_Tick(object sender, EventArgs e) private void timerHideSyncLabel_Tick(object sender, EventArgs e)
@ -743,7 +743,7 @@ namespace Nikse.SubtitleEdit.Forms
if (MediaPlayerEnd.VideoPlayer != null) // && MediaPlayerEnd.VideoPlayer.GetType() == typeof(QuartsPlayer)) if (MediaPlayerEnd.VideoPlayer != null) // && MediaPlayerEnd.VideoPlayer.GetType() == typeof(QuartsPlayer))
{ {
MediaPlayerEnd.RefreshProgressBar(); MediaPlayerEnd.RefreshProgressBar();
} }
timerProgressBarRefresh.Start(); timerProgressBarRefresh.Start();
} }
@ -775,4 +775,4 @@ namespace Nikse.SubtitleEdit.Forms
} }
} }
} }

View File

@ -201,7 +201,7 @@ namespace Nikse.SubtitleEdit.Forms
private void InsertLanguageCharacter(object sender, EventArgs e) private void InsertLanguageCharacter(object sender, EventArgs e)
{ {
var toolStripMenuItem = sender as ToolStripMenuItem; var toolStripMenuItem = sender as ToolStripMenuItem;
if (toolStripMenuItem != null) if (toolStripMenuItem != null)
textBoxCharacters.Text = textBoxCharacters.Text.Insert(textBoxCharacters.SelectionStart, toolStripMenuItem.Text); textBoxCharacters.Text = textBoxCharacters.Text.Insert(textBoxCharacters.SelectionStart, toolStripMenuItem.Text);
} }
@ -251,4 +251,4 @@ namespace Nikse.SubtitleEdit.Forms
textBoxCharacters.Text = dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString(); textBoxCharacters.Text = dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString();
} }
} }
} }

View File

@ -18,9 +18,9 @@ namespace Test
var xmlFileNames = Directory.GetFiles(Directory.GetCurrentDirectory(), "*.xml"); var xmlFileNames = Directory.GetFiles(Directory.GetCurrentDirectory(), "*.xml");
foreach (var xmlFileName in xmlFileNames) foreach (var xmlFileName in xmlFileNames)
{ {
TestXmlWellFormedness(xmlFileName); TestXmlWellFormedness(xmlFileName);
} }
} }
[TestMethod] [TestMethod]
[DeploymentItem("..\\Dictionaries")] [DeploymentItem("..\\Dictionaries")]
@ -45,18 +45,18 @@ namespace Test
} }
catch (Exception exception) catch (Exception exception)
{ {
string msg = Path.GetFileName(xmlFileName) + " has an invalid RegEx find expression: " + regExPattern + Environment.NewLine + string msg = Path.GetFileName(xmlFileName) + " has an invalid RegEx find expression: " + regExPattern + Environment.NewLine +
exception.Message; exception.Message;
Assert.Fail(msg); Assert.Fail(msg);
} }
} }
} }
} }
catch catch
{ {
} }
} }
} }
private static void TestXmlWellFormedness(string fileName) private static void TestXmlWellFormedness(string fileName)
{ {
@ -91,4 +91,4 @@ namespace Test
} }
} }
} }