speed up for string conversion

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@20708 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2003-05-23 18:30:26 +00:00
parent 4e78ec2f5a
commit d5c45cc949
2 changed files with 56 additions and 12 deletions

View File

@@ -274,10 +274,21 @@ void wxMacConvertFromPC( const char *from , char *to , int len )
{
for( int i = 0 ; i < len ; ++ i )
{
c = strchr( StringANSI , *from ) ;
if ( c != NULL )
if ( *from & 0x80 )
{
*to = StringMac[ c - StringANSI] ;
c = strchr( StringANSI , *from ) ;
if ( c != NULL )
{
*to = StringMac[ c - StringANSI] ;
}
}
else if ( *from == 0x0a )
{
*to = 0x0d ;
}
else
{
*to = *from ;
}
++to ;
++from ;
@@ -287,10 +298,21 @@ void wxMacConvertFromPC( const char *from , char *to , int len )
{
for( int i = 0 ; i < len ; ++ i )
{
c = strchr( StringANSI , *from ) ;
if ( c != NULL )
if ( *from & 0x80 )
{
*to = StringMac[ c - StringANSI] ;
c = strchr( StringANSI , *from ) ;
if ( c != NULL )
{
*to = StringMac[ c - StringANSI] ;
}
else
{
*to = *from ;
}
}
else if ( *from == 0x0a )
{
*to = 0x0d ;
}
else
{

View File

@@ -274,10 +274,21 @@ void wxMacConvertFromPC( const char *from , char *to , int len )
{
for( int i = 0 ; i < len ; ++ i )
{
c = strchr( StringANSI , *from ) ;
if ( c != NULL )
if ( *from & 0x80 )
{
*to = StringMac[ c - StringANSI] ;
c = strchr( StringANSI , *from ) ;
if ( c != NULL )
{
*to = StringMac[ c - StringANSI] ;
}
}
else if ( *from == 0x0a )
{
*to = 0x0d ;
}
else
{
*to = *from ;
}
++to ;
++from ;
@@ -287,10 +298,21 @@ void wxMacConvertFromPC( const char *from , char *to , int len )
{
for( int i = 0 ; i < len ; ++ i )
{
c = strchr( StringANSI , *from ) ;
if ( c != NULL )
if ( *from & 0x80 )
{
*to = StringMac[ c - StringANSI] ;
c = strchr( StringANSI , *from ) ;
if ( c != NULL )
{
*to = StringMac[ c - StringANSI] ;
}
else
{
*to = *from ;
}
}
else if ( *from == 0x0a )
{
*to = 0x0d ;
}
else
{