Fixed bug in "Fix common errors" -> "Fix hyphens (add dash)" - Seungki :)

git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@1419 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
niksedk 2012-10-11 19:32:27 +00:00
parent c960390af5
commit 25ca8f0848
2 changed files with 47 additions and 39 deletions

View File

@ -58,7 +58,6 @@ namespace Nikse.SubtitleEdit.Forms
this.buttonRefreshFixes = new System.Windows.Forms.Button();
this.buttonFixesSelectAll = new System.Windows.Forms.Button();
this.buttonFixesInverse = new System.Windows.Forms.Button();
this.subtitleListView1 = new Nikse.SubtitleEdit.Controls.SubtitleListView();
this.contextMenuStripListview = new System.Windows.Forms.ContextMenuStrip(this.components);
this.toolStripMenuItemDelete = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
@ -70,7 +69,6 @@ namespace Nikse.SubtitleEdit.Forms
this.buttonAutoBreak = new System.Windows.Forms.Button();
this.labelStartTimeWarning = new System.Windows.Forms.Label();
this.labelDurationWarning = new System.Windows.Forms.Label();
this.timeUpDownStartTime = new Nikse.SubtitleEdit.Controls.TimeUpDown();
this.numericUpDownDuration = new System.Windows.Forms.NumericUpDown();
this.labelDuration = new System.Windows.Forms.Label();
this.labelStartTime = new System.Windows.Forms.Label();
@ -80,6 +78,8 @@ namespace Nikse.SubtitleEdit.Forms
this.tabPageLog = new System.Windows.Forms.TabPage();
this.textBoxFixedIssues = new System.Windows.Forms.TextBox();
this.labelNumberOfImportantLogMessages = new System.Windows.Forms.Label();
this.subtitleListView1 = new Nikse.SubtitleEdit.Controls.SubtitleListView();
this.timeUpDownStartTime = new Nikse.SubtitleEdit.Controls.TimeUpDown();
this.groupBoxStep1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.tabControl1.SuspendLayout();
@ -168,6 +168,7 @@ namespace Nikse.SubtitleEdit.Forms
this.comboBoxLanguage.Size = new System.Drawing.Size(196, 21);
this.comboBoxLanguage.TabIndex = 0;
this.comboBoxLanguage.SelectedIndexChanged += new System.EventHandler(this.comboBoxLanguage_SelectedIndexChanged);
this.comboBoxLanguage.Enter += new System.EventHandler(this.comboBoxLanguage_Enter);
//
// labelLanguage
//
@ -393,28 +394,6 @@ namespace Nikse.SubtitleEdit.Forms
this.buttonFixesInverse.UseVisualStyleBackColor = true;
this.buttonFixesInverse.Click += new System.EventHandler(this.ButtonFixesInverseClick);
//
// subtitleListView1
//
this.subtitleListView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.subtitleListView1.ContextMenuStrip = this.contextMenuStripListview;
this.subtitleListView1.DisplayExtraFromExtra = false;
this.subtitleListView1.FirstVisibleIndex = -1;
this.subtitleListView1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.subtitleListView1.FullRowSelect = true;
this.subtitleListView1.GridLines = true;
this.subtitleListView1.HideSelection = false;
this.subtitleListView1.Location = new System.Drawing.Point(3, 5);
this.subtitleListView1.Name = "subtitleListView1";
this.subtitleListView1.OwnerDraw = true;
this.subtitleListView1.Size = new System.Drawing.Size(785, 156);
this.subtitleListView1.TabIndex = 110;
this.subtitleListView1.UseCompatibleStateImageBehavior = false;
this.subtitleListView1.UseSyntaxColoring = true;
this.subtitleListView1.View = System.Windows.Forms.View.Details;
this.subtitleListView1.SelectedIndexChanged += new System.EventHandler(this.SubtitleListView1SelectedIndexChanged);
//
// contextMenuStripListview
//
this.contextMenuStripListview.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
@ -530,16 +509,6 @@ namespace Nikse.SubtitleEdit.Forms
this.labelDurationWarning.TabIndex = 31;
this.labelDurationWarning.Text = "labelDurationWarning";
//
// timeUpDownStartTime
//
this.timeUpDownStartTime.AutoSize = true;
this.timeUpDownStartTime.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.timeUpDownStartTime.Location = new System.Drawing.Point(8, 27);
this.timeUpDownStartTime.Margin = new System.Windows.Forms.Padding(4);
this.timeUpDownStartTime.Name = "timeUpDownStartTime";
this.timeUpDownStartTime.Size = new System.Drawing.Size(92, 25);
this.timeUpDownStartTime.TabIndex = 112;
//
// numericUpDownDuration
//
this.numericUpDownDuration.DecimalPlaces = 3;
@ -650,6 +619,38 @@ namespace Nikse.SubtitleEdit.Forms
this.labelNumberOfImportantLogMessages.TabIndex = 11;
this.labelNumberOfImportantLogMessages.Text = "labelNumberOfImportantLogMessages";
//
// subtitleListView1
//
this.subtitleListView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.subtitleListView1.ContextMenuStrip = this.contextMenuStripListview;
this.subtitleListView1.DisplayExtraFromExtra = false;
this.subtitleListView1.FirstVisibleIndex = -1;
this.subtitleListView1.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.subtitleListView1.FullRowSelect = true;
this.subtitleListView1.GridLines = true;
this.subtitleListView1.HideSelection = false;
this.subtitleListView1.Location = new System.Drawing.Point(3, 5);
this.subtitleListView1.Name = "subtitleListView1";
this.subtitleListView1.OwnerDraw = true;
this.subtitleListView1.Size = new System.Drawing.Size(785, 156);
this.subtitleListView1.TabIndex = 110;
this.subtitleListView1.UseCompatibleStateImageBehavior = false;
this.subtitleListView1.UseSyntaxColoring = true;
this.subtitleListView1.View = System.Windows.Forms.View.Details;
this.subtitleListView1.SelectedIndexChanged += new System.EventHandler(this.SubtitleListView1SelectedIndexChanged);
//
// timeUpDownStartTime
//
this.timeUpDownStartTime.AutoSize = true;
this.timeUpDownStartTime.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.timeUpDownStartTime.Location = new System.Drawing.Point(8, 27);
this.timeUpDownStartTime.Margin = new System.Windows.Forms.Padding(4);
this.timeUpDownStartTime.Name = "timeUpDownStartTime";
this.timeUpDownStartTime.Size = new System.Drawing.Size(92, 25);
this.timeUpDownStartTime.TabIndex = 112;
//
// FixCommonErrors
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);

View File

@ -238,6 +238,10 @@ namespace Nikse.SubtitleEdit.Forms
private void AddFixActions(Subtitle subtitle, string threeLetterISOLanguageName)
{
_turkishAnsiIndex = -1;
_danishLetterIIndex = -1;
_spanishInvertedQuestionAndExclamationMarksIndex = -1;
FixCommonErrorsSettings ce = Configuration.Settings.CommonErrors;
_fixActions = new List<FixItem>();
_fixActions.Add(new FixItem(_language.RemovedEmptyLinesUnsedLineBreaks, string.Empty, delegate { FixEmptyLines(); }, ce.EmptyLinesTicked));
@ -2693,7 +2697,7 @@ namespace Nikse.SubtitleEdit.Forms
string[] parts = Utilities.RemoveHtmlTags(text).Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
if (parts.Length == 2)
{
bool doAdd = parts[0].Trim().EndsWith(".") || parts[0].Trim().EndsWith("!") || parts[0].Trim().EndsWith("?");
bool doAdd = parts[0].Trim().EndsWith(".") || parts[0].Trim().EndsWith("!") || parts[0].Trim().EndsWith("?") || _autoDetectGoogleLanguage == "ko";
if (parts[0].Trim().StartsWith("-") && parts[1].Contains(":"))
doAdd = false;
@ -2707,9 +2711,9 @@ namespace Nikse.SubtitleEdit.Forms
{
// add dash in second line.
if (text.Contains(Environment.NewLine + "<i>"))
text.Replace(Environment.NewLine + "<i>", Environment.NewLine + "<i>- ");
text = text.Replace(Environment.NewLine + "<i>", Environment.NewLine + "<i>- ");
else
text.Replace(Environment.NewLine, Environment.NewLine + "- ").Replace(Environment.NewLine + "- ", Environment.NewLine + "- ");
text = text.Replace(Environment.NewLine, Environment.NewLine + "- ").Replace(Environment.NewLine + "- ", Environment.NewLine + "- ");
}
else
{
@ -4168,8 +4172,6 @@ namespace Nikse.SubtitleEdit.Forms
if (_spanishInvertedQuestionAndExclamationMarksIndex > -1)
ce.SpanishInvertedQuestionAndExclamationMarksTicked = listView1.Items[_spanishInvertedQuestionAndExclamationMarksIndex].Checked;
Configuration.Settings.Save();
}
@ -4832,5 +4834,10 @@ namespace Nikse.SubtitleEdit.Forms
}
}
private void comboBoxLanguage_Enter(object sender, EventArgs e)
{
SaveConfiguration();
}
}
}