mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-26 13:12:39 +01:00
commit
1294a3ae85
@ -1789,7 +1789,7 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
{
|
{
|
||||||
var cb = comboBoxWordListLanguage.Items[comboBoxWordListLanguage.SelectedIndex] as ComboBoxLanguage;
|
var cb = comboBoxWordListLanguage.Items[comboBoxWordListLanguage.SelectedIndex] as ComboBoxLanguage;
|
||||||
if (cb != null)
|
if (cb != null)
|
||||||
return cb.CultureInfo.Name.Replace("-", "_");
|
return cb.CultureInfo.Name.Replace('-', '_');
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
SubStationAlpha ssa = new SubStationAlpha();
|
SubStationAlpha ssa = new SubStationAlpha();
|
||||||
var sub = new Subtitle();
|
var sub = new Subtitle();
|
||||||
var lines = new List<string>();
|
var lines = new List<string>();
|
||||||
foreach (string line in subtitle.ToText(ssa).Replace(Environment.NewLine, "\n").Split('\n'))
|
foreach (string line in subtitle.ToText(ssa).SplitToLines())
|
||||||
lines.Add(line);
|
lines.Add(line);
|
||||||
string title = "Untitled";
|
string title = "Untitled";
|
||||||
if (!string.IsNullOrEmpty(subtitleFileName))
|
if (!string.IsNullOrEmpty(subtitleFileName))
|
||||||
@ -61,7 +61,7 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
{
|
{
|
||||||
foreach (string line in header.SplitToLines())
|
foreach (string line in header.SplitToLines())
|
||||||
{
|
{
|
||||||
string s = line.ToLower().Trim();
|
string s = line.ToLowerInvariant().Trim();
|
||||||
if (s.StartsWith("title:"))
|
if (s.StartsWith("title:"))
|
||||||
{
|
{
|
||||||
textBoxTitle.Text = s.Remove(0, 6).Trim();
|
textBoxTitle.Text = s.Remove(0, 6).Trim();
|
||||||
@ -113,7 +113,7 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
}
|
}
|
||||||
else if (s.StartsWith("scaledborderandshadow:"))
|
else if (s.StartsWith("scaledborderandshadow:"))
|
||||||
{
|
{
|
||||||
checkBoxScaleBorderAndShadow.Checked = s.Remove(0, 22).Trim().Equals("yes", StringComparison.OrdinalIgnoreCase);
|
checkBoxScaleBorderAndShadow.Checked = s.Remove(0, 22).Trim().Equals("yes");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -165,9 +165,8 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
format = new AdvancedSubStationAlpha();
|
format = new AdvancedSubStationAlpha();
|
||||||
var sub = new Subtitle();
|
var sub = new Subtitle();
|
||||||
string text = format.ToText(sub, string.Empty);
|
string text = format.ToText(sub, string.Empty);
|
||||||
string[] lineArray = text.Split(Utilities.NewLineChars);
|
|
||||||
var lines = new List<string>();
|
var lines = new List<string>();
|
||||||
foreach (string line in lineArray)
|
foreach (string line in text.SplitToLines())
|
||||||
lines.Add(line);
|
lines.Add(line);
|
||||||
format.LoadSubtitle(sub, lines, string.Empty);
|
format.LoadSubtitle(sub, lines, string.Empty);
|
||||||
return sub.Header.Trim();
|
return sub.Header.Trim();
|
||||||
|
@ -336,10 +336,10 @@ namespace Nikse.SubtitleEdit.Logic
|
|||||||
|
|
||||||
private static bool IsPartOfNumber(string s, int position)
|
private static bool IsPartOfNumber(string s, int position)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(s) || position + 2 > s.Length)
|
if (string.IsNullOrWhiteSpace(s) || position + 1 >= s.Length)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (position > 0 && position < s.Length - 1 && @",.".Contains(s[position]))
|
if (position > 0 && @",.".Contains(s[position]))
|
||||||
{
|
{
|
||||||
return char.IsDigit(s[position - 1]) && char.IsDigit(s[position + 1]);
|
return char.IsDigit(s[position - 1]) && char.IsDigit(s[position + 1]);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user