From 79d2f76b8efa57602cf10c819e49c96d3c2073ca Mon Sep 17 00:00:00 2001 From: Peter Oberndorfer Date: Tue, 6 Feb 2007 20:01:03 +0100 Subject: [PATCH] msi: Only insert entries into listbox if property value matches. --- dlls/msi/dialog.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c index 739fcd5ffda..98777ac800b 100644 --- a/dlls/msi/dialog.c +++ b/dlls/msi/dialog.c @@ -2124,7 +2124,7 @@ static UINT msi_listbox_add_item( MSIRECORD *rec, LPVOID param ) 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( struct msi_listbox_info *info ) 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_dialog *dialog, MSIRECORD *rec ) 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_dialog *dialog, MSIRECORD *rec ) 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_dialog *dialog, MSIRECORD *rec ) (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; } -- 2.11.4.GIT