Peter Oberndorfer : msi: Only insert entries into listbox if property value matches.

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


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

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

msi: Only insert entries into listbox if property value matches.

---

 dlls/msi/dialog.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c
index 739fcd5..98777ac 100644
--- a/dlls/msi/dialog.c
+++ b/dlls/msi/dialog.c
@@ -2124,7 +2124,7 @@ static UINT msi_listbox_add_item( MSIREC
     return ERROR_SUCCESS;
 }
 
-static UINT msi_listbox_add_items( struct msi_listbox_info *info )
+static UINT msi_listbox_add_items( struct msi_listbox_info *info, LPCWSTR property )
 {
     UINT r;
     MSIQUERY *view = NULL;
@@ -2133,10 +2133,12 @@ static UINT msi_listbox_add_items( struc
     static const WCHAR query[] = {
         'S','E','L','E','C','T',' ','*',' ',
         'F','R','O','M',' ','`','L','i','s','t','B','o','x','`',' ',
+        'W','H','E','R','E',' ',
+        '`','P','r','o','p','e','r','t','y','`',' ','=',' ','\'','%','s','\'',' ',
         'O','R','D','E','R',' ','B','Y',' ','`','O','r','d','e','r','`',0
     };
 
-    r = MSI_OpenQuery( info->dialog->package->db, &view, query );
+    r = MSI_OpenQuery( info->dialog->package->db, &view, query, property );
     if ( r != ERROR_SUCCESS )
         return r;
 
@@ -2176,6 +2178,7 @@ static UINT msi_dialog_list_box( msi_dia
     struct msi_listbox_info *info;
     msi_control *control;
     DWORD style;
+    LPCWSTR prop;
 
     info = msi_alloc( sizeof *info );
     if (!info)
@@ -2188,6 +2191,9 @@ static UINT msi_dialog_list_box( msi_dia
 
     control->handler = msi_dialog_listbox_handler;
 
+    prop = MSI_RecordGetString( rec, 9 );
+    control->property = msi_dialog_dup_property( dialog, prop, FALSE );
+
     /* subclass */
     info->dialog = dialog;
     info->hwnd = control->hwnd;
@@ -2196,7 +2202,8 @@ static UINT msi_dialog_list_box( msi_dia
                                                 (LONG_PTR)MSIListBox_WndProc );
     SetPropW( control->hwnd, szButtonData, info );
 
-    msi_listbox_add_items( info );
+    if ( control->property )
+        msi_listbox_add_items( info, control->property );
 
     return ERROR_SUCCESS;
 }




More information about the wine-cvs mailing list