adaptions for cleaned up string conversions

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19009 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2003-01-29 15:03:43 +00:00
parent 4c200e8d87
commit 95fd868c8f
4 changed files with 16 additions and 24 deletions

View File

@@ -44,7 +44,8 @@ void *wxGetClipboardData(wxDataFormat dataFormat, long *len)
#else
OSStatus err = noErr ;
#endif
void * data = NULL ;
void * data = NULL ;
Size byteCount;
switch (dataFormat.GetType())
{
@@ -68,7 +69,6 @@ void *wxGetClipboardData(wxDataFormat dataFormat, long *len)
if ( err != noTypeErr && err != memFullErr )
{
ScrapFlavorFlags flavorFlags;
Size byteCount;
if (( err = GetScrapFlavorFlags( scrapRef, dataFormat.GetFormatId(), &flavorFlags )) == noErr)
{
@@ -101,7 +101,7 @@ void *wxGetClipboardData(wxDataFormat dataFormat, long *len)
HUnlock( datahandle ) ;
if ( GetHandleSize( datahandle ) > 0 )
{
long byteCount = GetHandleSize( datahandle ) ;
byteCount = GetHandleSize( datahandle ) ;
if ( dataFormat.GetType() == wxDF_TEXT )
data = new char[ byteCount + 1] ;
else
@@ -110,7 +110,7 @@ void *wxGetClipboardData(wxDataFormat dataFormat, long *len)
memcpy( (char*) data , (char*) *datahandle , byteCount ) ;
if ( dataFormat.GetType() == wxDF_TEXT )
((char*)data)[byteCount] = 0 ;
* len = byteCount ;
*len = byteCount ;
}
DisposeHandle( datahandle ) ;
#endif
@@ -122,7 +122,7 @@ void *wxGetClipboardData(wxDataFormat dataFormat, long *len)
}
if ( dataFormat.GetType() == wxDF_TEXT && wxApp::s_macDefaultEncodingIsPC )
{
wxMacConvertToPC((char*)data) ;
wxMacConvertToPC((char*)data,(char*)data,byteCount) ;
}
return data;
}