From 40c9a3459c5639bd3c6ccf1cded57a368c928e2f Mon Sep 17 00:00:00 2001 From: niel-archer Date: Fri, 30 Dec 2011 02:26:09 +0000 Subject: [PATCH 1/2] BUG 2999054: Adding code to prefer Unicode format from clipboard before accepting ANSI text. --- trunk/Editor/SyntaxRichTextBox.cs | 16 +++++++++++----- trunk/Resource/ReleaseNotes.htm | 13 +++++++------ 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/trunk/Editor/SyntaxRichTextBox.cs b/trunk/Editor/SyntaxRichTextBox.cs index 61e622f..2a1866a 100644 --- a/trunk/Editor/SyntaxRichTextBox.cs +++ b/trunk/Editor/SyntaxRichTextBox.cs @@ -899,9 +899,15 @@ namespace LSLEditor public new void Paste() { - ResetHighlichting(); + ResetHighlighting(); - if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text, true)) + // First try with Unicode + if (Clipboard.GetDataObject().GetDataPresent(DataFormats.UnicodeText, true)) + { + string strTextToPaste = Clipboard.GetDataObject().GetData(DataFormats.UnicodeText, true).ToString().Replace("\r", ""); + this.ColoredText = strTextToPaste; + } // failing that try ANSI text. + else if (Clipboard.GetDataObject().GetDataPresent(DataFormats.Text, true)) { string strTextToPaste = Clipboard.GetDataObject().GetData(DataFormats.Text, true).ToString().Replace("\r", ""); this.ColoredText = strTextToPaste; @@ -1147,7 +1153,7 @@ namespace LSLEditor protected override void OnKeyPress(KeyPressEventArgs e) { - ResetHighlichting(); + ResetHighlighting(); char keyChar = e.KeyChar; @@ -1743,7 +1749,7 @@ namespace LSLEditor { BeginUpdate(); - ResetHighlichting(); + ResetHighlighting(); string strW = GetNewWhiteSpace(-1); int intTabs = (int)(strW.Length / AutoFormatter.GetTab().Length); @@ -1892,7 +1898,7 @@ namespace LSLEditor } } - private void ResetHighlichting() + private void ResetHighlighting() { if (HighLightList.Count == 0) return; diff --git a/trunk/Resource/ReleaseNotes.htm b/trunk/Resource/ReleaseNotes.htm index 2feab3e..f987402 100644 --- a/trunk/Resource/ReleaseNotes.htm +++ b/trunk/Resource/ReleaseNotes.htm @@ -11,7 +11,7 @@
  • "Release Notes..." to help menu.
  • - * Changed + - Changed - * Fixed: + - Fixed: From 4ddc74e8f583e684e989af57766c4733d591bf7a Mon Sep 17 00:00:00 2001 From: niel-archer Date: Fri, 30 Dec 2011 02:36:49 +0000 Subject: [PATCH 2/2] Fixed typo in Font/Colour options dialogue. --- trunk/Resource/ReleaseNotes.htm | 5 +++-- trunk/Tools/TextEditorFontColors.Designer.cs | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/trunk/Resource/ReleaseNotes.htm b/trunk/Resource/ReleaseNotes.htm index f987402..ab280af 100644 --- a/trunk/Resource/ReleaseNotes.htm +++ b/trunk/Resource/ReleaseNotes.htm @@ -21,11 +21,12 @@ - Fixed: diff --git a/trunk/Tools/TextEditorFontColors.Designer.cs b/trunk/Tools/TextEditorFontColors.Designer.cs index 55e261d..6b13855 100644 --- a/trunk/Tools/TextEditorFontColors.Designer.cs +++ b/trunk/Tools/TextEditorFontColors.Designer.cs @@ -128,18 +128,18 @@ namespace LSLEditor.Tools this.checkBox1.AutoSize = true; this.checkBox1.Location = new System.Drawing.Point(16, 24); this.checkBox1.Name = "checkBox1"; - this.checkBox1.Size = new System.Drawing.Size(142, 17); + this.checkBox1.Size = new System.Drawing.Size(145, 17); this.checkBox1.TabIndex = 0; - this.checkBox1.Text = "use original colorscheme"; + this.checkBox1.Text = "use original color scheme"; this.checkBox1.UseVisualStyleBackColor = true; // - // EnvironmentFontColors + // TextEditorFontColors // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.groupBox5); this.Controls.Add(this.groupBox1); - this.Name = "EnvironmentFontColors"; + this.Name = "TextEditorFontColors"; this.Size = new System.Drawing.Size(392, 272); this.groupBox5.ResumeLayout(false); this.groupBox5.PerformLayout();