mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-28 06:52:35 +01:00
remove trailing whitespace
git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@1194 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
parent
48546fe083
commit
c37b56312c
@ -8450,7 +8450,7 @@ namespace Nikse.SubtitleEdit.Forms
|
|||||||
InsertAfter();
|
InsertAfter();
|
||||||
textBoxListViewText.Text = Utilities.AutoBreakLine(line);
|
textBoxListViewText.Text = Utilities.AutoBreakLine(line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
e.SuppressKeyPress = true;
|
e.SuppressKeyPress = true;
|
||||||
|
@ -278,7 +278,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
|||||||
}
|
}
|
||||||
subtitle.Renumber(1);
|
subtitle.Renumber(1);
|
||||||
|
|
||||||
// adjust all times
|
// adjust all times
|
||||||
if (buffer.Length > 1364)
|
if (buffer.Length > 1364)
|
||||||
{
|
{
|
||||||
string adjust = Encoding.GetEncoding(1252).GetString(buffer, 1354, 11); // 00:59:59:28
|
string adjust = Encoding.GetEncoding(1252).GetString(buffer, 1354, 11); // 00:59:59:28
|
||||||
|
@ -69,7 +69,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
|||||||
|
|
||||||
var lines = p.Text.Split(Environment.NewLine.ToCharArray(), StringSplitOptions.None);
|
var lines = p.Text.Split(Environment.NewLine.ToCharArray(), StringSplitOptions.None);
|
||||||
foreach (string line in lines)
|
foreach (string line in lines)
|
||||||
{
|
{
|
||||||
foreach (char ch in line)
|
foreach (char ch in line)
|
||||||
text.Add(Encoding.GetEncoding(1252).GetBytes(ch.ToString())[0]);
|
text.Add(Encoding.GetEncoding(1252).GetBytes(ch.ToString())[0]);
|
||||||
|
|
||||||
@ -79,7 +79,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
|||||||
|
|
||||||
text.Add(0x14);
|
text.Add(0x14);
|
||||||
text.Add(0x74);
|
text.Add(0x74);
|
||||||
//text.Add(0x17);
|
//text.Add(0x17);
|
||||||
//text.Add(0x21);
|
//text.Add(0x21);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -87,7 +87,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
|||||||
// codes+text length
|
// codes+text length
|
||||||
buffer = Encoding.ASCII.GetBytes(string.Format("{0:000}", text.Count));
|
buffer = Encoding.ASCII.GetBytes(string.Format("{0:000}", text.Count));
|
||||||
fs.Write(buffer, 0, buffer.Length);
|
fs.Write(buffer, 0, buffer.Length);
|
||||||
|
|
||||||
WriteTime(fs, p.StartTime, true);
|
WriteTime(fs, p.StartTime, true);
|
||||||
|
|
||||||
// write codes + text
|
// write codes + text
|
||||||
|
@ -49,7 +49,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
|||||||
// paragraphs
|
// paragraphs
|
||||||
foreach (Paragraph p in subtitle.Paragraphs)
|
foreach (Paragraph p in subtitle.Paragraphs)
|
||||||
{
|
{
|
||||||
string text = p.Text;
|
string text = p.Text;
|
||||||
|
|
||||||
//styles + ?
|
//styles + ?
|
||||||
buffer = new byte[] {
|
buffer = new byte[] {
|
||||||
@ -61,7 +61,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
|||||||
0,
|
0,
|
||||||
3, // justification, 1=left, 2=right, 3=center
|
3, // justification, 1=left, 2=right, 3=center
|
||||||
0xF, //horizontal position, 1=top, F=bottom
|
0xF, //horizontal position, 1=top, F=bottom
|
||||||
0x10, //horizontal position, 3=left, 0x10=center, 0x19=right
|
0x10, //horizontal position, 3=left, 0x10=center, 0x19=right
|
||||||
};
|
};
|
||||||
|
|
||||||
//Normal : 12 01 00 00 00 00 03 0F 10
|
//Normal : 12 01 00 00 00 00 03 0F 10
|
||||||
@ -101,7 +101,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
|||||||
}
|
}
|
||||||
|
|
||||||
var textBytes = new List<byte>();
|
var textBytes = new List<byte>();
|
||||||
bool italic = false;
|
bool italic = false;
|
||||||
if (p.Text.StartsWith("<i>") && p.Text.EndsWith("</i>"))
|
if (p.Text.StartsWith("<i>") && p.Text.EndsWith("</i>"))
|
||||||
italic = true;
|
italic = true;
|
||||||
text = Utilities.RemoveHtmlTags(text);
|
text = Utilities.RemoveHtmlTags(text);
|
||||||
@ -124,7 +124,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
|||||||
{
|
{
|
||||||
textBytes.Add(Encoding.GetEncoding(1252).GetBytes(text.Substring(j, 1))[0]);
|
textBytes.Add(Encoding.GetEncoding(1252).GetBytes(text.Substring(j, 1))[0]);
|
||||||
j++;
|
j++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int length = textBytes.Count + 20;
|
int length = textBytes.Count + 20;
|
||||||
@ -243,7 +243,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sb.Append(Encoding.ASCII.GetString(buffer, index, 1));
|
sb.Append(Encoding.ASCII.GetString(buffer, index, 1));
|
||||||
}
|
}
|
||||||
j++;
|
j++;
|
||||||
|
@ -161,7 +161,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
|||||||
</video>
|
</video>
|
||||||
</media>
|
</media>
|
||||||
</sequence>
|
</sequence>
|
||||||
</xmeml>";
|
</xmeml>";
|
||||||
|
|
||||||
string xmlTrackStructure =
|
string xmlTrackStructure =
|
||||||
@" <generatoritem id='Outline Text[NUMBER]'>
|
@" <generatoritem id='Outline Text[NUMBER]'>
|
||||||
@ -411,7 +411,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
|||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
XmlNode trackNode = xml.DocumentElement.SelectSingleNode("sequence/media/video/track");
|
XmlNode trackNode = xml.DocumentElement.SelectSingleNode("sequence/media/video/track");
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
|||||||
|
|
||||||
int pos = line.IndexOf("[0] = ");
|
int pos = line.IndexOf("[0] = ");
|
||||||
for (int i = pos + 6; i < line.Length && Utilities.IsInteger(line[i].ToString()); i++)
|
for (int i = pos + 6; i < line.Length && Utilities.IsInteger(line[i].ToString()); i++)
|
||||||
{
|
{
|
||||||
sb.Append(line.Substring(i, 1));
|
sb.Append(line.Substring(i, 1));
|
||||||
}
|
}
|
||||||
p.StartTime.TotalMilliseconds = int.Parse(sb.ToString());
|
p.StartTime.TotalMilliseconds = int.Parse(sb.ToString());
|
||||||
@ -72,14 +72,14 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
|||||||
pos = line.IndexOf("[1] = '");
|
pos = line.IndexOf("[1] = '");
|
||||||
sb = new StringBuilder();
|
sb = new StringBuilder();
|
||||||
for (int i = pos + 7; i<line.Length &&line[i] != '\''; i++)
|
for (int i = pos + 7; i<line.Length &&line[i] != '\''; i++)
|
||||||
{
|
{
|
||||||
sb.Append(line.Substring(i, 1));
|
sb.Append(line.Substring(i, 1));
|
||||||
}
|
}
|
||||||
if (sb.Length > 0)
|
if (sb.Length > 0)
|
||||||
sb.AppendLine();
|
sb.AppendLine();
|
||||||
pos = line.IndexOf("[2] = '");
|
pos = line.IndexOf("[2] = '");
|
||||||
for (int i = pos + 7; i<line.Length &&line[i] != '\''; i++)
|
for (int i = pos + 7; i<line.Length &&line[i] != '\''; i++)
|
||||||
{
|
{
|
||||||
sb.Append(line.Substring(i, 1));
|
sb.Append(line.Substring(i, 1));
|
||||||
}
|
}
|
||||||
p.Text = sb.ToString().Trim();
|
p.Text = sb.ToString().Trim();
|
||||||
|
@ -115,9 +115,9 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
|||||||
0x2E,
|
0x2E,
|
||||||
0x14,
|
0x14,
|
||||||
(byte)(0x74 - (numberOfNewLines * 0x20)),
|
(byte)(0x74 - (numberOfNewLines * 0x20)),
|
||||||
|
|
||||||
0x17, 0x21, // 0x1721=center, 0x1722=right ?
|
0x17, 0x21, // 0x1721=center, 0x1722=right ?
|
||||||
};
|
};
|
||||||
|
|
||||||
//if (text.StartsWith("{\\a6}"))
|
//if (text.StartsWith("{\\a6}"))
|
||||||
//{
|
//{
|
||||||
|
@ -6,7 +6,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
|
|||||||
{
|
{
|
||||||
public class UnknownSubtitle1 : SubtitleFormat
|
public class UnknownSubtitle1 : SubtitleFormat
|
||||||
{
|
{
|
||||||
//0:01 – 0:11
|
//0:01 – 0:11
|
||||||
static readonly Regex RegexTimeCodes = new Regex(@"^\d+:\d\d – \d+:\d\d ", RegexOptions.Compiled);
|
static readonly Regex RegexTimeCodes = new Regex(@"^\d+:\d\d – \d+:\d\d ", RegexOptions.Compiled);
|
||||||
|
|
||||||
public override string Extension
|
public override string Extension
|
||||||
|
Loading…
Reference in New Issue
Block a user