typedef struct msi_font_tag
{
- struct msi_font_tag *next;
+ struct list entry;
HFONT hfont;
COLORREF color;
WCHAR name[1];
SIZE size;
HWND hwnd;
LPWSTR default_font;
- msi_font *font_list;
+ struct list fonts;
struct list controls;
HWND hWndFocus;
LPWSTR control_default;
name = MSI_RecordGetString( rec, 1 );
font = msi_alloc( sizeof *font + strlenW( name )*sizeof (WCHAR) );
strcpyW( font->name, name );
- font->next = dialog->font_list;
- dialog->font_list = font;
+ list_add_head( &dialog->fonts, &font->entry );
font->color = MSI_RecordGetInteger( rec, 4 );
static msi_font *msi_dialog_find_font( msi_dialog *dialog, LPCWSTR name )
{
- msi_font *font;
+ msi_font *font = NULL;
- for( font = dialog->font_list; font; font = font->next )
+ LIST_FOR_EACH_ENTRY( font, &dialog->fonts, msi_font, entry )
if( !strcmpW( font->name, name ) ) /* FIXME: case sensitive? */
break;
LIST_FOR_EACH_ENTRY( control, &dialog->controls, msi_control, entry )
{
- if ( !lstrcmpW( control->property, property ) && control->update )
+ if ( control->property && !strcmpW( control->property, property ) && control->update )
control->update( dialog, control );
}
}
ctrl = msi_dialog_find_control( dialog, control );
if (!ctrl)
return;
- if( !lstrcmpW(attribute, szText) )
+ if( !strcmpW( attribute, szText ) )
{
font_text = MSI_RecordGetString( rec , 1 );
font = msi_dialog_get_style( font_text, &text );
msi_free( font );
msi_dialog_check_messages( NULL );
}
- else if( !lstrcmpW(attribute, szProgress) )
+ else if( !strcmpW( attribute, szProgress ) )
{
DWORD func, val;
break;
}
}
- else if ( !lstrcmpW(attribute, szProperty) )
+ else if ( !strcmpW( attribute, szProperty ) )
{
MSIFEATURE *feature = msi_seltree_get_selected_feature( ctrl );
msi_dialog_set_property( dialog->package, ctrl->property, feature->Directory );
}
- else if ( !lstrcmpW(attribute, szSelectionPath) )
+ else if ( !strcmpW( attribute, szSelectionPath ) )
{
LPWSTR prop = msi_dialog_dup_property( dialog, ctrl->property, TRUE );
LPWSTR path;
for (j = 0; j < info->num_items; j++)
{
tmp = (LPWSTR) SendMessageW( control->hwnd, CB_GETITEMDATA, j, 0 );
- if (!lstrcmpW( value, tmp ))
+ if (!strcmpW( value, tmp ))
break;
}
font = msi_dialog_get_style( font_mask, &mask );
if( !mask )
{
- ERR("mask template is empty\n");
+ WARN("mask template is empty\n");
goto end;
}
return ERROR_FUNCTION_FAILED;
control->handler = msi_dialog_radiogroup_handler;
- if (!lstrcmpW(control->name, group->propval))
+ if (group->propval && !strcmpW( control->name, group->propval ))
SendMessageW(control->hwnd, BM_SETCHECK, BST_CHECKED, 0);
prop = MSI_RecordGetString( rec, 1 );
msi_seltree_update_feature_installstate( HWND hwnd, HTREEITEM hItem,
MSIPACKAGE *package, MSIFEATURE *feature, INSTALLSTATE state )
{
- msi_feature_set_state( package, feature, state );
+ feature->ActionRequest = state;
msi_seltree_sync_item_state( hwnd, feature, hItem );
- ACTION_UpdateComponentStates( package, feature->Feature );
+ ACTION_UpdateComponentStates( package, feature );
}
static void
LIST_FOR_EACH_ENTRY( feature, &package->features, MSIFEATURE, entry )
{
- if ( lstrcmpW( parent, feature->Feature_Parent ) )
+ if ( parent && feature->Feature_Parent && strcmpW( parent, feature->Feature_Parent ))
+ continue;
+ else if ( parent && !feature->Feature_Parent )
+ continue;
+ else if ( !parent && feature->Feature_Parent )
continue;
if ( !feature->Title )
ControlEvent_FireSubscribedEvent( dialog->package, szSelectionDescription, rec );
dir = MSI_RecordGetString( row, 7 );
- folder = get_loaded_folder( dialog->package, dir );
- if (!folder)
+ if (dir)
{
- r = ERROR_FUNCTION_FAILED;
- goto done;
+ folder = get_loaded_folder( dialog->package, dir );
+ if (!folder)
+ {
+ r = ERROR_FUNCTION_FAILED;
+ goto done;
+ }
+ MSI_RecordSetStringW( rec, 1, folder->ResolvedTarget );
}
+ else
+ MSI_RecordSetStringW( rec, 1, NULL );
- MSI_RecordSetStringW( rec, 1, folder->ResolvedTarget );
ControlEvent_FireSubscribedEvent( dialog->package, szSelectionPath, rec );
done:
if ( wfd.dwFileAttributes != FILE_ATTRIBUTE_DIRECTORY )
continue;
- if ( !lstrcmpW( wfd.cFileName, szDot ) || !lstrcmpW( wfd.cFileName, szDotDot ) )
+ if ( !strcmpW( wfd.cFileName, szDot ) || !strcmpW( wfd.cFileName, szDotDot ) )
continue;
item.mask = LVIF_TEXT;
begin += end - begin + 1;
/* empty braces or '0' hides the column */
- if ( !num[0] || !lstrcmpW( num, szZero ) )
+ if ( !num[0] || !strcmpW( num, szZero ) )
{
count++;
msi_free( num );
TRACE("%s control %s\n", debugstr_w(action), debugstr_w(name));
/* FIXME: case sensitive? */
- if(!lstrcmpW(action, szHide))
+ if (!strcmpW( action, szHide ))
ShowWindow(control->hwnd, SW_HIDE);
- else if(!strcmpW(action, szShow))
+ else if (!strcmpW( action, szShow ))
ShowWindow(control->hwnd, SW_SHOW);
- else if(!strcmpW(action, szDisable))
+ else if (!strcmpW( action, szDisable ))
EnableWindow(control->hwnd, FALSE);
- else if(!strcmpW(action, szEnable))
+ else if (!strcmpW( action, szEnable ))
EnableWindow(control->hwnd, TRUE);
- else if(!strcmpW(action, szDefault))
+ else if (!strcmpW( action, szDefault ))
SetFocus(control->hwnd);
else
FIXME("Unhandled action %s\n", debugstr_w(action));
dialog->event_handler = event_handler;
dialog->finished = 0;
list_init( &dialog->controls );
+ list_init( &dialog->fonts );
/* verify that the dialog exists */
rec = msi_get_dialog_record( dialog );
void msi_dialog_destroy( msi_dialog *dialog )
{
+ msi_font *font, *next;
+
if( uiThreadId != GetCurrentThreadId() )
{
SendMessageW( hMsiHiddenWindow, WM_MSI_DIALOG_DESTROY, 0, (LPARAM) dialog );
}
/* destroy the list of fonts */
- while( dialog->font_list )
+ LIST_FOR_EACH_ENTRY_SAFE( font, next, &dialog->fonts, msi_font, entry )
{
- msi_font *t = dialog->font_list;
- dialog->font_list = t->next;
- DeleteObject( t->hfont );
- msi_free( t );
+ list_remove( &font->entry );
+ DeleteObject( font->hfont );
+ msi_free( font );
}
msi_free( dialog->default_font );
'M','S','I','E','r','r','o','r','D','i','a','l','o','g','R','e','s','u','l','t',0
};
- if ( lstrcmpW( event, end_dialog ) )
+ if ( strcmpW( event, end_dialog ) )
return ERROR_SUCCESS;
- if ( !lstrcmpW( argument, error_abort ) || !lstrcmpW( argument, error_cancel ) ||
- !lstrcmpW( argument, error_no ) )
+ if ( !strcmpW( argument, error_abort ) || !strcmpW( argument, error_cancel ) ||
+ !strcmpW( argument, error_no ) )
{
msi_set_property( package->db, result_prop, error_abort );
}
if ( r != ERROR_SUCCESS)
r = ERROR_SUCCESS;
- if ( !lstrcmpW( result, error_abort ) )
+ if ( !strcmpW( result, error_abort ) )
r = ERROR_FUNCTION_FAILED;
done: