]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed wxXmlDocument::Save() to interpret the indentstep argument correctly
authorVáclav Slavík <vslavik@fastmail.fm>
Sun, 4 Oct 2009 21:19:40 +0000 (21:19 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sun, 4 Oct 2009 21:19:40 +0000 (21:19 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62255 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
include/wx/xml/xml.h
interface/wx/xml/xml.h
src/xml/xml.cpp

index 892c52277894789a1ce0d211df7548c6d2158f9f..dc440605b0585f2889f37e5ef7f39a5336495193 100644 (file)
@@ -153,9 +153,14 @@ Changes in behaviour not resulting in compilation errors, please read this!
   and not in both this and the orthogonal directions. This behaviour is what
   most of the people expect but if you really relied on this overload adding
   space in both directions you should change your code to use AddSpacer(x, x).
-  
+
 - wxTextCtrl::LoadFile no longer sends a text update event.
 
+- wxXmlDocument::Save()'s indentstep argument's interpretation was fixed
+  to match the documentation: it now really is the number of spaces in
+  indentation instead of being its double. Its default value was changed
+  accordingly, to 2.
+
 
 Changes in behaviour which may result in compilation errors
 -----------------------------------------------------------
index 939e5260980515ccf6255d6c5c8f3c1c39252260..8df417203b7ba9bf5117f921272c03994cd19818 100644 (file)
@@ -265,8 +265,8 @@ public:
                       const wxString& encoding = wxT("UTF-8"), int flags = wxXMLDOC_NONE);
 
     // Saves document as .xml file.
-    virtual bool Save(const wxString& filename, int indentstep = 1) const;
-    virtual bool Save(wxOutputStream& stream, int indentstep = 1) const;
+    virtual bool Save(const wxString& filename, int indentstep = 2) const;
+    virtual bool Save(wxOutputStream& stream, int indentstep = 2) const;
 
     bool IsOk() const { return m_root != NULL; }
 
index c3491b4f9287963775d9e58fb7a631a98279fa32..a71f580d12d1daf5052e4fa4c21fbd397936785f 100644 (file)
@@ -597,13 +597,13 @@ public:
         If @a indentstep is @c wxXML_NO_INDENTATION, then, automatic indentation
         is turned off.
     */
-    virtual bool Save(const wxString& filename, int indentstep = 1) const;
+    virtual bool Save(const wxString& filename, int indentstep = 2) const;
 
     /**
         Saves XML tree in the given output stream.
         See Save(const wxString&, int) for a description of @a indentstep.
     */
-    virtual bool Save(wxOutputStream& stream, int indentstep = 1) const;
+    virtual bool Save(wxOutputStream& stream, int indentstep = 2) const;
 
     /**
         Sets the enconding of the document.
index 1917c27ba81e9a4c104c1e67f3a12ba9deee2adf..534777558a3aeb965e35df5389352c7ec040d923 100644 (file)
@@ -885,7 +885,7 @@ bool OutputIndentation(wxOutputStream& stream,
                        wxMBConv *convFile)
 {
     wxString str(wxS("\n"));
-    str += wxString(2*indent, wxS(' '));
+    str += wxString(indent, wxS(' '));
     return OutputString(stream, str, convMem, convFile);
 }