Formatting (whitespace only)

This commit is contained in:
Waldi Ravens 2015-06-19 19:20:22 +02:00
parent 7404d17adf
commit 2bb7cf7a91
7 changed files with 33 additions and 35 deletions

View File

@ -634,7 +634,6 @@ namespace Nikse.SubtitleEdit.Controls
stringFormat.FormatFlags = StringFormatFlags.DirectionVertical; stringFormat.FormatFlags = StringFormatFlags.DirectionVertical;
e.Graphics.DrawString(WaveformNotLoadedText, textFont, textBrush, new PointF(1, 10), stringFormat); e.Graphics.DrawString(WaveformNotLoadedText, textFont, textBrush, new PointF(1, 10), stringFormat);
} }
} }
textBrush.Dispose(); textBrush.Dispose();
textFont.Dispose(); textFont.Dispose();
@ -806,7 +805,6 @@ namespace Nikse.SubtitleEdit.Controls
e.Graphics.DrawString(text, font, textBrush, new PointF(currentRegionLeft + 3, top)); e.Graphics.DrawString(text, font, textBrush, new PointF(currentRegionLeft + 3, top));
} }
} }
} }
else if (n > 51) else if (n > 51)
e.Graphics.DrawString("#" + paragraph.Number + " " + paragraph.StartTime.ToShortString(), Font, textBrush, new PointF(currentRegionLeft + 3, Height - 32)); e.Graphics.DrawString("#" + paragraph.Number + " " + paragraph.StartTime.ToShortString(), Font, textBrush, new PointF(currentRegionLeft + 3, Height - 32));
@ -1165,7 +1163,6 @@ namespace Nikse.SubtitleEdit.Controls
private void WaveformMouseMove(object sender, MouseEventArgs e) private void WaveformMouseMove(object sender, MouseEventArgs e)
{ {
if (_wavePeaks == null) if (_wavePeaks == null)
return; return;
@ -1393,7 +1390,6 @@ namespace Nikse.SubtitleEdit.Controls
} }
NewSelectionParagraph.StartTime.TotalSeconds = startTotalSeconds; NewSelectionParagraph.StartTime.TotalSeconds = startTotalSeconds;
NewSelectionParagraph.EndTime.TotalSeconds = endTotalSeconds; NewSelectionParagraph.EndTime.TotalSeconds = endTotalSeconds;
} }
} }
Invalidate(); Invalidate();
@ -1482,7 +1478,6 @@ namespace Nikse.SubtitleEdit.Controls
_mouseMoveStartX = SecondsToXPosition(NewSelectionParagraph.StartTime.TotalSeconds - StartPositionSeconds); _mouseMoveStartX = SecondsToXPosition(NewSelectionParagraph.StartTime.TotalSeconds - StartPositionSeconds);
_mouseMoveEndX = SecondsToXPosition(NewSelectionParagraph.EndTime.TotalSeconds - StartPositionSeconds); _mouseMoveEndX = SecondsToXPosition(NewSelectionParagraph.EndTime.TotalSeconds - StartPositionSeconds);
} }
} }
private void WaveformMouseDoubleClick(object sender, MouseEventArgs e) private void WaveformMouseDoubleClick(object sender, MouseEventArgs e)
@ -1556,7 +1551,6 @@ namespace Nikse.SubtitleEdit.Controls
int diff = Math.Abs(_mouseMoveStartX - e.X); int diff = Math.Abs(_mouseMoveStartX - e.X);
if (_mouseMoveStartX == -1 || _mouseMoveEndX == -1 || diff < 10 && TimeSpan.FromTicks(DateTime.Now.Ticks - _buttonDownTimeTicks).TotalSeconds < 0.25) if (_mouseMoveStartX == -1 || _mouseMoveEndX == -1 || diff < 10 && TimeSpan.FromTicks(DateTime.Now.Ticks - _buttonDownTimeTicks).TotalSeconds < 0.25)
{ {
if (ModifierKeys == Keys.Shift && _selectedParagraph != null) if (ModifierKeys == Keys.Shift && _selectedParagraph != null)
{ {
double seconds = XPositionToSeconds(e.X); double seconds = XPositionToSeconds(e.X);
@ -1689,7 +1683,6 @@ namespace Nikse.SubtitleEdit.Controls
double seconds = ((i - (length / 2)) / (double)_wavePeaks.Header.SampleRate) / _zoomFactor; double seconds = ((i - (length / 2)) / (double)_wavePeaks.Header.SampleRate) / _zoomFactor;
if (seconds >= 0) if (seconds >= 0)
{ {
StartPositionSeconds = seconds; StartPositionSeconds = seconds;
if (StartPositionSeconds > 1) if (StartPositionSeconds > 1)
StartPositionSeconds -= 1; StartPositionSeconds -= 1;
@ -1719,7 +1712,6 @@ namespace Nikse.SubtitleEdit.Controls
double seconds = (i + (length / 2)) / (double)_wavePeaks.Header.SampleRate / _zoomFactor; double seconds = (i + (length / 2)) / (double)_wavePeaks.Header.SampleRate / _zoomFactor;
if (seconds >= 0) if (seconds >= 0)
{ {
StartPositionSeconds = seconds; StartPositionSeconds = seconds;
if (StartPositionSeconds > 1) if (StartPositionSeconds > 1)
StartPositionSeconds -= 1; StartPositionSeconds -= 1;

View File

@ -864,7 +864,6 @@ namespace Nikse.SubtitleEdit.Controls
Items[index].UseItemStyleForSubItems = false; Items[index].UseItemStyleForSubItems = false;
Items[index].SubItems[ColumnIndexExtra].BackColor = Color.AntiqueWhite; Items[index].SubItems[ColumnIndexExtra].BackColor = Color.AntiqueWhite;
Items[index].SubItems[ColumnIndexExtra].ForeColor = color; Items[index].SubItems[ColumnIndexExtra].ForeColor = color;
} }
} }

View File

@ -915,7 +915,6 @@ namespace Nikse.SubtitleEdit.Controls
{ {
HideAllPauseImages(); HideAllPauseImages();
_pictureBoxPauseDown.Visible = true; _pictureBoxPauseDown.Visible = true;
} }
if (OnButtonClicked != null) if (OnButtonClicked != null)
OnButtonClicked.Invoke(sender, e); OnButtonClicked.Invoke(sender, e);

View File

@ -76,7 +76,6 @@ namespace Nikse.SubtitleEdit.Forms.DCinema
numericUpDownTopBottomMargin.Value = ss.DCinemaBottomMargin; numericUpDownTopBottomMargin.Value = ss.DCinemaBottomMargin;
else else
numericUpDownTopBottomMargin.Value = 8; numericUpDownTopBottomMargin.Value = 8;
} }
Utilities.FixLargeFonts(this, buttonCancel); Utilities.FixLargeFonts(this, buttonCancel);
} }

View File

@ -19,13 +19,11 @@ using System.Xml;
namespace Nikse.SubtitleEdit.Forms namespace Nikse.SubtitleEdit.Forms
{ {
public sealed partial class ExportPngXml : PositionAndSizeForm public sealed partial class ExportPngXml : PositionAndSizeForm
{ {
private class MakeBitmapParameter private class MakeBitmapParameter
{ {
public Bitmap Bitmap { get; set; } public Bitmap Bitmap { get; set; }
public Paragraph P { get; set; } public Paragraph P { get; set; }
public string Type { get; set; } public string Type { get; set; }
@ -64,7 +62,6 @@ namespace Nikse.SubtitleEdit.Forms
{ {
BackgroundColor = Color.Transparent; BackgroundColor = Color.Transparent;
} }
} }
private Subtitle _subtitle; private Subtitle _subtitle;
@ -1072,7 +1069,6 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
{ {
if (!param.Saved) if (!param.Saved)
{ {
string numberString = string.Format(Path.GetFileNameWithoutExtension(Path.GetFileName(param.SavDialogFileName)) + "{0:0000}", i); string numberString = string.Format(Path.GetFileNameWithoutExtension(Path.GetFileName(param.SavDialogFileName)) + "{0:0000}", i);
string fileName = numberString + "." + comboBoxImageFormat.Text.ToLower(); string fileName = numberString + "." + comboBoxImageFormat.Text.ToLower();
string fileNameNoPath = Path.GetFileName(fileName); string fileNameNoPath = Path.GetFileName(fileName);
@ -2166,7 +2162,6 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
surface.DrawString(text, font, brush, new PointF { X = x - 1, Y = y - 1 - j }, sf); surface.DrawString(text, font, brush, new PointF { X = x - 1, Y = y - 1 - j }, sf);
surface.DrawString(text, font, brush, new PointF { X = x - 1, Y = y - 0 - j }, sf); surface.DrawString(text, font, brush, new PointF { X = x - 1, Y = y - 0 - j }, sf);
surface.DrawString(text, font, brush, new PointF { X = x - 1, Y = y + 1 - j }, sf); surface.DrawString(text, font, brush, new PointF { X = x - 1, Y = y + 1 - j }, sf);
} }
brush.Dispose(); brush.Dispose();
brush = new SolidBrush(parameter.SubtitleColor); brush = new SolidBrush(parameter.SubtitleColor);
@ -3819,7 +3814,6 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
} }
return; return;
} }
} }
catch catch
{ {
@ -3839,7 +3833,6 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
br.RotateTransform(0); br.RotateTransform(0);
g.FillRectangle(br, rect); g.FillRectangle(br, rect);
} }
} }
private void linkLabelPreview_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) private void linkLabelPreview_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)

View File

@ -275,7 +275,8 @@ namespace Nikse.SubtitleEdit.Logic.Forms
} }
string tempArr0QuoteTrimmed = arr[0].TrimEnd('"'); string tempArr0QuoteTrimmed = arr[0].TrimEnd('"');
if (arr0.Length > 0 && arr1.Length > 1 && !(tempArr0QuoteTrimmed.EndsWith('.') || tempArr0QuoteTrimmed.EndsWith('!') || tempArr0QuoteTrimmed.EndsWith('?') || tempArr0QuoteTrimmed.EndsWith("</i>", StringComparison.Ordinal)) && if (arr0.Length > 0 && arr1.Length > 1 &&
!(tempArr0QuoteTrimmed.EndsWith('.') || tempArr0QuoteTrimmed.EndsWith('!') || tempArr0QuoteTrimmed.EndsWith('?') || tempArr0QuoteTrimmed.EndsWith("</i>", StringComparison.Ordinal)) &&
!(new StripableText(arr[1]).Pre.Contains('-'))) !(new StripableText(arr[1]).Pre.Contains('-')))
{ {
insertDash = false; insertDash = false;
@ -505,28 +506,43 @@ namespace Nikse.SubtitleEdit.Logic.Forms
text = st.Pre + text + st.Post; text = st.Pre + text + st.Post;
if (oldText.TrimStart().StartsWith("- ", StringComparison.Ordinal) && text != null && !text.Contains(Environment.NewLine) && if (oldText.TrimStart().StartsWith("- ", StringComparison.Ordinal) && text != null && !text.Contains(Environment.NewLine) &&
(oldText.Contains(Environment.NewLine + "- ", StringComparison.Ordinal) || oldText.Contains(Environment.NewLine + " - ", StringComparison.Ordinal) || oldText.Contains(Environment.NewLine + "<i>- ", StringComparison.Ordinal) || oldText.Contains(Environment.NewLine + "<i> - ", StringComparison.Ordinal))) (oldText.Contains(Environment.NewLine + "- ", StringComparison.Ordinal) ||
oldText.Contains(Environment.NewLine + " - ", StringComparison.Ordinal) ||
oldText.Contains(Environment.NewLine + "<i>- ", StringComparison.Ordinal) ||
oldText.Contains(Environment.NewLine + "<i> - ", StringComparison.Ordinal)))
{ {
text = text.TrimStart().TrimStart('-').TrimStart(); text = text.TrimStart().TrimStart('-').TrimStart();
} }
if (oldText.TrimStart().StartsWith("-", StringComparison.Ordinal) && if (oldText.TrimStart().StartsWith("-", StringComparison.Ordinal) &&
!oldText.TrimStart().StartsWith("--", StringComparison.Ordinal) && !oldText.TrimStart().StartsWith("--", StringComparison.Ordinal) &&
text != null && !text.Contains(Environment.NewLine) && text != null && !text.Contains(Environment.NewLine) &&
(oldText.Contains(Environment.NewLine + "-", StringComparison.Ordinal) && !(oldText.Contains(Environment.NewLine + "--", StringComparison.Ordinal)) || (oldText.Contains(Environment.NewLine + "-", StringComparison.Ordinal) && !oldText.Contains(Environment.NewLine + "--", StringComparison.Ordinal) ||
oldText.Contains(Environment.NewLine + " - ", StringComparison.Ordinal) || oldText.Contains(Environment.NewLine + "<i>- ", StringComparison.Ordinal) || oldText.Contains(Environment.NewLine + "<i> - ", StringComparison.Ordinal))) oldText.Contains(Environment.NewLine + " - ", StringComparison.Ordinal) ||
oldText.Contains(Environment.NewLine + "<i>- ", StringComparison.Ordinal) ||
oldText.Contains(Environment.NewLine + "<i> - ", StringComparison.Ordinal)))
{ {
text = text.TrimStart().TrimStart('-').TrimStart(); text = text.TrimStart().TrimStart('-').TrimStart();
} }
if (oldText.TrimStart().StartsWith("<i>- ", StringComparison.Ordinal) && text != null && text.StartsWith("<i>- ", StringComparison.Ordinal) && !text.Contains(Environment.NewLine, StringComparison.Ordinal) && if (oldText.TrimStart().StartsWith("<i>- ", StringComparison.Ordinal) &&
(oldText.Contains(Environment.NewLine + "- ", StringComparison.Ordinal) || oldText.Contains(Environment.NewLine + " - ", StringComparison.Ordinal) || oldText.Contains(Environment.NewLine + "<i>- ", StringComparison.Ordinal) || oldText.Contains(Environment.NewLine + "<i> - ", StringComparison.Ordinal))) text != null && text.StartsWith("<i>- ", StringComparison.Ordinal) && !text.Contains(Environment.NewLine, StringComparison.Ordinal) &&
(oldText.Contains(Environment.NewLine + "- ", StringComparison.Ordinal) ||
oldText.Contains(Environment.NewLine + " - ", StringComparison.Ordinal) ||
oldText.Contains(Environment.NewLine + "<i>- ", StringComparison.Ordinal) ||
oldText.Contains(Environment.NewLine + "<i> - ", StringComparison.Ordinal)))
{ {
text = text.Remove(3, 2); text = text.Remove(3, 2);
} }
if (text != null && !text.Contains(Environment.NewLine, StringComparison.Ordinal) && if (text != null && !text.Contains(Environment.NewLine, StringComparison.Ordinal) &&
(oldText.Contains(':') && !text.Contains(':') || oldText.Contains('[') && !text.Contains('[') || oldText.Contains('(') && !text.Contains('(') || oldText.Contains('{') && !text.Contains('{')) && (oldText.Contains(':') && !text.Contains(':') ||
(oldText.Contains(Environment.NewLine + "- ", StringComparison.Ordinal) || oldText.Contains(Environment.NewLine + " - ", StringComparison.Ordinal) || oldText.Contains(Environment.NewLine + "<i>- ", StringComparison.Ordinal) || oldText.Contains(Environment.NewLine + "<i> - ", StringComparison.Ordinal))) oldText.Contains('[') && !text.Contains('[') ||
oldText.Contains('(') && !text.Contains('(') ||
oldText.Contains('{') && !text.Contains('{')) &&
(oldText.Contains(Environment.NewLine + "- ", StringComparison.Ordinal) ||
oldText.Contains(Environment.NewLine + " - ", StringComparison.Ordinal) ||
oldText.Contains(Environment.NewLine + "<i>- ", StringComparison.Ordinal) ||
oldText.Contains(Environment.NewLine + "<i> - ", StringComparison.Ordinal)))
{ {
text = text.TrimStart().TrimStart('-').TrimStart(); text = text.TrimStart().TrimStart('-').TrimStart();
} }