Author: jpobst
Date: 2007-12-20 10:06:43 -0500 (Thu, 20 Dec 2007)
New Revision: 91713
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Line.cs
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs
Log:
2007-12-20 Jonathan Pobst <[EMAIL PROTECTED]>
* Line.cs, TextControl.cs: Apply patch from Luke Page that finds the
end of a tag better, fixing a IndexOutOfRangeException.
[Fixes bug #349926]
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2007-12-20 14:50:48 UTC (rev 91712)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
2007-12-20 15:06:43 UTC (rev 91713)
@@ -1,3 +1,9 @@
+2007-12-20 Jonathan Pobst <[EMAIL PROTECTED]>
+
+ * Line.cs, TextControl.cs: Apply patch from Luke Page that finds the
+ end of a tag better, fixing a IndexOutOfRangeException.
+ [Fixes bug #349926]
+
2007-12-19 Carlos Alberto Cortez <[EMAIL PROTECTED]>
* ListBox.cs: Both FindString and FindStringExact methods must do an
Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Line.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Line.cs
2007-12-20 14:50:48 UTC (rev 91712)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Line.cs
2007-12-20 15:06:43 UTC (rev 91713)
@@ -348,7 +348,9 @@
pos = text.Length - 1;
while (tag != null) {
- if (((tag.Start - 1) <= pos) && (pos <
(tag.Start + tag.Length - 1)))
+ // if its less than or equal on the second part
then
+ // we find the tag which the caret is at the
end of
+ if (((tag.Start - 1) <= pos) && (pos <=
(tag.Start + tag.Length - 1)))
return LineTag.GetFinalTag (tag);
tag = tag.Next;
Modified:
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs
2007-12-20 14:50:48 UTC (rev 91712)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs
2007-12-20 15:06:43 UTC (rev 91713)
@@ -1013,7 +1013,7 @@
current_line = GetLine (start_line.LineNo +
current_cumulative - 1);
// find the tag we start on
- LineTag current_tag = current_line.FindTag
(index_found - (int)cumulative_length_list [current_cumulative - 1]);
+ LineTag current_tag = current_line.FindTag
(index_found - (int)cumulative_length_list [current_cumulative - 1] + 1);
if (current_tag.Start != (index_found -
(int)cumulative_length_list [current_cumulative - 1]) + 1) {
if (current_tag == CaretTag)
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches