X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7d76fbd5a1ae1e8cab3c4a49c5e93cc9952a5aab..ada175836e7b9e456b7f32d82bfb5f6b21d5608d:/src/richtext/richtextxml.cpp?ds=sidebyside diff --git a/src/richtext/richtextxml.cpp b/src/richtext/richtextxml.cpp index d967ae5d02..d6b35b6b4e 100644 --- a/src/richtext/richtextxml.cpp +++ b/src/richtext/richtextxml.cpp @@ -181,9 +181,13 @@ bool wxRichTextXMLHandler::ImportXML(wxRichTextBuffer* buffer, wxXmlNode* node) // note: 0 == wxBITMAP_TYPE_INVALID if (type <= 0 || type >= wxBITMAP_TYPE_MAX) + { wxLogWarning("Invalid bitmap type specified for tag: %d", type); + } else + { imageType = (wxBitmapType)type; + } } wxString data; @@ -491,7 +495,11 @@ static void OutputStringEnt(wxOutputStream& stream, const wxString& str, OutputString(stream, str.Mid(last, i - last), convMem, convFile); wxString s(wxT("&#")); +#if wxUSE_UNICODE s << (int) c; +#else + s << (int) wxUChar(c); +#endif s << wxT(";"); OutputString(stream, s, NULL, NULL); last = i + 1; @@ -543,7 +551,11 @@ static wxString AttributeToXML(const wxString& str) str1 += str.Mid(last, i - last); wxString s(wxT("&#")); +#if wxUSE_UNICODE s << (int) c; +#else + s << (int) wxUChar(c); +#endif s << wxT(";"); str1 += s; last = i + 1; @@ -726,7 +738,11 @@ bool wxRichTextXMLHandler::ExportXML(wxOutputStream& stream, wxMBConv* convMem, } else for (i = 0; i < len; i++) { +#if wxUSE_UNICODE int c = (int) text[i]; +#else + int c = (int) wxUChar(text[i]); +#endif if ((c < 32 || c == 34) && c != 9 && c != 10 && c != 13) { if (i > 0)