Author: toshok
Date: 2006-11-09 15:15:35 -0500 (Thu, 09 Nov 2006)
New Revision: 67634

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Label.cs
Log:
2006-11-09  Chris Toshok  <[EMAIL PROTECTED]>

        * Label.cs (CalcPreferredWidth): if Text == "", our preferred
        width is 0, not 3.  Fixes a unit test.



Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-11-09 19:38:49 UTC (rev 67633)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-11-09 20:15:35 UTC (rev 67634)
@@ -1,3 +1,8 @@
+2006-11-09  Chris Toshok  <[EMAIL PROTECTED]>
+
+       * Label.cs (CalcPreferredWidth): if Text == "", our preferred
+       width is 0, not 3.  Fixes a unit test.
+
 2006-11-09  Mike Kestner  <[EMAIL PROTECTED]>
 
        * ListView.cs : use Implicit scrollbars so that focus isn't 

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Label.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Label.cs 
2006-11-09 19:38:49 UTC (rev 67633)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Label.cs 
2006-11-09 20:15:35 UTC (rev 67634)
@@ -620,9 +620,14 @@
 
                private void CalcPreferredWidth ()
                {
-                       SizeF size;
-                       size = DeviceContext.MeasureString (Text, Font, 
req_witdthsize, string_format);
-                       preferred_width = (int) size.Width + 3;
+                       if (Text == string.Empty) {
+                               preferred_width = 0;
+                       }
+                       else {
+                               SizeF size;
+                               size = DeviceContext.MeasureString (Text, Font, 
req_witdthsize, string_format);
+                               preferred_width = (int) size.Width + 3;
+                       }
                }
 
                private void OnHandleCreatedLB (Object o, EventArgs e)

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

Reply via email to