Peter Oberndorfer : msi: Do not use a static variable to save the insertion position for the listview .

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


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

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

msi: Do not use a static variable to save the insertion position for the listview.

---

 dlls/msi/dialog.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c
index 1c05d75..86f9e00 100644
--- a/dlls/msi/dialog.c
+++ b/dlls/msi/dialog.c
@@ -2064,6 +2064,7 @@ struct msi_listbox_info
     HWND hwnd;
     WNDPROC oldproc;
     DWORD num_items;
+    DWORD addpos_items;
     LPWSTR *items;
 };
 
@@ -2099,17 +2100,16 @@ 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 );
+    info->items[info->addpos_items] = strdupW( value );
 
     pos = SendMessageW( info->hwnd, LB_ADDSTRING, 0, (LPARAM)text );
-    SendMessageW( info->hwnd, LB_SETITEMDATA, pos, (LPARAM)info->items[index] );
-    index++;
+    SendMessageW( info->hwnd, LB_SETITEMDATA, pos, (LPARAM)info->items[info->addpos_items] );
+    info->addpos_items++;
     return ERROR_SUCCESS;
 }
 
@@ -2189,6 +2189,7 @@ static UINT msi_dialog_list_box( msi_dia
     info->dialog = dialog;
     info->hwnd = control->hwnd;
     info->items = NULL;
+    info->addpos_items = 0;
     info->oldproc = (WNDPROC)SetWindowLongPtrW( control->hwnd, GWLP_WNDPROC,
                                                 (LONG_PTR)MSIListBox_WndProc );
     SetPropW( control->hwnd, szButtonData, info );




More information about the wine-cvs mailing list