2009-01-20 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Tue, 20 Jan 2009 04:46:23 +0000 (04:46 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Tue, 20 Jan 2009 04:46:23 +0000 (04:46 -0000)
* XDocument.cs : fix wrong indentation handling.

svn path=/trunk/mcs/; revision=123850

mcs/class/System.Xml.Linq/System.Xml.Linq/ChangeLog
mcs/class/System.Xml.Linq/System.Xml.Linq/XDocument.cs

index 2930a9296faf966fddd59387e03c5463ec4149dd..4093204cbee9ba278176e63866ba3019748353ed 100644 (file)
@@ -1,3 +1,7 @@
+2009-01-20  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * XDocument.cs : fix wrong indentation handling.
+
 2008-11-19  Jb Evain  <jbevain@novell.com>
 
        * XNodeReader: build on NET_2_1.
index eac4fa36c91787e7835bfc65bc08a4bc3fa26448..3a4ade811754b4a31cc96ef1a498bdbffc3dcee3 100644 (file)
@@ -200,13 +200,9 @@ namespace System.Xml.Linq
                public void Save (TextWriter tw, SaveOptions options)
                {
                        XmlWriterSettings s = new XmlWriterSettings ();
-                       if ((options & SaveOptions.DisableFormatting) == 0) {
-                               // hacky!
+                       if ((options & SaveOptions.DisableFormatting) == SaveOptions.None)
                                s.Indent = true;
-                               s.IndentChars = String.Empty;
-                               s.NewLineChars = String.Empty;
-                       }
-                       using (XmlWriter w = XmlWriter.Create (tw)) {
+                       using (XmlWriter w = XmlWriter.Create (tw, s)) {
                                Save (w);
                        }
                }