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>2005-12-23 23:14:56 +0300
committerAtsushi Eno <atsushieno@gmail.com>2005-12-23 23:14:56 +0300
commit61ccf99f784964d167c30789a927e1ec40d403b0 (patch)
tree21960fc0fb385ea14fb93b17fb814fdb827be7fd /mcs/class/System.XML/System.Xml/XmlTextWriter.cs
parenta2f89ee36fefcd3429a80c4530cfe16448fd7288 (diff)
2005-12-23 Atsushi Enomoto <atsushi@ximian.com>
* XmlTextWriter.cs : When xml:space or xml:lang attribute was directly written without an element, it caused ArgumentOutOfRange. Fixed bug #77084. * XmlTextWriterTests.cs : XmlSpace_Valid() is working now. svn path=/trunk/mcs/; revision=54793
Diffstat (limited to 'mcs/class/System.XML/System.Xml/XmlTextWriter.cs')
-rw-r--r--mcs/class/System.XML/System.Xml/XmlTextWriter.cs6
1 files changed, 4 insertions, 2 deletions
diff --git a/mcs/class/System.XML/System.Xml/XmlTextWriter.cs b/mcs/class/System.XML/System.Xml/XmlTextWriter.cs
index c15571890a5..52be9d27981 100644
--- a/mcs/class/System.XML/System.Xml/XmlTextWriter.cs
+++ b/mcs/class/System.XML/System.Xml/XmlTextWriter.cs
@@ -558,7 +558,8 @@ openElements [openElementCount - 1]).IndentingOverriden;
if (openXmlLang) {
w.Write (xmlLang);
openXmlLang = false;
- ((XmlTextWriterOpenElement) openElements [openElementCount - 1]).XmlLang = xmlLang;
+ if (openElementCount > 0)
+ ((XmlTextWriterOpenElement) openElements [openElementCount - 1]).XmlLang = xmlLang;
}
if (openXmlSpace)
@@ -568,7 +569,8 @@ openElements [openElementCount - 1]).IndentingOverriden;
else if (xmlSpace == XmlSpace.Default)
w.Write ("default");
openXmlSpace = false;
- ((XmlTextWriterOpenElement) openElements [openElementCount - 1]).XmlSpace = xmlSpace;
+ if (openElementCount > 0)
+ ((XmlTextWriterOpenElement) openElements [openElementCount - 1]).XmlSpace = xmlSpace;
}
w.Write (quoteChar);