mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-27 22:42:38 +01:00
Hopefully fixed a bug with converting seconds strings to floating point
git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@619 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
parent
6d3f931541
commit
de4fdf85d4
@ -124,8 +124,8 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
|||||||
string startTime = node.Attributes["startTime"].InnerText;
|
string startTime = node.Attributes["startTime"].InnerText;
|
||||||
string text = node.InnerText;
|
string text = node.InnerText;
|
||||||
var p = new Paragraph();
|
var p = new Paragraph();
|
||||||
p.StartTime.TotalSeconds = Convert.ToDouble(startTime);
|
p.StartTime.TotalSeconds = Convert.ToDouble(startTime, System.Globalization.CultureInfo.InvariantCulture);
|
||||||
p.EndTime.TotalSeconds = Convert.ToDouble(endTime);
|
p.EndTime.TotalSeconds = Convert.ToDouble(endTime, System.Globalization.CultureInfo.InvariantCulture);
|
||||||
p.Text = text;
|
p.Text = text;
|
||||||
subtitle.Paragraphs.Add(p);
|
subtitle.Paragraphs.Add(p);
|
||||||
}
|
}
|
||||||
|
@ -55,11 +55,11 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
|||||||
XmlNode ut = xml.CreateElement("ut");
|
XmlNode ut = xml.CreateElement("ut");
|
||||||
|
|
||||||
XmlAttribute et = xml.CreateAttribute("secOut");
|
XmlAttribute et = xml.CreateAttribute("secOut");
|
||||||
et.InnerText = string.Format("{0:0.000}", p.EndTime.TotalSeconds).Replace(",", ".");
|
et.InnerText = string.Format("{0:0.0##}", p.EndTime.TotalSeconds).Replace(",", ".");
|
||||||
ut.Attributes.Append(et);
|
ut.Attributes.Append(et);
|
||||||
|
|
||||||
XmlAttribute st = xml.CreateAttribute("secIn");
|
XmlAttribute st = xml.CreateAttribute("secIn");
|
||||||
st.InnerText = string.Format("{0:0.000}", p.StartTime.TotalSeconds).Replace(",", ".");
|
st.InnerText = string.Format("{0:0.0##}", p.StartTime.TotalSeconds).Replace(",", ".");
|
||||||
ut.Attributes.Append(st);
|
ut.Attributes.Append(st);
|
||||||
|
|
||||||
//ut.InnerText = p.Text;
|
//ut.InnerText = p.Text;
|
||||||
@ -100,8 +100,8 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
|||||||
string text = node.InnerText;
|
string text = node.InnerText;
|
||||||
text = text.Replace("<br>", Environment.NewLine).Replace("<br />", Environment.NewLine);
|
text = text.Replace("<br>", Environment.NewLine).Replace("<br />", Environment.NewLine);
|
||||||
var p = new Paragraph();
|
var p = new Paragraph();
|
||||||
p.StartTime.TotalSeconds = Convert.ToDouble(startTime);
|
p.StartTime.TotalSeconds = Convert.ToDouble(startTime, System.Globalization.CultureInfo.InvariantCulture);
|
||||||
p.EndTime.TotalSeconds = Convert.ToDouble(endTime);
|
p.EndTime.TotalSeconds = Convert.ToDouble(endTime, System.Globalization.CultureInfo.InvariantCulture);
|
||||||
p.Text = text;
|
p.Text = text;
|
||||||
subtitle.Paragraphs.Add(p);
|
subtitle.Paragraphs.Add(p);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user