X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6dddc146fbea484558c02c18ea8250549329c70e..4fcd60c72f6b90f5063f7000ff5a80a9004055a3:/src/os2/dataobj.cpp?ds=sidebyside diff --git a/src/os2/dataobj.cpp b/src/os2/dataobj.cpp index 80c9b8479c..3763a035a1 100644 --- a/src/os2/dataobj.cpp +++ b/src/os2/dataobj.cpp @@ -31,6 +31,8 @@ #include "wx/log.h" #include "wx/dataobj.h" +#include "wx/mstream.h" +#include "wx/image.h" #define INCL_DOS #include @@ -47,11 +49,8 @@ // wxDataFormat // ---------------------------------------------------------------------------- -wxDataFormat::wxDataFormat( - wxDataFormatId vType -) +wxDataFormat::wxDataFormat() { - PrepareFormats(); m_vType = wxDF_INVALID; m_vFormat = 0; } @@ -184,7 +183,7 @@ bool wxDataObject::IsSupportedFormat( else { wxDataFormat* pFormats = new wxDataFormat[nFormatCount]; - GetAllFormats( rFormats + GetAllFormats( pFormats ,vDir ); @@ -192,11 +191,11 @@ bool wxDataObject::IsSupportedFormat( for (n = 0; n < nFormatCount; n++) { - if (rFormats[n] == rFormat) + if (pFormats[n] == rFormat) break; } - delete [] rFormats; + delete [] pFormats; // found? return n < nFormatCount; @@ -215,11 +214,11 @@ bool wxFileDataObject::GetDataHere( for (size_t i = 0; i < m_filenames.GetCount(); i++) { - filenames += m_filenames[i]; - filenames += (wxChar)0; + sFilenames += m_filenames[i]; + sFilenames += (wxChar)0; } - memcpy(pBuf, filenames.mbc_str(), filenames.Len() + 1); + memcpy(pBuf, sFilenames.mbc_str(), sFilenames.Len() + 1); return TRUE; } @@ -314,6 +313,7 @@ bool wxBitmapDataObject::SetData( memcpy(m_pngData, pBuf, m_pngSize); +#if wxUSE_STREAMS wxMemoryInputStream vMstream((char*)m_pngData, m_pngSize); wxImage vImage; wxPNGHandler vHandler; @@ -324,6 +324,8 @@ bool wxBitmapDataObject::SetData( } m_bitmap = vImage.ConvertToBitmap(); +#endif //wxUSE_STREAMS + return m_bitmap.Ok(); } @@ -332,16 +334,19 @@ void wxBitmapDataObject::DoConvertToPng() if (!m_bitmap.Ok()) return; +#if wxUSE_STREAMS wxImage vImage(m_bitmap); wxPNGHandler vHandler; wxCountingOutputStream vCount; - vHandler.SaveFile(&rImage, vCount); + vHandler.SaveFile(&vImage, vCount); m_pngSize = vCount.GetSize() + 100; // sometimes the size seems to vary ??? m_pngData = malloc(m_pngSize); - wxMemoryOutputStream mstream((char*) m_pngData, m_pngSize); + wxMemoryOutputStream vMstream((char*) m_pngData, m_pngSize); + vHandler.SaveFile(&vImage, vMstream ); +#endif }