ran tabspace

git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@2106 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
XhmikosR 2013-09-22 06:04:31 +00:00
parent 7819c9dbf0
commit a657db1569
16 changed files with 46 additions and 48 deletions

View File

@ -1294,7 +1294,7 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
var fontStyle = FontStyle.Regular;
if (parameter.SubtitleFontBold)
fontStyle = FontStyle.Bold;
font = new Font(parameter.SubtitleFontName, parameter.SubtitleFontSize, fontStyle);
font = new Font(parameter.SubtitleFontName, parameter.SubtitleFontSize, fontStyle);
}
catch (Exception exception)
{
@ -1317,7 +1317,7 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
font = new Font(FontFamily.Families[2].Name, parameter.SubtitleFontSize);
else
font = new Font("Arial", parameter.SubtitleFontSize);
}
}
}
SizeF textSize = g.MeasureString("Hj!", font);

View File

@ -9482,7 +9482,7 @@ namespace Nikse.SubtitleEdit.Forms
vobSubOcr.ShowIcon = true;
}
_formPositionsAndSizes.SetPositionAndSize(vobSubOcr);
if (vobSubOcr.Initialize(fileName, Configuration.Settings.VobSubOcr, true, this))
if (vobSubOcr.Initialize(fileName, Configuration.Settings.VobSubOcr, true, this))
{
if (vobSubOcr.ShowDialog(this) == DialogResult.OK)
{

View File

@ -34,7 +34,7 @@ namespace Nikse.SubtitleEdit.Forms
_xml.LoadXml(subtitle.Header);
var xnsmgr = new XmlNamespaceManager(_xml.NameTable);
xnsmgr.AddNamespace("ttml", "http://www.w3.org/ns/ttml");
if (_xml.DocumentElement.SelectSingleNode("ttml:head", xnsmgr) == null)
if (_xml.DocumentElement.SelectSingleNode("ttml:head", xnsmgr) == null)
_xml.LoadXml(new TimedText10().ToText(new Subtitle(), "tt")); // load default xml
}
catch

View File

@ -754,7 +754,7 @@ namespace Nikse.SubtitleEdit.Forms
}
if (comboBoxCharacterDatabase.SelectedIndex < 0)
comboBoxCharacterDatabase.SelectedIndex = 0;
comboBoxCharacterDatabase.SelectedIndexChanged += ComboBoxCharacterDatabaseSelectedIndexChanged;
comboBoxCharacterDatabase.SelectedIndexChanged += ComboBoxCharacterDatabaseSelectedIndexChanged;
}
catch (Exception ex)
@ -773,7 +773,7 @@ namespace Nikse.SubtitleEdit.Forms
_compareDoc.LoadXml("<OcrBitmaps></OcrBitmaps>");
else
_compareDoc.Load(path + "CompareDescription.xml");
string databaseName = path + "Images.db";
if (!File.Exists(databaseName))
{
@ -786,11 +786,11 @@ namespace Nikse.SubtitleEdit.Forms
XmlNode node = _compareDoc.DocumentElement.SelectSingleNode("FileName[.='" + name + "']");
if (node != null)
{
node.InnerText = f.Position.ToString(CultureInfo.InvariantCulture);
node.InnerText = f.Position.ToString(CultureInfo.InvariantCulture);
var b = new Bitmap(bmpFileName);
var m = new ManagedBitmap(b);
b.Dispose();
m.AppendToStream(f);
m.AppendToStream(f);
}
}
f.Close();
@ -2223,7 +2223,7 @@ namespace Nikse.SubtitleEdit.Forms
foreach (CompareItem compareItem in _compareBitmaps)
{
// check for expand match!
if (compareItem.ExpandCount > 0 && compareItem.Bitmap.Width > target.Width &&
if (compareItem.ExpandCount > 0 && compareItem.Bitmap.Width > target.Width &&
parentBitmap.Width >= compareItem.Bitmap.Width + targetItem.X &&
parentBitmap.Height >= compareItem.Bitmap.Height + targetItem.Y)
{
@ -2238,7 +2238,7 @@ namespace Nikse.SubtitleEdit.Forms
}
}
index++;
}
}
// Search images with minor location changes
FindBestMatch(ref index, ref smallestDifference, ref smallestIndex, target);
@ -2289,13 +2289,13 @@ namespace Nikse.SubtitleEdit.Forms
var cutBitmap2 = NikseBitmapImageSplitter.CropTopAndBottom(cutBitmap, out topCrop);
if (cutBitmap2.Height != target.Height)
FindBestMatch(ref index, ref smallestDifference, ref smallestIndex, cutBitmap2);
}
}
}
if (smallestIndex >= 0)
{
double differencePercentage = smallestDifference * 100.0 / (target.Width * target.Height);
double maxDiff = (double)numericUpDownMaxErrorPct.Value;
double maxDiff = (double)numericUpDownMaxErrorPct.Value;
//_vobSubOcrSettings.AllowDifferenceInPercent; // should be around 1.0 for vob/sub...
//if (_bluRaySubtitlesOriginal != null)
// maxDiff = 12.9; // let bluray sup have a 12.9% diff
@ -3830,7 +3830,7 @@ namespace Nikse.SubtitleEdit.Forms
int smallestDifference = 10000;
int smallestIndex = -1;
if (smallestDifference > 0)
{
index = 0;
@ -3952,7 +3952,7 @@ namespace Nikse.SubtitleEdit.Forms
}
bitmap.Dispose();
p.Result = GetStringWithItalicTags(matches);
}
void ImageCompareThreadRunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
@ -4069,7 +4069,7 @@ namespace Nikse.SubtitleEdit.Forms
int index2 = 0;
int topMargin = item.Y - item.ParentY;
foreach (NOcrChar oc in _nocrChars)
{
{
if (Math.Abs(oc.Width - nbmp.Width) < 3 && Math.Abs(oc.Height - nbmp.Height) < 4 && Math.Abs(oc.MarginTop - topMargin) < 4)
{ // only very accurate matches
@ -4149,7 +4149,7 @@ namespace Nikse.SubtitleEdit.Forms
}
index++;
}
return GetStringWithItalicTags(matches);
return GetStringWithItalicTags(matches);
}
static void NOcrThreadDoWork(object sender, DoWorkEventArgs e)
@ -5047,7 +5047,7 @@ namespace Nikse.SubtitleEdit.Forms
line = line.Replace(" ", " ");
}
}
if (wordsNotFound > 0 || correctWords == 0 || textWithOutFixes != null && textWithOutFixes.ToString().Replace("~", string.Empty).Trim().Length < 2)
{

View File

@ -540,7 +540,7 @@ namespace Nikse.SubtitleEdit.Logic.BluRaySup
// write PCS end
PacketHeader[10] = 0x16; // ID
ToolBox.SetDWord(PacketHeader, 2, pic.EndTimeForWrite); // PTS
ToolBox.SetDWord(PacketHeader, 2, pic.EndTimeForWrite); // PTS
dts = pic.EndTimeForWrite - 1; //dts = pic.StartTimeForWrite - 1;
ToolBox.SetDWord(PacketHeader, 6, dts); // DTS
ToolBox.SetWord(PacketHeader, 11, HeaderPCSEnd.Length); // size

View File

@ -10,7 +10,7 @@ namespace Nikse.SubtitleEdit.Logic
public string HeaderId { get; private set; }
public UInt32 HeaderFileSize { get; private set; }
public UInt32 OffsetToPixelArray { get; private set; }
public BmpReader(string fileName)
{
byte[] buffer = System.IO.File.ReadAllBytes(fileName);
@ -21,5 +21,5 @@ namespace Nikse.SubtitleEdit.Logic
}
}

View File

@ -664,7 +664,7 @@
// }
// if (different > maxDiff)
// return different + 10;
// }
// }
// return different;
// }

View File

@ -1567,7 +1567,7 @@
public string WaveFormGridColor { get; set; }
public string WaveFormShowGridLines { get; set; }
public string ReverseMouseWheelScrollDirection { get; set; }
public string WaveFormAllowOverlap { get; set; }
public string WaveFormAllowOverlap { get; set; }
public string WaveFormColor { get; set; }
public string WaveFormSelectedColor { get; set; }
public string WaveFormBackgroundColor { get; set; }

View File

@ -17,7 +17,7 @@ namespace Nikse.SubtitleEdit.Logic
using (MemoryStream fd = new MemoryStream())
using (Stream fs = File.OpenRead(fileName))
using (Stream csStream = new GZipStream(fs, CompressionMode.Decompress))
{
{
int nRead;
while ((nRead = csStream.Read(buffer, 0, buffer.Length)) > 0)
{
@ -27,7 +27,7 @@ namespace Nikse.SubtitleEdit.Logic
csStream.Close();
buffer = fd.ToArray();
}
Width = buffer[4] << 8 | buffer[5];
Height = buffer[6] << 8 | buffer[7];
_colors = new Color[Width * Height];
@ -126,7 +126,7 @@ namespace Nikse.SubtitleEdit.Logic
}
private int ReadInt16(Stream stream)
{
{
byte b0 = (byte)stream.ReadByte();
byte b1 = (byte)stream.ReadByte();
return b0 << 8 | b1;
@ -178,9 +178,9 @@ namespace Nikse.SubtitleEdit.Logic
/// <param name="section">Source rectangle</param>
/// <returns>Rectangle from current image as new bitmap</returns>
public ManagedBitmap GetRectangle(Rectangle section)
{
{
ManagedBitmap newRectangle = new ManagedBitmap(section.Width, section.Height);
int recty = 0;
for (int y=section.Top; y < section.Top + section.Height; y++)
{

View File

@ -918,6 +918,5 @@ namespace Nikse.SubtitleEdit.Logic
}
}
}

View File

@ -592,7 +592,7 @@ namespace Nikse.SubtitleEdit.Logic
return different + 10;
}
return different;
}
}
internal static unsafe int IsBitmapsAlike(NikseBitmap bmp1, ManagedBitmap bmp2)
{
@ -610,7 +610,7 @@ namespace Nikse.SubtitleEdit.Logic
return different + 10;
}
return different;
}
}
}
}

View File

@ -62,7 +62,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
0x71, // я
0x6E, // н
0x74, // т
0x5C, // Э
0x5C, // Э
0x77, // ю
0x46, // Ф
0x5E, // Ч
@ -131,7 +131,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
"п",
"в",
"У",
"щ",
"щ",
"ф",
"э",
"ш",
@ -713,7 +713,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
text = text.Replace(encoding.GetString(new byte[] { 0x7F }), string.Empty); // Used to fill empty space upto 51 bytes
text = text.Replace(encoding.GetString(new byte[] { 0xBE }), string.Empty); // Unknown?
if (text.Contains("<i></i>"))
text = text.Replace("<i></i>", "<i>");
if (text.Contains("<i>") && !text.Contains("</i>"))
@ -748,7 +748,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
while (textLength >= 1 && index + textLength < buffer.Length && (buffer[index + textLength-1] == 0))
textLength--;
if (textLength > 0)
{
{
text = Encoding.GetEncoding(1201).GetString(buffer, index, textLength).Replace("\0", string.Empty);
}
else

View File

@ -856,7 +856,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
public override bool IsMine(List<string> lines, string fileName)
{
if (!string.IsNullOrEmpty(fileName) && File.Exists(fileName))
if (!string.IsNullOrEmpty(fileName) && File.Exists(fileName))
{
try
{

View File

@ -7,7 +7,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
{
public class Titra : SubtitleFormat
{
//* 1 : 01:01:31:19 01:01:33:04 22c
//* 1 : 01:01:31:19 01:01:33:04 22c
static Regex regexTimeCodes = new Regex(@"^\* \d+ :\t\d\d:\d\d:\d\d:\d\d\t\d\d:\d\d:\d\d:\d\d\t\d+c", RegexOptions.Compiled);
private int _maxMsDiv10 = 0;
@ -35,7 +35,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
private int GetMaxCharsForDuration(double durationSeconds)
{
return (int)Math.Round(15.7 * durationSeconds);
return (int)Math.Round(15.7 * durationSeconds);
}
public override string ToText(Subtitle subtitle, string title)
@ -43,14 +43,13 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
var sb = new StringBuilder();
sb.AppendLine(@"TVS - TITRA FILM
Titre VO : L'heure d'é
Titre VST :
Création : 23/10/2009 - 16:31
Révision : 26/10/2009 - 17:48
Langue VO : Français
Langue VST : Espagnol
Bobine : e01
Titre VO : L'heure d'é
Titre VST :
Création : 23/10/2009 - 16:31
Révision : 26/10/2009 - 17:48
Langue VO : Français
Langue VST : Espagnol
Bobine : e01
BEWARE : No more than 40 characters ON A LINE
@ -107,7 +106,7 @@ ATTENTION : Pas plus de 40 caractères PAR LIGNE
{
_errorCount += 10;
}
}
}
else if (line.Trim().Length == 0)
{
// skip these lines

View File

@ -629,7 +629,7 @@ namespace Nikse.SubtitleEdit.Logic
{
p.Text = sb.ToString().Trim();
subtitle.Paragraphs.Add(p);
}
}
subtitle.Renumber(1);
return subtitle;

View File

@ -25,7 +25,7 @@ namespace Nikse.SubtitleEdit.Logic.VobSub
//b4To9AsBinary = b4To9AsBinary.Substring(2,3) + b4To9AsBinary.Substring(6,15) + b4To9AsBinary.Substring(22,15);
//SystemClockReferenceQuotient = Helper.GetUInt32FromBinaryString(b4To9AsBinary);
//SystemClockReferenceRemainder = (ulong)(((buffer[8] & Helper.B00000011) << 8) + buffer[9])
//SystemClockReferenceRemainder = (ulong)(((buffer[8] & Helper.B00000011) << 8) + buffer[9])
ProgramMuxRate = Helper.GetEndian(buffer, 10, 3) >> 2;