]> git.saurik.com Git - wxWidgets.git/commitdiff
Don't omit empty text objects
authorJulian Smart <julian@anthemion.co.uk>
Thu, 21 Feb 2008 16:19:00 +0000 (16:19 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Thu, 21 Feb 2008 16:19:00 +0000 (16:19 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51966 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/richtext/richtextxml.cpp

index 8b914fb646eefc773d33eb313451f47866b2e7f8..c09d3342976be19dc3e1891fb0450fa574613d4a 100644 (file)
@@ -706,7 +706,16 @@ bool wxRichTextXMLHandler::ExportXML(wxOutputStream& stream, wxMBConv* convMem,
         int last = 0;
         const wxString& text = textObj.GetText();
         int len = (int) text.Length();
-        for (i = 0; i < len; i++)
+
+        if (len == 0)
+        {
+            i = 0;
+            OutputIndentation(stream, indent);
+            OutputString(stream, wxT("<") + objectName, convMem, convFile);
+            OutputString(stream, style + wxT(">"), convMem, convFile);
+            OutputString(stream, wxT("</text>"), convMem, convFile);
+        }
+        else for (i = 0; i < len; i++)
         {
             int c = (int) text[i];
             if (c < 32 && c != 9 && c != 10 && c != 13)