Peter Oberndorfer : msi: Store value of the property with each listbox element.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Feb 6 15:23:14 CST 2007


Module: wine
Branch: master
Commit: 9afb0f39a84832d39faeca46bc81994ffd266849
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9afb0f39a84832d39faeca46bc81994ffd266849

Author: Peter Oberndorfer <kumbayo84 at arcor.de>
Date:   Tue Feb  6 20:01:08 2007 +0100

msi: Store value of the property with each listbox element.

This makes sure the property is set to the right value even when order in listbox is changed.

---

 dlls/msi/dialog.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c
index f144427..1c05d75 100644
--- a/dlls/msi/dialog.c
+++ b/dlls/msi/dialog.c
@@ -2100,13 +2100,15 @@ static UINT msi_listbox_add_item( MSIREC
     struct msi_listbox_info *info = param;
     LPCWSTR value, text;
     static int index = 0;
+    int pos;
 
     value = MSI_RecordGetString( rec, 3 );
     text = MSI_RecordGetString( rec, 4 );
 
     info->items[index] = strdupW( value );
 
-    SendMessageW( info->hwnd, LB_ADDSTRING, 0, (LPARAM)text );
+    pos = SendMessageW( info->hwnd, LB_ADDSTRING, 0, (LPARAM)text );
+    SendMessageW( info->hwnd, LB_SETITEMDATA, pos, (LPARAM)info->items[index] );
     index++;
     return ERROR_SUCCESS;
 }
@@ -2146,15 +2148,17 @@ static UINT msi_dialog_listbox_handler(
 {
     struct msi_listbox_info *info;
     int index;
+    LPCWSTR value;
 
     if( HIWORD(param) != LBN_SELCHANGE )
         return ERROR_SUCCESS;
 
     info = GetPropW( control->hwnd, szButtonData );
     index = SendMessageW( control->hwnd, LB_GETCURSEL, 0, 0 );
+    value = (LPCWSTR) SendMessageW( control->hwnd, LB_GETITEMDATA, index, 0 );
 
     MSI_SetPropertyW( info->dialog->package,
-                      control->property, info->items[index] );
+                      control->property, value );
     msi_dialog_evaluate_control_conditions( info->dialog );
 
     return ERROR_SUCCESS;




More information about the wine-cvs mailing list