merge with head
authorJb Evain <jbevain@gmail.com>
Wed, 26 Mar 2008 20:27:17 +0000 (20:27 -0000)
committerJb Evain <jbevain@gmail.com>
Wed, 26 Mar 2008 20:27:17 +0000 (20:27 -0000)
svn path=/branches/jb/ml2/mcs/; revision=99060

15 files changed:
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs
mcs/class/Managed.Windows.Forms/System.Windows.Forms/TreeNodeCollection.cs
mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/TreeViewTest.cs
mcs/class/System.Web.Services/Test/System.Web.Services.Description/ChangeLog
mcs/class/System.Web.Services/Test/System.Web.Services.Description/ServiceDescriptionReflectorTest.cs
mcs/class/System.XML/System.Xml.Serialization/ChangeLog
mcs/class/System.XML/System.Xml.Serialization/MapCodeGenerator.cs
mcs/class/System.XML/System.Xml.Serialization/XmlTypeMapMember.cs
mcs/class/System.XML/System.Xml.Serialization/XmlTypeMapMemberElement.cs
mcs/class/System/System.Diagnostics/ChangeLog
mcs/class/System/System.Diagnostics/FileVersionInfo.cs
mcs/class/corlib/System.Threading/ChangeLog
mcs/class/corlib/System.Threading/Thread.cs

index 1c11c6a9a208d62f9aa671e4e205288a11460b4a..49c9578547c9c6702a628c26d81fc4b2a3f482a4 100644 (file)
@@ -1,3 +1,15 @@
+2008-03-26  Jonathan Pobst  <monkey@jpobst.com>
+
+       * ComboBox.cs: Guard against NRE if an arrow key is hit while
+       we aren't dropped down.  Support Home/End in DropDownList mode.
+       [Fixes bug #371990]
+
+2008-03-26  Jonathan Pobst  <monkey@jpobst.com>
+
+       * TreeNodeCollection.cs: Don't increment count until we've
+       saved our index to return.
+       [Fixes bug #373603]
+
 2008-03-25  Jonathan Pobst  <monkey@jpobst.com>
 
        * Label.cs: Add padding to the label's AutoSize calculation.
index 154196494ae71d6a5d9553e01f236a90cdb079c2..6c95155ac89e890508b2aa455f566699e4c2c301 100644 (file)
@@ -1568,8 +1568,9 @@ namespace System.Windows.Forms
                                case Keys.Up:
                                        SelectedIndex = Math.Max(SelectedIndex-1, 0);
 
-                                       if (SelectedIndex < listbox_ctrl.FirstVisibleItem ())
-                                               listbox_ctrl.Scroll (SelectedIndex - listbox_ctrl.FirstVisibleItem ());
+                                       if (DroppedDown)
+                                               if (SelectedIndex < listbox_ctrl.FirstVisibleItem ())
+                                                       listbox_ctrl.Scroll (SelectedIndex - listbox_ctrl.FirstVisibleItem ());
                                        break;
        
                                case Keys.Down:
@@ -1578,30 +1579,53 @@ namespace System.Windows.Forms
                                        else
                                                SelectedIndex = Math.Min(SelectedIndex+1, Items.Count-1);
                                                
-                                               if (SelectedIndex >= listbox_ctrl.LastVisibleItem ())
-                                                       listbox_ctrl.Scroll (SelectedIndex - listbox_ctrl.LastVisibleItem () + 1);
+                                               if (DroppedDown)
+                                                       if (SelectedIndex >= listbox_ctrl.LastVisibleItem ())
+                                                               listbox_ctrl.Scroll (SelectedIndex - listbox_ctrl.LastVisibleItem () + 1);
                                        break;
                                
                                case Keys.PageUp:
                                        if (listbox_ctrl != null)
                                                SelectedIndex = Math.Max(SelectedIndex- (listbox_ctrl.page_size-1), 0);
 
-                                       if (SelectedIndex < listbox_ctrl.FirstVisibleItem ())
-                                               listbox_ctrl.Scroll (SelectedIndex - listbox_ctrl.FirstVisibleItem ());
+                                       if (DroppedDown)
+                                               if (SelectedIndex < listbox_ctrl.FirstVisibleItem ())
+                                                       listbox_ctrl.Scroll (SelectedIndex - listbox_ctrl.FirstVisibleItem ());
                                        break;
        
                                case Keys.PageDown:
                                        if (listbox_ctrl != null)
                                                SelectedIndex = Math.Min(SelectedIndex+(listbox_ctrl.page_size-1), Items.Count-1);
 
-                                       if (SelectedIndex >= listbox_ctrl.LastVisibleItem ())
-                                               listbox_ctrl.Scroll (SelectedIndex - listbox_ctrl.LastVisibleItem () + 1);
+                                       if (DroppedDown)
+                                               if (SelectedIndex >= listbox_ctrl.LastVisibleItem ())
+                                                       listbox_ctrl.Scroll (SelectedIndex - listbox_ctrl.LastVisibleItem () + 1);
                                        break;
                                        
                                case Keys.Escape:
                                        DropDownListBoxFinished ();
                                        break;
                                        
+                               case Keys.Home:
+                                       if (dropdown_style == ComboBoxStyle.DropDownList) {
+                                               SelectedIndex = 0;
+
+                                               if (DroppedDown)
+                                                       if (SelectedIndex < listbox_ctrl.FirstVisibleItem ())
+                                                               listbox_ctrl.Scroll (SelectedIndex - listbox_ctrl.FirstVisibleItem ());
+                                       }
+                                       
+                                       break;
+                               case Keys.End:
+                                       if (dropdown_style == ComboBoxStyle.DropDownList) {
+                                               SelectedIndex = Items.Count - 1;
+
+                                               if (DroppedDown)
+                                                       if (SelectedIndex >= listbox_ctrl.LastVisibleItem ())
+                                                               listbox_ctrl.Scroll (SelectedIndex - listbox_ctrl.LastVisibleItem () + 1);
+                                       }
+                                       
+                                       break;
                                default:
                                        break;
                        }
index b7f74d6439e3d84014cf58b4e427c7b3f99c4638..ae118a48ab3539ed168c98901689cf65c30cb776 100644 (file)
@@ -133,8 +133,9 @@ namespace System.Windows.Forms {
                        } else {
                                if (count >= nodes.Length)
                                        Grow ();
-                               nodes [count++] = node;
+                               nodes[count] = node;
                                res = count;
+                               count++;
                        }
 
                        SetupNode (node);
index 4cd9c9459c4f807f40b16321ddccf545d7dbdbc6..849fb251dc97a12e40e12d8f88f1809732c3971b 100644 (file)
@@ -1,3 +1,7 @@
+2008-03-26  Jonathan Pobst  <monkey@jpobst.com>
+
+       * TreeViewTest.cs: Add test for bug #373603.
+
 2008-03-25  Carlos Alberto Cortez <calberto.cortez@gmail.com>
 
        * ListBindingHelper.cs: New test for GetListName method.
index d2ba31e9ec0e89c4513e776c43087c5b90545860..0538cc9f953804ed497fdb09a1fa59b577b3e0c5 100644 (file)
@@ -65,6 +65,20 @@ namespace MonoTests.System.Windows.Forms
                        f.Dispose ();
                }
 
+               [Test]
+               public void NodeAddIndex ()
+               {
+                       TreeView tv = new TreeView ();
+
+                       TreeNode tn1 = new TreeNode ("blah");
+                       TreeNode tn2 = new TreeNode ("blah2");
+                       TreeNode tn3 = new TreeNode ("blah3");
+
+                       Assert.AreEqual (0, tv.Nodes.Add (tn1), "A1");
+                       Assert.AreEqual (1, tv.Nodes.Add (tn2), "A2");
+                       Assert.AreEqual (2, tv.Nodes.Add (tn3), "A3");
+               }
+               
                [Test]
                public void NodesCopyToTest ()
                {
index ad0e28176349d3d18a8e720cb87e19e5957aef9c..d13ec5bbf90dc0f81ad2975ba6c81e068e86f412 100644 (file)
@@ -1,3 +1,8 @@
+2008-03-26  Lluis Sanchez Gual <lluis@novell.com> 
+
+       * ServiceDescriptionReflectorTest.cs: Added another test for bug
+         #345448.
+
 2008-02-22  Atsushi Enomoto  <atsushi@ximian.com>
 
        * ServiceDescriptionReflectorTest.cs : mark Bug345448() NotWorking.
index 680159add0699c918b40cf697f8b4aafcf4b1b9a..008f030a1e49d731a070d427b141deece8a24bae 100644 (file)
@@ -282,6 +282,9 @@ namespace MonoTests.System.Web.Services.Description
                                new ServiceDescriptionReflector ();
                        r.Reflect (typeof (Bug345448Service), "urn:foo");
                        Assert.IsNotNull (r.ServiceDescriptions [0].PortTypes ["Bug345448ServiceSoap"]);
+                       
+                       // Make sure the map for service client is properly created
+                       new Bug345448SoapHttpClientProtocol ();
                }
 #endif
 
@@ -448,6 +451,11 @@ namespace MonoTests.System.Web.Services.Description
                                return "Hello World";
                        }
                }
+
+               [WebServiceBindingAttribute (Name = "AnotherBinding", Namespace = "http://tempuri.org/")]
+               public class Bug345448SoapHttpClientProtocol : SoapHttpClientProtocol
+               {
+               }
 #endif
        }
 }
index a4e14c6027950c4a1c28bea346015dc1ce371f0b..9c6ccbad477997b62846800e64ad03e24242d428 100644 (file)
@@ -1,3 +1,9 @@
+2008-03-26  Lluis Sanchez Gual <lluis@novell.com> 
+
+       * MapCodeGenerator.cs, XmlTypeMapMember.cs, XmlTypeMapMemberElement.cs:
+         If a value type field has the IsNullable property set to true,
+         generate it as System.Nullable<T>.
+
 2008-03-26  Lluis Sanchez Gual <lluis@novell.com> 
 
        * XmlSchemaImporter.cs: Fix problem with primitive types with a forced
index 924f81243837e5a37f76838d891d453244db1772..d4f70804d739800c67d9e2a2d0a314f15dee9cf6 100644 (file)
@@ -176,7 +176,7 @@ namespace System.Xml.Serialization {
 
                        if (map.BaseMap != null && map.BaseMap.TypeData.SchemaType != SchemaTypes.XmlNode)
                        {
-                               CodeTypeReference ctr = GetDomType (map.BaseMap.TypeData);
+                               CodeTypeReference ctr = GetDomType (map.BaseMap.TypeData, false);
                                codeClass.BaseTypes.Add (ctr);
                                if (map.BaseMap.IncludeInSchema) {
                                        ExportMapCode (map.BaseMap, false);
@@ -278,12 +278,12 @@ namespace System.Xml.Serialization {
 
                CodeTypeMember CreateFieldMember (CodeTypeDeclaration codeClass, TypeData type, string name)
                {
-                       return CreateFieldMember (codeClass, GetDomType (type), name, System.DBNull.Value, null, null);
+                       return CreateFieldMember (codeClass, GetDomType (type, false), name, System.DBNull.Value, null, null);
                }
 
                CodeTypeMember CreateFieldMember (CodeTypeDeclaration codeClass, XmlTypeMapMember member)
                {
-                       return CreateFieldMember (codeClass, GetDomType (member.TypeData), member.Name, member.DefaultValue, member.TypeData, member.Documentation);
+                       return CreateFieldMember (codeClass, GetDomType (member.TypeData, member.RequiresNullable), member.Name, member.DefaultValue, member.TypeData, member.Documentation);
                }
                
                CodeTypeMember CreateFieldMember (CodeTypeDeclaration codeClass, CodeTypeReference type, string name, object defaultValue, TypeData defaultType, string documentation)
@@ -630,14 +630,14 @@ namespace System.Xml.Serialization {
                }
 #endif
                
-               CodeTypeReference GetDomType (TypeData data)
+               CodeTypeReference GetDomType (TypeData data, bool requiresNullable)
                {
 #if NET_2_0
-                       if (data.IsValueType && data.IsNullable)
+                       if (data.IsValueType && (data.IsNullable || requiresNullable))
                                return new CodeTypeReference ("System.Nullable", new CodeTypeReference (data.FullTypeName));
 #endif
                        if (data.SchemaType == SchemaTypes.Array)
-                               return new CodeTypeReference (GetDomType (data.ListItemTypeData),1);
+                               return new CodeTypeReference (GetDomType (data.ListItemTypeData, false),1);
                        else
                                return new CodeTypeReference (data.FullTypeName);
                }
@@ -682,7 +682,7 @@ namespace System.Xml.Serialization {
                                        throw new InvalidOperationException ("Type " + typeData.TypeName + " not supported");
 
                                IFormattable defaultValueFormattable = defaultValue as IFormattable;
-                               CodeFieldReferenceExpression fref = new CodeFieldReferenceExpression (new CodeTypeReferenceExpression (GetDomType (typeData)), defaultValueFormattable != null ? defaultValueFormattable.ToString(null, CultureInfo.InvariantCulture) : defaultValue.ToString ());
+                               CodeFieldReferenceExpression fref = new CodeFieldReferenceExpression (new CodeTypeReferenceExpression (GetDomType (typeData, false)), defaultValueFormattable != null ? defaultValueFormattable.ToString(null, CultureInfo.InvariantCulture) : defaultValue.ToString ());
                                CodeAttributeArgument arg = new CodeAttributeArgument (fref);
                                AddCustomAttribute (externalField, "System.ComponentModel.DefaultValue", arg);
                                internalField.InitExpression = fref;
index 4be4ea7e743336ec010cab4590f41bd8ce9dfe43..e3cd8bc869527412a3895d87b2e28e934227106c 100644 (file)
@@ -173,5 +173,9 @@ namespace System.Xml.Serialization
                        if (_specifiedMember is PropertyInfo) ((PropertyInfo)_specifiedMember).SetValue (ob, value, null);
                        else ((FieldInfo)_specifiedMember).SetValue (ob, value);
                }
+               
+               public virtual bool RequiresNullable {
+                       get { return false; }
+               }
        }
 }
index 30b0614e97c524b9a1ea683f4e01d2306293e75d..f05ab6b2a018033bb162f01d5985b1f55f4d68df 100644 (file)
@@ -100,6 +100,15 @@ namespace System.Xml.Serialization
                        get { return _isTextCollector; }
                        set { _isTextCollector = value; }
                }
+               
+               public override bool RequiresNullable {
+                       get {
+                               foreach (XmlTypeMapElementInfo einfo in ElementInfo)
+                                       if (einfo.IsNullable)
+                                               return true;
+                               return false;
+                       }
+               }
        }
 
        // XmlTypeMapMemberList
index 5e114659322ab4a505fa9a32254a14d8a42fa7f7..3f91a10408c57b4f11ca5fb97dcc36ee0c8d6ed6 100644 (file)
@@ -1,3 +1,8 @@
+2008-03-26  Dick Porter  <dick@ximian.com>
+
+       * FileVersionInfo.cs: Patch from Gert Driesen
+       (gert.driesen@pandora.be) for bug 355717.
+
 2008-03-19  Zoltan Varga  <vargaz@gmail.com>
 
        * Stopwatch.cs: Fix visibility of GetTimestamp () method.
index 96af7f2e64fa87a04c2b84258de409ebd108dd9f..8a292f9cf6498095ae0172f26f3b430c708ee66f 100644 (file)
@@ -73,6 +73,23 @@ namespace System.Diagnostics {
 
                private FileVersionInfo ()
                {
+#if NET_2_0
+                       // no nulls (for unavailable items)
+                       comments = null;
+                       companyname = null;
+                       filedescription = null;
+                       filename = null;
+                       fileversion = null;
+                       internalname = null;
+                       language = null;
+                       legalcopyright = null;
+                       legaltrademarks = null;
+                       originalfilename = null;
+                       privatebuild = null;
+                       productname = null;
+                       productversion = null;
+                       specialbuild = null;
+#else
                        // no nulls (for unavailable items)
                        comments = String.Empty;
                        companyname = String.Empty;
@@ -88,6 +105,7 @@ namespace System.Diagnostics {
                        productname = String.Empty;
                        productversion = String.Empty;
                        specialbuild = String.Empty;
+#endif
                        // This is here just to shut the compiler up
                        isdebug=false;
                        ispatched=false;
index 81d7cd9963db9837329f287d7c31332501037101..77cca93e3d198110bb91360d2a2e9a9a0b1e5b73 100644 (file)
@@ -1,3 +1,6 @@
+2008-03-26  Massimiliano Mantione <massi@ximian.com>
+       * Thread.cs: Renamed "unused6" because it will be used to hold
+       the "mono_thread_manage" callback.
 
 Tue Feb 26 17:51:58 CET 2008 Paolo Molaro <lupus@ximian.com>
 
index 04f68520061d246b23e9152fa373c29bdcc3487d..79939f9deeecd33d05a2e6a03a7abcb9442fe325 100644 (file)
@@ -103,7 +103,7 @@ namespace System.Threading {
                 * when a new field is added to the unmanaged MonoThread structure.
                 */
                private IntPtr small_id;
-               private IntPtr unused6;
+               private IntPtr manage_callback;
                private IntPtr unused7;
                volatile int critical_region_level;
                #endregion