X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/655719367ac5e131d9642e5783f3ecf64d1a3385..2cf3a6d7bef6f20bea35062dd3d4dbf0aec9efb5:/src/mac/classic/dataobj.cpp diff --git a/src/mac/classic/dataobj.cpp b/src/mac/classic/dataobj.cpp index 64dc8053d0..3ba0b99de7 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,14 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ - #pragma implementation "dataobj.h" -#endif - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.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 +168,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 +178,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 +188,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 +204,7 @@ bool wxFileDataObject::SetData( AddFile(wxString::FromAscii((char*)pBuf)); - return TRUE; + return true; } void wxFileDataObject::AddFile( @@ -256,13 +252,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 +267,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 +294,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 ) ;