Hey,

Attached patch fixes bug 355408.  We have to take in account controls
and their size regardless of their dock/anchor state when calculating
row/column sizes.

If there are no objections I will commit.
Index: System.Windows.Forms.Layout/TableLayout.cs
===================================================================
--- System.Windows.Forms.Layout/TableLayout.cs	(revision 107002)
+++ System.Windows.Forms.Layout/TableLayout.cs	(working copy)
@@ -266,15 +266,13 @@
 							if (settings.GetColumnSpan (c) > 1)
 								continue;
 								
-							if (c.Dock == DockStyle.Fill || ((c.Anchor & AnchorStyles.Left) == AnchorStyles.Left && (c.Anchor & AnchorStyles.Right) == AnchorStyles.Right)) {
-								if (c.AutoSize)
-									max_width = Math.Max (max_width, c.PreferredSize.Width + c.Margin.Horizontal);
-								else
-									max_width = Math.Max (max_width, c.ExplicitBounds.Width + c.Margin.Horizontal);
-								
-								continue;
-							}
+							if (c.AutoSize)
+								max_width = Math.Max (max_width, c.PreferredSize.Width + c.Margin.Horizontal);
+							else
+								max_width = Math.Max (max_width, c.ExplicitBounds.Width + c.Margin.Horizontal);
 							
+							continue;
+							
 							if (c.Width + c.Margin.Left + c.Margin.Right > max_width)
 								max_width = c.Width + c.Margin.Left + c.Margin.Right;						
 						}
@@ -347,14 +345,12 @@
 							if (settings.GetRowSpan (c) > 1)
 								continue; 
 								
-							if (c.Dock == DockStyle.Fill || ((c.Anchor & AnchorStyles.Top) == AnchorStyles.Top && (c.Anchor & AnchorStyles.Bottom) == AnchorStyles.Bottom)) {
-								if (c.AutoSize)
-									max_height = Math.Max (max_height, c.PreferredSize.Height + c.Margin.Vertical);
-								else
-									max_height = Math.Max (max_height, c.ExplicitBounds.Height + c.Margin.Vertical);
+							if (c.AutoSize)
+								max_height = Math.Max (max_height, c.PreferredSize.Height + c.Margin.Vertical);
+							else
+								max_height = Math.Max (max_height, c.ExplicitBounds.Height + c.Margin.Vertical);
 
-								continue;
-							}
+							continue;
 
 							if (c.Height + c.Margin.Top + c.Margin.Bottom > max_height)
 								max_height = c.Height + c.Margin.Top + c.Margin.Bottom;
_______________________________________________
Mono-winforms-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-winforms-list

Reply via email to