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
path: root/mcs
diff options
context:
space:
mode:
authorAtsushi Eno <atsushieno@gmail.com>2004-08-21 05:53:31 +0400
committerAtsushi Eno <atsushieno@gmail.com>2004-08-21 05:53:31 +0400
commita26c529845a46588f729fc45e418c7dc614adeb8 (patch)
tree2cd4cb33ef9eb218271b0ca5e09388cd4242e9ae /mcs
parent750d36191ec686addf471c98e6d8f71b703a4f17 (diff)
2004-08-21 Atsushi Enomoto <atsushi@ximian.com>
* XmlElement.cs : set_InnerText was removing children incompletely. This fixes bug #63574. svn path=/branches/mono-1-0/mcs/; revision=32616
Diffstat (limited to 'mcs')
-rw-r--r--mcs/class/System.XML/System.Xml/ChangeLog5
-rw-r--r--mcs/class/System.XML/System.Xml/XmlElement.cs8
2 files changed, 8 insertions, 5 deletions
diff --git a/mcs/class/System.XML/System.Xml/ChangeLog b/mcs/class/System.XML/System.Xml/ChangeLog
index 9ca1de79a45..c5ea3b2d6f7 100644
--- a/mcs/class/System.XML/System.Xml/ChangeLog
+++ b/mcs/class/System.XML/System.Xml/ChangeLog
@@ -1,3 +1,8 @@
+2004-08-21 Atsushi Enomoto <atsushi@ximian.com>
+
+ * XmlElement.cs : set_InnerText was removing children incompletely.
+ This fixes bug #63574.
+
2004-08-20 Atsushi Enomoto <atsushi@ximian.com>
ResetState() now throws InvalidOperationException() as MS.NET does.
diff --git a/mcs/class/System.XML/System.Xml/XmlElement.cs b/mcs/class/System.XML/System.Xml/XmlElement.cs
index a74d801671c..f506853124d 100644
--- a/mcs/class/System.XML/System.Xml/XmlElement.cs
+++ b/mcs/class/System.XML/System.Xml/XmlElement.cs
@@ -115,13 +115,11 @@ namespace System.Xml
}
set {
// Why its behavior (of MS FCL) is different from InnerXml...?
- if (FirstChild != null && FirstChild.NodeType == XmlNodeType.Text)
+ if (ChildNodes != null && ChildNodes.Count == 1 && FirstChild.NodeType == XmlNodeType.Text)
FirstChild.Value = value;
else {
- if (FirstChild != null) {
- for (int i = 0; i < ChildNodes.Count; i++)
- this.RemoveChild (ChildNodes [i]);
- }
+ while (FirstChild != null)
+ this.RemoveChild (FirstChild);
// creates new Text node
AppendChild (OwnerDocument.CreateTextNode (value));
}