X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/88a7a4e10ed18f81a576dcd866cfbf02bf404c00..6d7b547184bfdcdf67790755deb0122050b1d728:/src/xml/xml.cpp diff --git a/src/xml/xml.cpp b/src/xml/xml.cpp index cd33a3a68e..990d6aa81f 100644 --- a/src/xml/xml.cpp +++ b/src/xml/xml.cpp @@ -21,18 +21,18 @@ #ifndef WX_PRECOMP #include "wx/intl.h" + #include "wx/log.h" + #include "wx/app.h" #endif #include "wx/wfstream.h" #include "wx/datstrm.h" #include "wx/zstream.h" -#include "wx/log.h" #include "wx/strconv.h" #include "expat.h" // from Expat // DLL options compatibility check: -#include "wx/app.h" WX_CHECK_BUILD_OPTIONS("wxXML") @@ -348,12 +348,16 @@ void wxXmlDocument::DoCopy(const wxXmlDocument& doc) bool wxXmlDocument::Load(const wxString& filename, const wxString& encoding) { wxFileInputStream stream(filename); + if (!stream.Ok()) + return false; return Load(stream, encoding); } bool wxXmlDocument::Save(const wxString& filename) const { wxFileOutputStream stream(filename); + if (!stream.Ok()) + return false; return Save(stream); } @@ -385,7 +389,7 @@ static wxString CharToString(wxMBConv *conv, const wxWCharBuffer wbuf( wxConvUTF8.cMB2WC(s, len == wxSTRING_MAXLEN ? wxNO_LEN : len, NULL)); - return wxString(wbuf, conv); + return wxString(wbuf, *conv); } else // already in UTF-8, no conversion needed {