X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7383cf9d17037a789e4ae022b310e88d192fd0ac..792f83f038067323c1c28900dcb1a03557295dff:/src/richtext/richtextxml.cpp diff --git a/src/richtext/richtextxml.cpp b/src/richtext/richtextxml.cpp index cec140e5c4..555ceac23c 100644 --- a/src/richtext/richtextxml.cpp +++ b/src/richtext/richtextxml.cpp @@ -16,14 +16,14 @@ #pragma hdrstop #endif +#if wxUSE_RICHTEXT && wxUSE_XML + +#include "wx/richtext/richtextxml.h" + #ifndef WX_PRECOMP #include "wx/wx.h" #endif -#include "wx/image.h" - -#if wxUSE_RICHTEXT - #include "wx/filename.h" #include "wx/clipbrd.h" #include "wx/wfstream.h" @@ -32,8 +32,6 @@ #include "wx/txtstrm.h" #include "wx/xml/xml.h" -#include "wx/richtext/richtextxml.h" - IMPLEMENT_DYNAMIC_CLASS(wxRichTextXMLHandler, wxRichTextFileHandler) #if wxUSE_STREAMS @@ -272,8 +270,16 @@ inline static void OutputString(wxOutputStream& stream, const wxString& str, { if (str.empty()) return; #if wxUSE_UNICODE - const wxWX2MBbuf buf(str.mb_str(convFile ? *convFile : wxConvUTF8)); - stream.Write((const char*)buf, strlen((const char*)buf)); + if (convFile) + { + const wxWX2MBbuf buf(str.mb_str(*convFile)); + stream.Write((const char*)buf, strlen((const char*)buf)); + } + else + { + const wxWX2MBbuf buf(str.mb_str(wxConvUTF8)); + stream.Write((const char*)buf, strlen((const char*)buf)); + } #else if ( convFile == NULL ) stream.Write(str.mb_str(), str.Len()); @@ -812,4 +818,4 @@ void wxRichTextHTMLHandler::OutputParagraphFormatting(const wxTextAttrEx& WXUNUS #endif #endif - // wxUSE_RICHTEXT + // wxUSE_RICHTEXT && wxUSE_XML