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:
authorAtsushi Eno <atsushieno@gmail.com>2009-04-22 08:46:09 +0400
committerAtsushi Eno <atsushieno@gmail.com>2009-04-22 08:46:09 +0400
commit6ffb2498cf20a14681d2b963d7d0516e1cd2abe4 (patch)
treed55ae4bb0959b6be515fd458ae5fe5d95ce4bb44 /mcs/class/System.XML/System.Xml
parentb2c1e349f268357e9d0b86cb999669a5046741fc (diff)
2009-04-22 Atsushi Enomoto <atsushi@ximian.com>
* XmlAttributeCollection.cs : when the node to be inserted has owner element _but_ is identical to that of this collection, do not reject it to raise an error. Fixed bug #496022. * XmlAttributeCollectionTests.cs : added test for bug #496022. svn path=/trunk/mcs/; revision=132344
Diffstat (limited to 'mcs/class/System.XML/System.Xml')
-rw-r--r--mcs/class/System.XML/System.Xml/ChangeLog6
-rw-r--r--mcs/class/System.XML/System.Xml/XmlAttributeCollection.cs2
2 files changed, 8 insertions, 0 deletions
diff --git a/mcs/class/System.XML/System.Xml/ChangeLog b/mcs/class/System.XML/System.Xml/ChangeLog
index dfef9cb511e..c29d0f3d02b 100644
--- a/mcs/class/System.XML/System.Xml/ChangeLog
+++ b/mcs/class/System.XML/System.Xml/ChangeLog
@@ -1,3 +1,9 @@
+2009-04-22 Atsushi Enomoto <atsushi@ximian.com>
+
+ * XmlAttributeCollection.cs : when the node to be inserted has owner
+ element _but_ is identical to that of this collection, do not
+ reject it to raise an error. Fixed bug #496022.
+
2009-03-25 Geoff Norton <gnorton@novell.com>
* XmlTextReader.cs: Create the uri as relativeorabsolute.
diff --git a/mcs/class/System.XML/System.Xml/XmlAttributeCollection.cs b/mcs/class/System.XML/System.Xml/XmlAttributeCollection.cs
index ffed64298c8..138d9ece9b4 100644
--- a/mcs/class/System.XML/System.Xml/XmlAttributeCollection.cs
+++ b/mcs/class/System.XML/System.Xml/XmlAttributeCollection.cs
@@ -255,6 +255,8 @@ namespace System.Xml
throw new ArgumentException ("this AttributeCollection is read only.");
XmlAttribute attr = node as XmlAttribute;
+ if (attr.OwnerElement == ownerElement)
+ return node; // do nothing
if (attr.OwnerElement != null)
throw new ArgumentException ("This attribute is already set to another element.");