]> git.saurik.com Git - wxWidgets.git/blobdiff - src/xrc/xml.cpp
Reversed the meaning of black and white in wxRegion::ConvertToBitmap
[wxWidgets.git] / src / xrc / xml.cpp
index dac33413295b718ab4c630cca6386f973169c11d..b8b8aabec897b1b0158c9a5e1fb87f69eb6aa616 100644 (file)
@@ -531,6 +531,7 @@ bool wxXmlDocument::Load(wxInputStream& stream, const wxString& encoding)
     XML_SetDefaultHandler(parser, DefaultHnd);
     XML_SetUnknownEncodingHandler(parser, UnknownEncodingHnd, NULL);
 
+    bool ok = true;
     do
     {
         size_t len = stream.Read(buf, BUFSIZE).LastRead();
@@ -540,13 +541,17 @@ bool wxXmlDocument::Load(wxInputStream& stream, const wxString& encoding)
             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
@@ -554,7 +559,7 @@ bool wxXmlDocument::Load(wxInputStream& stream, const wxString& encoding)
         delete ctx.conv;
 #endif
 
-    return TRUE;
+    return ok;
 
 }