X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2646f485163f410baaad5bcf49028c604a352d19..c7c6e54baed01937426239dd38164ee0326fa172:/src/mac/classic/dataobj.cpp diff --git a/src/mac/classic/dataobj.cpp b/src/mac/classic/dataobj.cpp index 64dc8053d0..3575f7e745 100644 --- a/src/mac/classic/dataobj.cpp +++ b/src/mac/classic/dataobj.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: mac/dataobj.cpp +// Name: src/mac/classic/dataobj.cpp // Purpose: implementation of wxDataObject class // Author: Stefan Csomor // Modified by: @@ -9,6 +9,12 @@ // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ + #pragma hdrstop +#endif + // ============================================================================ // declarations // ============================================================================ @@ -17,22 +23,15 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ - #pragma implementation "dataobj.h" -#endif - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" +#include "wx/dataobj.h" #ifndef WX_PRECOMP -#include "wx/intl.h" + #include "wx/intl.h" + #include "wx/log.h" + #include "wx/image.h" #endif -#include "wx/defs.h" -#include "wx/log.h" -#include "wx/dataobj.h" #include "wx/mstream.h" -#include "wx/image.h" #include "wx/mac/private.h" #include @@ -170,11 +169,9 @@ bool wxDataObject::IsSupportedFormat( // wxFileDataObject // ---------------------------------------------------------------------------- -bool wxFileDataObject::GetDataHere( - void* pBuf -) const +bool wxFileDataObject::GetDataHere( void* pBuf ) const { - wxString sFilenames; + wxString sFilenames; for (size_t i = 0; i < m_filenames.GetCount(); i++) { @@ -182,8 +179,8 @@ bool wxFileDataObject::GetDataHere( sFilenames += (wxChar)0; } - memcpy(pBuf, sFilenames.mbc_str(), sFilenames.Len() + 1); - return TRUE; + memcpy(pBuf, sFilenames.mbc_str(), sFilenames.length() + 1); + return true; } size_t wxFileDataObject::GetDataSize() const @@ -192,7 +189,7 @@ size_t wxFileDataObject::GetDataSize() const for (size_t i = 0; i < m_filenames.GetCount(); i++) { - nRes += m_filenames[i].Len(); + nRes += m_filenames[i].length(); nRes += 1; } @@ -208,7 +205,7 @@ bool wxFileDataObject::SetData( AddFile(wxString::FromAscii((char*)pBuf)); - return TRUE; + return true; } void wxFileDataObject::AddFile( @@ -256,13 +253,13 @@ void wxBitmapDataObject::SetBitmap( } } -void wxBitmapDataObject::Init() -{ +void wxBitmapDataObject::Init() +{ m_pictHandle = NULL ; m_pictCreated = false ; -} +} -void wxBitmapDataObject::Clear() +void wxBitmapDataObject::Clear() { if ( m_pictCreated && m_pictHandle ) { @@ -271,17 +268,15 @@ void wxBitmapDataObject::Clear() m_pictHandle = NULL ; } -bool wxBitmapDataObject::GetDataHere( - void* pBuf -) const +bool wxBitmapDataObject::GetDataHere( void* pBuf ) const { if (!m_pictHandle) { wxFAIL_MSG(wxT("attempt to copy empty bitmap failed")); - return FALSE; + return false; } memcpy(pBuf, *(Handle)m_pictHandle, GetHandleSize((Handle)m_pictHandle)); - return TRUE; + return true; } size_t wxBitmapDataObject::GetDataSize() const @@ -300,7 +295,7 @@ bool wxBitmapDataObject::SetData( m_pictHandle = picHandle ; m_pictCreated = false ; Rect frame = (**picHandle).picFrame ; - + m_bitmap.SetPict( picHandle ) ; m_bitmap.SetWidth( frame.right - frame.left ) ; m_bitmap.SetHeight( frame.bottom - frame.top ) ;