* TextControl.cs: If a suitable wrapping position isn't found,
authorJackson Harper <jackson@novell.com>
Mon, 6 Nov 2006 20:32:52 +0000 (20:32 -0000)
committerJackson Harper <jackson@novell.com>
Mon, 6 Nov 2006 20:32:52 +0000 (20:32 -0000)
        just wrap right in the middle of a word.

svn path=/trunk/mcs/; revision=67415

mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextControl.cs

index f6ab033031bda53ed412b46d7bc308a5dec85eb6..601561b80766dae933a6b7417cc7c466e9965f04 100644 (file)
@@ -1,3 +1,8 @@
+2006-11-06  Jackson Harper  <jackson@ximian.com>
+
+       * TextControl.cs: If a suitable wrapping position isn't found,
+       just wrap right in the middle of a word.
+
 2006-11-06  Alexander Olk  <alex.olk@googlemail.com>
 
        * ListView.cs, ListViewItem.cs: Implement LabelEdit. Fixes
index 7913ceb0b09028eb27b0e3961a44fe042b6f0f9d..d9b43aebefd541e19288b9ae8b6fa0f281cb75c8 100644 (file)
@@ -479,6 +479,13 @@ namespace System.Windows.Forms {
                                                len = this.text.Length;
                                                retval = true;
                                                wrapped = true;
+                                       } else if ((widths[pos] + w) > (doc.viewport_width - this.right_indent)) {
+                                               // No suitable wrap position was found so break right in the middle of a word
+                                               tag.width = tag.width + w;
+                                               doc.Split(this, tag, pos, true);
+                                               len = this.text.Length;
+                                               retval = true;
+                                               wrapped = true;
                                        }
                                }