XML_SetDefaultHandler(parser, DefaultHnd);
XML_SetUnknownEncodingHandler(parser, UnknownEncodingHnd, NULL);
+ bool ok = true;
do
{
size_t len = stream.Read(buf, BUFSIZE).LastRead();
wxLogError(_("XML parsing error: '%s' at line %d"),
XML_ErrorString(XML_GetErrorCode(parser)),
XML_GetCurrentLineNumber(parser));
- return FALSE;
+ ok = false;
+ break;
}
} while (!done);
- SetVersion(ctx.version);
- SetFileEncoding(ctx.encoding);
- SetRoot(ctx.root);
+ if (ok)
+ {
+ SetVersion(ctx.version);
+ SetFileEncoding(ctx.encoding);
+ SetRoot(ctx.root);
+ }
XML_ParserFree(parser);
#if !wxUSE_UNICODE
delete ctx.conv;
#endif
- return TRUE;
+ return ok;
}
XML_SetDefaultHandler(parser, DefaultHnd);
XML_SetUnknownEncodingHandler(parser, UnknownEncodingHnd, NULL);
+ bool ok = true;
do
{
size_t len = stream.Read(buf, BUFSIZE).LastRead();
wxLogError(_("XML parsing error: '%s' at line %d"),
XML_ErrorString(XML_GetErrorCode(parser)),
XML_GetCurrentLineNumber(parser));
- return FALSE;
+ ok = false;
+ break;
}
} while (!done);
- SetVersion(ctx.version);
- SetFileEncoding(ctx.encoding);
- SetRoot(ctx.root);
+ if (ok)
+ {
+ SetVersion(ctx.version);
+ SetFileEncoding(ctx.encoding);
+ SetRoot(ctx.root);
+ }
XML_ParserFree(parser);
#if !wxUSE_UNICODE
delete ctx.conv;
#endif
- return TRUE;
+ return ok;
}