Author: mkestner
Date: 2006-07-18 12:36:32 -0400 (Tue, 18 Jul 2006)
New Revision: 62709

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

2006-07-17  Mike Kestner  <[EMAIL PROTECTED]>

        * ListViewItem.cs: restructure Font and subitem Font handling 
        to hold a specific font and refer back to owner on null.
        Fixes #78761.


Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-07-18 15:17:02 UTC (rev 62708)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2006-07-18 16:36:32 UTC (rev 62709)
@@ -1,5 +1,11 @@
 2006-07-17  Mike Kestner  <[EMAIL PROTECTED]>
 
+       * ListViewItem.cs: restructure Font and subitem Font handling 
+       to hold a specific font and refer back to owner on null.
+       Fixes #78761.
+
+2006-07-17  Mike Kestner  <[EMAIL PROTECTED]>
+
        * ToolBar.cs: bandaid for side-effect of previous patch which was
        discarding explicit heights for non-AutoSize toolbars.  Need to
        extend my format tester to deal with AutoSize=false. Fixes #78864.

Modified: 
trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListViewItem.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListViewItem.cs  
2006-07-18 15:17:02 UTC (rev 62708)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ListViewItem.cs  
2006-07-18 16:36:32 UTC (rev 62709)
@@ -57,6 +57,7 @@
                Rectangle item_rect;
                Rectangle label_rect;
                ListView owner;
+               Font font;
                bool selected;
 
                internal int row;
@@ -108,7 +109,7 @@
                        this.image_index = imageIndex;
                        ForeColor = foreColor;
                        BackColor = backColor;
-                       Font = font;
+                       this.font = font;
                }
                #endregion      // Public Constructors
 
@@ -183,19 +184,18 @@
                [DesignerSerializationVisibility 
(DesignerSerializationVisibility.Hidden)]
                public Font Font {
                        get {
-                               if (sub_items.Count > 0)
-                                       return sub_items[0].Font;
-
-                               if (owner != null)
+                               if (font != null)
+                                       return font;
+                               else if (owner != null)
                                        return owner.Font;
 
                                return ThemeEngine.Current.DefaultFont;
                        }
                        set {   
-                               if (sub_items[0].Font == value)
+                               if (font == value)
                                        return;
 
-                               sub_items[0].Font = value; 
+                               font = value; 
 
                                if (owner != null)
                                        Layout ();
@@ -629,8 +629,7 @@
 
                        public ListViewSubItem (ListViewItem owner, string text)
                                : this (owner, text, 
ThemeEngine.Current.ColorWindowText,
-                                       ThemeEngine.Current.ColorWindow,
-                                       ThemeEngine.Current.DefaultFont)
+                                       ThemeEngine.Current.ColorWindow, null)
                        {
                        }
 
@@ -661,9 +660,11 @@
                                                return font;
                                        else if (owner != null)
                                                return owner.Font;
-                                       return font;
+                                       return ThemeEngine.Current.DefaultFont;
                                }
                                set { 
+                                       if (font == value)
+                                               return;
                                        font = value; 
                                        Invalidate ();
                                    }

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

Reply via email to