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:
@@ -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;
|
||||
}
|
||||
|
@@ -105,7 +105,7 @@ void wxFontEnumeratorHelper::DoEnumerate()
|
||||
{
|
||||
MenuHandle menu ;
|
||||
Str255 p_name ;
|
||||
char c_name[256] ;
|
||||
|
||||
short lines ;
|
||||
|
||||
menu = NewMenu( 32000 , "\pFont" ) ;
|
||||
@@ -115,12 +115,8 @@ void wxFontEnumeratorHelper::DoEnumerate()
|
||||
for ( int i = 1 ; i < lines+1 ; i ++ )
|
||||
{
|
||||
GetMenuItemText( menu , i , p_name ) ;
|
||||
#if TARGET_CARBON
|
||||
p2cstrcpy( c_name, p_name ) ;
|
||||
#else
|
||||
p2cstr( p_name ) ;
|
||||
strcpy( c_name, (char *)p_name ) ;
|
||||
#endif
|
||||
wxString c_name = wxMacMakeStringFromPascal(p_name) ;
|
||||
|
||||
/*
|
||||
|
||||
if ( m_fixedOnly )
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -105,7 +105,7 @@ void wxFontEnumeratorHelper::DoEnumerate()
|
||||
{
|
||||
MenuHandle menu ;
|
||||
Str255 p_name ;
|
||||
char c_name[256] ;
|
||||
|
||||
short lines ;
|
||||
|
||||
menu = NewMenu( 32000 , "\pFont" ) ;
|
||||
@@ -115,12 +115,8 @@ void wxFontEnumeratorHelper::DoEnumerate()
|
||||
for ( int i = 1 ; i < lines+1 ; i ++ )
|
||||
{
|
||||
GetMenuItemText( menu , i , p_name ) ;
|
||||
#if TARGET_CARBON
|
||||
p2cstrcpy( c_name, p_name ) ;
|
||||
#else
|
||||
p2cstr( p_name ) ;
|
||||
strcpy( c_name, (char *)p_name ) ;
|
||||
#endif
|
||||
wxString c_name = wxMacMakeStringFromPascal(p_name) ;
|
||||
|
||||
/*
|
||||
|
||||
if ( m_fixedOnly )
|
||||
|
Reference in New Issue
Block a user