Author: jackson
Date: 2006-12-20 11:12:08 -0500 (Wed, 20 Dec 2006)
New Revision: 69813

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs
Log:

        * TextBoxBase.cs: When changing the font across the document we
        can't recalculate after changing each line, since that will
cahnge
        the line count.



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-12-20 15:41:34 UTC (rev 69812)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-12-20 16:12:08 UTC (rev 69813)
@@ -1,3 +1,9 @@
+2006-12-20  Jackson Harper  <[EMAIL PROTECTED]>
+
+       * TextBoxBase.cs: When changing the font across the document we
+       can't recalculate after changing each line, since that will cahnge
+       the line count.
+
 2006-12-19  Rolf Bjarne Kvinge  <[EMAIL PROTECTED]>
 
        * Control.cs: Added some missing 2.0 bits: 

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs   
2006-12-20 15:41:34 UTC (rev 69812)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/TextBoxBase.cs   
2006-12-20 16:12:08 UTC (rev 69813)
@@ -497,7 +497,7 @@
 
                        set {
                                document.ReplaceSelection(CaseAdjust(value), 
false);
-                                       
+
                                ScrollToCaret();
                                OnTextChanged(EventArgs.Empty);
                        }
@@ -1790,14 +1790,16 @@
                        if (!richtext) {
                                Line    line;
 
+                               document.NoRecalc = true;
                                // Font changes apply to the whole document
                                for (int i = 1; i <= document.Lines; i++) {
                                        line = document.GetLine(i);
                                        LineTag.FormatText(line, 1, 
line.text.Length, Font,
                                                        
ThemeEngine.Current.ResPool.GetSolidBrush(ForeColor),
                                                        null, 
FormatSpecified.Font | FormatSpecified.Color);
-                                       document.UpdateView(line, 0);
                                }
+                               document.UpdateView (document.GetLine (1), 0);
+                               document.NoRecalc = false;
                                // Make sure the caret height is matching the 
new font height
                                document.AlignCaret();
                        }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to