X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/353249a8e770396f926f85871db22668b52baf13..c84ef5b9f71ea2a62daa6d70840a8d654fc0103d:/src/common/fs_mem.cpp?ds=sidebyside diff --git a/src/common/fs_mem.cpp b/src/common/fs_mem.cpp index 3ad28089e6..5f96257100 100644 --- a/src/common/fs_mem.cpp +++ b/src/common/fs_mem.cpp @@ -186,13 +186,9 @@ void wxMemoryFSHandlerBase::AddFileWithMimeType(const wxString& filename, const wxString& textdata, const wxString& mimetype) { - AddFileWithMimeType - ( - filename, - static_cast(textdata.To8BitData()), - wxStrlen(static_cast(textdata.To8BitData())), - mimetype - ); + const wxCharBuffer buf(textdata.To8BitData()); + + AddFileWithMimeType(filename, buf.data(), buf.length(), mimetype); } @@ -253,7 +249,7 @@ wxMemoryFSHandler::AddFile(const wxString& filename, return; wxMemoryOutputStream mems; - if ( image.Ok() && image.SaveFile(mems, type) ) + if ( image.IsOk() && image.SaveFile(mems, type) ) { m_Hash[filename] = new wxMemoryFSFile (