X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9e29cd0a2896d37d609bfa92216041589b26c931..48a2e193ec60bca94903706a7fd7528e9311037e:/src/xrc/xmlres.cpp?ds=sidebyside diff --git a/src/xrc/xmlres.cpp b/src/xrc/xmlres.cpp index c2aa6a5586..5aeacc477b 100644 --- a/src/xrc/xmlres.cpp +++ b/src/xrc/xmlres.cpp @@ -29,6 +29,7 @@ #include "wx/bitmap.h" #include "wx/image.h" #include "wx/module.h" + #include "wx/wxcrtvararg.h" #endif #ifndef __WXWINCE__ @@ -69,35 +70,25 @@ wxXmlResource::wxXmlResource(int flags, const wxString& domain) { m_flags = flags; m_version = -1; - m_domain = NULL; - if (! domain.empty() ) - SetDomain(domain); + SetDomain(domain); } wxXmlResource::wxXmlResource(const wxString& filemask, int flags, const wxString& domain) { m_flags = flags; m_version = -1; - m_domain = NULL; - if (! domain.empty() ) - SetDomain(domain); + SetDomain(domain); Load(filemask); } wxXmlResource::~wxXmlResource() { - if (m_domain) - free(m_domain); ClearHandlers(); } -void wxXmlResource::SetDomain(const wxChar* domain) +void wxXmlResource::SetDomain(const wxString& domain) { - if (m_domain) - free(m_domain); - m_domain = NULL; - if (domain && wxStrlen(domain)) - m_domain = wxStrdup(domain); + m_domain = domain; } @@ -1116,7 +1107,7 @@ wxBitmap wxXmlResourceHandler::GetBitmap(const wxString& param, wxString name = GetParamValue(param); if (name.empty()) return wxNullBitmap; #if wxUSE_FILESYSTEM - wxFSFile *fsfile = GetCurFileSystem().OpenFile(name); + wxFSFile *fsfile = GetCurFileSystem().OpenFile(name, wxFS_READ | wxFS_SEEKABLE); if (fsfile == NULL) { wxLogError(_("XRC resource: Cannot create bitmap from '%s'."), @@ -1148,7 +1139,7 @@ wxAnimation wxXmlResourceHandler::GetAnimation(const wxString& param) wxString name = GetParamValue(param); if (name.empty()) return wxNullAnimation; #if wxUSE_FILESYSTEM - wxFSFile *fsfile = GetCurFileSystem().OpenFile(name); + wxFSFile *fsfile = GetCurFileSystem().OpenFile(name, wxFS_READ | wxFS_SEEKABLE); if (fsfile == NULL) { wxLogError(_("XRC resource: Cannot create animation from '%s'."),