]> git.saurik.com Git - wxWidgets.git/blobdiff - src/richtext/richtextxml.cpp
Don't trigger kill focus event twice
[wxWidgets.git] / src / richtext / richtextxml.cpp
index 8b914fb646eefc773d33eb313451f47866b2e7f8..a9f803f49a69c36c5f4bbd27cb0d556d515f6a10 100644 (file)
@@ -706,10 +706,19 @@ 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)
+            if ((c < 32 || c == 34) && c != 9 && c != 10 && c != 13)
             {
                 if (i > 0)
                 {