Changeset 164:19a760bfd55f

Show
Ignore:
Timestamp:
02/21/08 09:20:42 (10 months ago)
Author:
Frank Benoit <benoit@tionex.de>
branch:
default
Message:

Fix null termination in Combo. Thx torhu for finding this.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dwt/widgets/Combo.d

    r128 r164  
    188188    checkWidget (); 
    189189    if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 
    190     auto buffer = StrToTCHARs( string ); 
     190    auto buffer = StrToTCHARs( getCodePage(), string, true ); 
    191191    int result = OS.SendMessage (handle, OS.CB_ADDSTRING, 0, buffer.ptr ); 
    192192    if (result is OS.CB_ERR) error (DWT.ERROR_ITEM_NOT_ADDED); 
     
    225225        error (DWT.ERROR_INVALID_RANGE); 
    226226    } 
    227     auto buffer = StrToTCHARs( string ); 
     227    auto buffer = StrToTCHARs( getCodePage(), string, true ); 
    228228    int result = OS.SendMessage (handle, OS.CB_INSERTSTRING, index, buffer.ptr); 
    229229    if (result is OS.CB_ERRSPACE || result is OS.CB_ERR) { 
     
    23272327            } 
    23282328            if (msg is OS.WM_SETTEXT) { 
    2329                 TCHAR[] buffer = StrToTCHARs( newText ); 
     2329                TCHAR[] buffer = StrToTCHARs( getCodePage(), newText, true ); 
    23302330                auto hHeap = OS.GetProcessHeap (); 
    23312331                int byteCount = buffer.length * TCHAR.sizeof;