#ifndef WX_PRECOMP
#include "wx/intl.h"
#include "wx/module.h"
+ #include "wx/log.h"
#endif
#include "wx/filename.h"
}
else if (childName == wxT("image"))
{
- int imageType = wxBITMAP_TYPE_PNG;
+ wxBitmapType imageType = wxBITMAP_TYPE_PNG;
wxString value = node->GetAttribute(wxT("imagetype"), wxEmptyString);
if (!value.empty())
- imageType = wxAtoi(value);
+ {
+ int type = wxAtoi(value);
+
+ // note: 0 == wxBITMAP_TYPE_INVALID
+ if (type <= 0 || type >= wxBITMAP_TYPE_MAX)
+ wxLogWarning("Invalid bitmap type specified for <image> tag: %d", type);
+ else
+ imageType = (wxBitmapType)type;
+ }
wxString data;
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)
{