[mapguide-commits] r8569 - trunk/Tools/Maestro/Maestro.Editors/Generic

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Wed Mar 11 06:54:29 PDT 2015


Author: jng
Date: 2015-03-11 06:54:29 -0700 (Wed, 11 Mar 2015)
New Revision: 8569

Modified:
   trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditorCtrl.cs
Log:
Prevent potential double-ups of the XML prolog when formatting XML text in the Generic XML editor

Modified: trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditorCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditorCtrl.cs	2015-03-11 11:40:14 UTC (rev 8568)
+++ trunk/Tools/Maestro/Maestro.Editors/Generic/XmlEditorCtrl.cs	2015-03-11 13:54:29 UTC (rev 8569)
@@ -26,6 +26,7 @@
 using OSGeo.MapGuide.ObjectModels;
 using OSGeo.MapGuide.ObjectModels.IO;
 using System;
+using System.Linq;
 using System.Collections.Generic;
 using System.Drawing;
 using System.IO;
@@ -319,7 +320,8 @@
             {
                 using (var uw = new Utf8XmlWriter(ms))
                 {
-                    uw.WriteStartDocument();
+                    if (!doc.ChildNodes.OfType<XmlDeclaration>().Any())
+                        uw.WriteStartDocument();
                     doc.WriteTo(uw);
                     uw.Flush();
                 }



More information about the mapguide-commits mailing list