Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEberhard Beilharz <eb1@sil.org>2017-09-14 18:52:52 +0300
committerMarek Safar <marek.safar@gmail.com>2017-09-15 11:33:22 +0300
commit66b85dc9ad3c8536e0686f3132e37cd939af2da9 (patch)
tree6ab43015628ba65001b9d3e7b0a781a7d9cbcc41 /mcs/class/System.Windows.Forms
parent9300c086e0e5bfe429db40eeaf05eab38e3ba384 (diff)
[SWF] Allow to compile without X11 installed (Xamarin-59496)
This change fixes a crash we get in resgen when building without X11 installed. The bug got introduced when fixing Xamarin-395. Change-Id: If81a4a3ca4db7a1b0156480ad49bd61610ecebf0
Diffstat (limited to 'mcs/class/System.Windows.Forms')
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms.Layout/TableLayoutSettingsTypeConverter.cs2
-rw-r--r--mcs/class/System.Windows.Forms/System.Windows.Forms/TableLayoutStyleCollection.cs18
2 files changed, 11 insertions, 9 deletions
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms.Layout/TableLayoutSettingsTypeConverter.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms.Layout/TableLayoutSettingsTypeConverter.cs
index 575c0fe753e..b4e90d4c43a 100644
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms.Layout/TableLayoutSettingsTypeConverter.cs
+++ b/mcs/class/System.Windows.Forms/System.Windows.Forms.Layout/TableLayoutSettingsTypeConverter.cs
@@ -118,7 +118,7 @@ namespace System.Windows.Forms.Layout
XmlDocument xmldoc = new XmlDocument();
xmldoc.LoadXml (value as string);
- TableLayoutSettings settings = new TableLayoutSettings(new TableLayoutPanel());
+ TableLayoutSettings settings = new TableLayoutSettings(null);
int count = ParseControl (xmldoc, settings);
ParseColumnStyle (xmldoc, settings);
ParseRowStyle (xmldoc, settings);
diff --git a/mcs/class/System.Windows.Forms/System.Windows.Forms/TableLayoutStyleCollection.cs b/mcs/class/System.Windows.Forms/System.Windows.Forms/TableLayoutStyleCollection.cs
index 090ba92ecf7..df0558da933 100644
--- a/mcs/class/System.Windows.Forms/System.Windows.Forms/TableLayoutStyleCollection.cs
+++ b/mcs/class/System.Windows.Forms/System.Windows.Forms/TableLayoutStyleCollection.cs
@@ -38,9 +38,6 @@ namespace System.Windows.Forms {
internal TableLayoutStyleCollection (TableLayoutPanel table)
{
- if (table == null)
- throw new ArgumentNullException("table");
-
this.table = table;
}
@@ -54,7 +51,8 @@ namespace System.Windows.Forms {
foreach (TableLayoutStyle style in al)
style.Owner = null;
al.Clear ();
- table.PerformLayout ();
+ if (table != null)
+ table.PerformLayout ();
}
public int Count {
@@ -65,7 +63,8 @@ namespace System.Windows.Forms {
{
((TableLayoutStyle)al[index]).Owner = null;
al.RemoveAt (index);
- table.PerformLayout ();
+ if (table != null)
+ table.PerformLayout ();
}
#region IList methods
@@ -103,14 +102,16 @@ namespace System.Windows.Forms {
throw new ArgumentException ("Style is already owned");
((TableLayoutStyle)style).Owner = table;
al.Insert (index, (TableLayoutStyle) style);
- table.PerformLayout ();
+ if (table != null)
+ table.PerformLayout ();
}
void IList.Remove (object style)
{
((TableLayoutStyle)style).Owner = null;
al.Remove ((TableLayoutStyle) style);
- table.PerformLayout ();
+ if (table != null)
+ table.PerformLayout ();
}
bool IList.IsFixedSize {
@@ -134,7 +135,8 @@ namespace System.Windows.Forms {
throw new ArgumentException ("Style is already owned");
((TableLayoutStyle)value).Owner = table;
al [index] = value;
- table.PerformLayout ();
+ if (table != null)
+ table.PerformLayout ();
}
}
#endregion