diff options
author | Atsushi Eno <atsushieno@gmail.com> | 2005-12-23 23:14:56 +0300 |
---|---|---|
committer | Atsushi Eno <atsushieno@gmail.com> | 2005-12-23 23:14:56 +0300 |
commit | 61ccf99f784964d167c30789a927e1ec40d403b0 (patch) | |
tree | 21960fc0fb385ea14fb93b17fb814fdb827be7fd /mcs/class/System.XML/System.Xml/XmlTextWriter.cs | |
parent | a2f89ee36fefcd3429a80c4530cfe16448fd7288 (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.cs | 6 |
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); |