Fixed tab removal bug, and empty text element

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62613 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2009-11-11 10:59:14 +00:00
parent e3c3dfb409
commit a9a8cebc91

View File

@@ -743,16 +743,18 @@ bool wxRichTextXMLHandler::ExportXML(wxOutputStream& stream, wxMBConv* convMem,
#else #else
int c = (int) wxUChar(text[i]); int c = (int) wxUChar(text[i]);
#endif #endif
if ((c < 32 || c == 34) && c != 9 && c != 10 && c != 13) if ((c < 32 || c == 34) && /* c != 9 && */ c != 10 && c != 13)
{ {
if (i > 0) if (i > 0)
{
wxString fragment(text.Mid(last, i-last));
if (!fragment.IsEmpty())
{ {
OutputIndentation(stream, indent); OutputIndentation(stream, indent);
OutputString(stream, wxT("<") + objectName, convMem, convFile); OutputString(stream, wxT("<") + objectName, convMem, convFile);
OutputString(stream, style + wxT(">"), convMem, convFile); OutputString(stream, style + wxT(">"), convMem, convFile);
wxString fragment(text.Mid(last, i-last));
if (!fragment.empty() && (fragment[0] == wxT(' ') || fragment[fragment.length()-1] == wxT(' '))) if (!fragment.empty() && (fragment[0] == wxT(' ') || fragment[fragment.length()-1] == wxT(' ')))
{ {
OutputString(stream, wxT("\""), convMem, convFile); OutputString(stream, wxT("\""), convMem, convFile);
@@ -764,10 +766,11 @@ bool wxRichTextXMLHandler::ExportXML(wxOutputStream& stream, wxMBConv* convMem,
OutputString(stream, wxT("</text>"), convMem, convFile); OutputString(stream, wxT("</text>"), convMem, convFile);
} }
}
// Output this character as a number in a separate tag, because XML can't cope // Output this character as a number in a separate tag, because XML can't cope
// with entities below 32 except for 9, 10 and 13 // with entities below 32 except for 10 and 13
last = i + 1; last = i + 1;
OutputIndentation(stream, indent); OutputIndentation(stream, indent);
OutputString(stream, wxT("<symbol"), convMem, convFile); OutputString(stream, wxT("<symbol"), convMem, convFile);