X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/04dbb6467be8f564f380bd9a1106fbdecbd26a98..68698f0308f5c46966b7de12b34f68ec23dd3ec8:/src/common/fs_mem.cpp diff --git a/src/common/fs_mem.cpp b/src/common/fs_mem.cpp index c3f05cc6f5..29c730164c 100644 --- a/src/common/fs_mem.cpp +++ b/src/common/fs_mem.cpp @@ -13,7 +13,7 @@ #include "wx/wxprec.h" -#ifdef __BORDLANDC__ +#ifdef __BORLANDC__ #pragma hdrstop #endif @@ -22,6 +22,7 @@ #ifndef WXPRECOMP #include "wx/intl.h" #include "wx/log.h" + #include "wx/hash.h" #endif #include "wx/filesys.h" @@ -37,7 +38,7 @@ class MemFSHashObj : public wxObject m_Data = new char[len]; memcpy(m_Data, data, len); m_Len = len; - m_Time = wxDateTime::Now(); + InitTime(); } MemFSHashObj(wxMemoryOutputStream& stream) @@ -45,7 +46,7 @@ class MemFSHashObj : public wxObject m_Len = stream.GetSize(); m_Data = new char[m_Len]; stream.CopyTo(m_Data, m_Len); - m_Time = wxDateTime::Now(); + InitTime(); } ~MemFSHashObj() @@ -55,7 +56,19 @@ class MemFSHashObj : public wxObject char *m_Data; size_t m_Len; +#if wxUSE_DATETIME wxDateTime m_Time; +#endif // wxUSE_DATETIME + + DECLARE_NO_COPY_CLASS(MemFSHashObj) + + private: + void InitTime() + { +#if wxUSE_DATETIME + m_Time = wxDateTime::Now(); +#endif // wxUSE_DATETIME + } }; @@ -69,7 +82,6 @@ wxHashTable *wxMemoryFSHandler::m_Hash = NULL; wxMemoryFSHandler::wxMemoryFSHandler() : wxFileSystemHandler() { - m_Hash = NULL; } @@ -104,8 +116,11 @@ wxFSFile* wxMemoryFSHandler::OpenFile(wxFileSystem& WXUNUSED(fs), const wxString else return new wxFSFile(new wxMemoryInputStream(obj -> m_Data, obj -> m_Len), location, GetMimeTypeFromExt(location), - GetAnchor(location), - obj -> m_Time); + GetAnchor(location) +#if wxUSE_DATETIME + , obj -> m_Time +#endif // wxUSE_DATETIME + ); } else return NULL; } @@ -173,7 +188,7 @@ bool wxMemoryFSHandler::CheckHash(const wxString& filename) /*static*/ void wxMemoryFSHandler::AddFile(const wxString& filename, const wxBitmap& bitmap, long type) { - wxImage img(bitmap); + wxImage img = bitmap.ConvertToImage(); AddFile(filename, img, type); }