#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"
#include "wx/txtstrm.h"
#include "wx/xml/xml.h"
-#include "wx/richtext/richtextxml.h"
-
IMPLEMENT_DYNAMIC_CLASS(wxRichTextXMLHandler, wxRichTextFileHandler)
#if wxUSE_STREAMS
return str1;
}
+// For use with earlier versions of wxWidgets
+#ifndef WXUNUSED_IN_UNICODE
+#if wxUSE_UNICODE
+#define WXUNUSED_IN_UNICODE(x) WXUNUSED(x)
+#else
+#define WXUNUSED_IN_UNICODE(x) x
+#endif
+#endif
+
// write string to output:
inline static void OutputString(wxOutputStream& stream, const wxString& str,
wxMBConv *WXUNUSED_IN_UNICODE(convMem) = NULL, wxMBConv *convFile = NULL)
{
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());
return stream;
}
+#if 0
static wxOutputStream& operator <<(wxOutputStream& stream, long l)
{
wxString str;
str.Printf(wxT("%c"), c);
return stream << str;
}
+#endif
// Convert a colour to a 6-digit hex string
static wxString ColourToHexString(const wxColour& col)
#endif
#endif
- // wxUSE_RICHTEXT
+ // wxUSE_RICHTEXT && wxUSE_XML