Merge pull request #214 from ivandrofly/patch-1.1

Patch 1.1
This commit is contained in:
Nikolaj Olsson 2014-07-30 08:51:56 +02:00
commit 613b8e0038
4 changed files with 26 additions and 15 deletions

View File

@ -398,6 +398,7 @@
this.Controls.Add(this.groupBoxScript);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.KeyPreview = true;
this.MaximizeBox = false;
this.Name = "SubStationAlphaProperties";
this.ShowIcon = false;
this.ShowInTaskbar = false;

View File

@ -112,12 +112,12 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@ -7,7 +7,6 @@ namespace Nikse.SubtitleEdit.Logic.Forms
{
public static class FixCommonErrorsHelper
{
public static string FixEllipsesStartHelper(string text)
{
if (text == null || text.Trim().Length < 4)
@ -85,8 +84,21 @@ namespace Nikse.SubtitleEdit.Logic.Forms
text = "<i>- " + text;
}
text = text.Replace(" ", " ");
// WOMAN 2: <i>...24 hours a day at BabyC.</i>
var index = text.IndexOf(':');
if (index > 0 && text.Length > index + 1 && !char.IsDigit(text[index + 1]) && text.Contains(".."))
{
var post = text.Substring(0, index + 1);
if (post.Length < 2)
return text;
text = text.Remove(0, index + 1);
text = text.Trim();
text = FixEllipsesStartHelper(text);
text = post + " " + text;
}
return text;
}
}
}

View File

@ -207,15 +207,13 @@ namespace Nikse.SubtitleEdit.Logic
public static string FormatBytesToDisplayFileSize(long fileSize)
{
{
if (fileSize <= 1024)
return string.Format("{0} bytes", fileSize);
if (fileSize <= 1024 * 1024)
return string.Format("{0} kb", fileSize / 1024);
if (fileSize <= 1024 * 1024 * 1024)
return string.Format("{0:0.0} mb", (float)fileSize / (1024 * 1024));
return string.Format("{0:0.0} gb", (float)fileSize / (1024 * 1024 * 1024));
}
if (fileSize <= 1024)
return string.Format("{0} bytes", fileSize);
if (fileSize <= 1024 * 1024)
return string.Format("{0} kb", fileSize / 1024);
if (fileSize <= 1024 * 1024 * 1024)
return string.Format("{0:0.0} mb", (float)fileSize / (1024 * 1024));
return string.Format("{0:0.0} gb", (float)fileSize / (1024 * 1024 * 1024));
}
public static int GetSubtitleIndex(List<Paragraph> paragraphs, VideoPlayerContainer videoPlayerContainer)
@ -2486,7 +2484,7 @@ namespace Nikse.SubtitleEdit.Logic
text = text.Replace("< I>", beginTag);
text = text.Replace("<I >", beginTag);
text = text.Replace("< / i >", "</i>");
text = text.Replace("< / i >", endTag);
text = text.Replace("< /i>", endTag);
text = text.Replace("</ i>", endTag);
text = text.Replace("< /i>", endTag);