Changeset 88

Show
Ignore:
Timestamp:
12/31/05 09:50:21 (3 years ago)
Author:
Shawn Liu
Message:

Fixed some Text and String involved bugs.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/current/win32/import/dwt/internal/converter.d

    r82 r88  
    3232    static char[] StrToMBCS(char[] sc, uint codepage = 0) 
    3333    { 
     34        char[] ret = sc; 
    3435        try{ 
    3536            foreach (char c; sc){ 
     
    4748        }catch(Exception e){ 
    4849            // do nothing 
    49         } 
    50         return sc; 
     50            ret = ""; 
     51        } 
     52        return ret; 
    5153    } 
    5254     
     
    5961        }catch(Exception e){ 
    6062            // do nothing 
     63            ret = ""; 
    6164        } 
    6265 
     
    8790            ret = std.utf.toUTF16(sc); 
    8891        }catch(Exception e){ 
    89             // do nothing            
     92            // do nothing 
     93            ret = "";            
    9094        } 
    9195 
     
    105109            if(ws[--$] != '\0') 
    106110                ws ~= '\0'; 
    107         }catch(Exception e){ 
    108             // do nothing 
     111        }catch(Object e){ 
     112            // do nothing 
     113            // <Shawn Liu> Win32 API raise Access violate with null pointer, so make it not null but empty 
     114            ws = ""; 
    109115        } 
    110116        return ws; 
     
    139145        return WCHARzToStr(cast(wchar*)string, string.length); 
    140146    } 
     147     
    141148    static char[] WCHARzToStr(wchar* pString, int _length = -1) 
    142149    { 
  • trunk/current/win32/import/dwt/widgets/text.d

    r82 r88  
    15261526    TCHAR[] tc1 = Converter.StrToTCHARs(left); 
    15271527    TCHAR[] tc2 = Converter.StrToTCHARs(right);  
    1528     start = tc2.length; 
     1528    start = tc1.length; 
    15291529    end = tc2.length; 
    15301530