projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixing PPI bugs in printer dcs
[wxWidgets.git]
/
src
/
mac
/
carbon
/
dataobj.cpp
diff --git
a/src/mac/carbon/dataobj.cpp
b/src/mac/carbon/dataobj.cpp
index 5de37f5e061426fa6c3444a98ec276df962a3884..041084127d8304d951d9125e14c34d25aa982837 100644
(file)
--- a/
src/mac/carbon/dataobj.cpp
+++ b/
src/mac/carbon/dataobj.cpp
@@
-14,19
+14,19
@@
#if wxUSE_DATAOBJ
#if wxUSE_DATAOBJ
+#include "wx/dataobj.h"
+
#ifndef WX_PRECOMP
#ifndef WX_PRECOMP
-#include "wx/intl.h"
+ #include "wx/intl.h"
+ #include "wx/log.h"
+ #include "wx/dcmemory.h"
#endif
#endif
-#include "wx/log.h"
-#include "wx/dataobj.h"
-#include "wx/dcmemory.h"
#include "wx/mstream.h"
#include "wx/image.h"
#include "wx/metafile.h"
#include "wx/tokenzr.h"
#include "wx/mstream.h"
#include "wx/image.h"
#include "wx/metafile.h"
#include "wx/tokenzr.h"
-
#include "wx/mac/private.h"
#ifndef __DARWIN__
#include "wx/mac/private.h"
#ifndef __DARWIN__
@@
-130,7
+130,7
@@
void wxDataFormat::SetId( NativeFormat format )
default:
m_type = wxDF_PRIVATE;
char text[5];
default:
m_type = wxDF_PRIVATE;
char text[5];
-
strncpy( text, (
char*)&format, 4 );
+
memcpy( text, (const
char*)&format, 4 );
text[4] = 0;
m_id = wxString::FromAscii( text );
break;
text[4] = 0;
m_id = wxString::FromAscii( text );
break;
@@
-171,14
+171,14
@@
bool wxDataObject::IsSupportedFormat( const wxDataFormat& rFormat, Direction vDi
}
else
{
}
else
{
- wxDataFormat
*
pFormats = new wxDataFormat[nFormatCount];
+ wxDataFormat
*
pFormats = new wxDataFormat[nFormatCount];
GetAllFormats( pFormats, vDir );
for (size_t n = 0; n < nFormatCount; n++)
{
if (pFormats[n] == rFormat)
{
GetAllFormats( pFormats, vDir );
for (size_t n = 0; n < nFormatCount; n++)
{
if (pFormats[n] == rFormat)
{
- found = true;
+
found = true;
break;
}
}
break;
}
}
@@
-205,16
+205,16
@@
void wxTextDataObject::GetAllFormats( wxDataFormat *formats, wxDataObjectBase::D
// wxFileDataObject
// ----------------------------------------------------------------------------
// wxFileDataObject
// ----------------------------------------------------------------------------
-void wxFileDataObject::GetFileNames(
wxCharBuffer &buf
) const
+void wxFileDataObject::GetFileNames(
wxCharBuffer &buf
) const
{
wxString filenames;
{
wxString filenames;
-
+
for (size_t i = 0; i < m_filenames.GetCount(); i++)
{
filenames += m_filenames[i];
filenames += wxT('\n');
}
for (size_t i = 0; i < m_filenames.GetCount(); i++)
{
filenames += m_filenames[i];
filenames += wxT('\n');
}
-
+
buf = filenames.fn_str();
}
buf = filenames.fn_str();
}
@@
-224,9
+224,11
@@
bool wxFileDataObject::GetDataHere( void *pBuf ) const
return false;
wxCharBuffer buf;
return false;
wxCharBuffer buf;
-
GetFileNames( buf )
;
+
size_t buffLength
;
- memcpy( pBuf, (const char*) buf, strlen(buf) + 1 );
+ GetFileNames( buf );
+ buffLength = strlen( buf );
+ memcpy( pBuf, (const char*)buf, buffLength + 1 );
return true;
}
return true;
}
@@
-234,22
+236,26
@@
bool wxFileDataObject::GetDataHere( void *pBuf ) const
size_t wxFileDataObject::GetDataSize() const
{
wxCharBuffer buf;
size_t wxFileDataObject::GetDataSize() const
{
wxCharBuffer buf;
+ size_t buffLength;
+
GetFileNames( buf );
GetFileNames( buf );
+ buffLength = strlen( buf );
- return
strlen(buf)
+ 1;
+ return
buffLength
+ 1;
}
bool wxFileDataObject::SetData( size_t nSize, const void *pBuf )
{
wxString filenames;
}
bool wxFileDataObject::SetData( size_t nSize, const void *pBuf )
{
wxString filenames;
+
#if wxUSE_UNICODE
#if wxUSE_UNICODE
- filenames = wxString( (const char*)
pBuf
, *wxConvFileName );
+ filenames = wxString( (const char*)
pBuf
, *wxConvFileName );
#else
#else
- filenames = wxString( wxConvFileName->cMB2WX(
pBuf )
, wxConvLocal );
+ filenames = wxString( wxConvFileName->cMB2WX(
(const char*)pBuf )
, wxConvLocal );
#endif
#endif
- m_filenames = wxStringTokenize( filenames
, wxT("\n")
, wxTOKEN_STRTOK );
-
+ m_filenames = wxStringTokenize( filenames
, wxT("\n")
, wxTOKEN_STRTOK );
+
return true;
}
return true;
}