James Hawkins : msi: Use the respective update functions when creating the Browse dialog control .

Alexandre Julliard julliard at wine.codeweavers.com
Tue Aug 29 07:19:32 CDT 2006


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

Author: James Hawkins <truiken at gmail.com>
Date:   Mon Aug 28 17:55:10 2006 -0700

msi: Use the respective update functions when creating the Browse dialog control.

---

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

diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c
index 0e19cf0..db1e9f5 100644
--- a/dlls/msi/dialog.c
+++ b/dlls/msi/dialog.c
@@ -1434,6 +1434,7 @@ static void msi_dialog_update_pathedit( 
 
     path = msi_dup_property( dialog->package, prop );
     SetWindowTextW( control->hwnd, path );
+    SendMessageW( control->hwnd, EM_SETSEL, 0, -1 );
 
     msi_free( path );
     msi_free( prop );
@@ -1443,7 +1444,6 @@ static UINT msi_dialog_pathedit_control(
 {
     msi_control *control;
     LPCWSTR prop;
-    LPWSTR val, indirect = NULL;
 
     control = msi_dialog_add_control( dialog, rec, szEdit,
                                       WS_BORDER | WS_TABSTOP );
@@ -1454,19 +1454,7 @@ static UINT msi_dialog_pathedit_control(
     if ( prop )
         control->property = strdupW( prop );
 
-    if ( control->attributes & msidbControlAttributesIndirect )
-    {
-        indirect = msi_dup_property( dialog->package, control->property );
-        prop = indirect;
-    }
-
-    val = msi_dup_property( dialog->package, prop );
-    SetWindowTextW( control->hwnd, val );
-
-    SendMessageW( control->hwnd, EM_SETSEL, 0, -1 );
-
-    msi_free( val );
-    msi_free( indirect );
+    msi_dialog_update_pathedit( dialog );
 
     return ERROR_SUCCESS;
 }
@@ -2003,8 +1991,6 @@ static void msi_dialog_update_directory_
 static UINT msi_dialog_directory_combo( msi_dialog *dialog, MSIRECORD *rec )
 {
     msi_control *control;
-    LPWSTR path, propval;
-    BOOL indirect;
     LPCWSTR prop;
     DWORD style;
 
@@ -2019,19 +2005,8 @@ static UINT msi_dialog_directory_combo( 
     prop = MSI_RecordGetString( rec, 9 );
     control->property = msi_dialog_dup_property( dialog, prop, FALSE );
 
-    indirect = control->attributes & msidbControlAttributesIndirect;
-    propval = msi_dialog_dup_property( dialog, prop, indirect );
-    path = msi_dup_property( dialog->package, propval );
-
-    PathStripPathW( path );
-    PathRemoveBackslashW( path );
-
-    /* FIXME: Add whole directory structure to combo box */
-    SendMessageW( control->hwnd, CB_ADDSTRING, 0, (LPARAM)path );
-    SendMessageW( control->hwnd, CB_SETCURSEL, 0, 0 );
+    msi_dialog_update_directory_combo( dialog );
 
-    msi_free( path );
-    msi_free( propval );
     return ERROR_SUCCESS;
 }
 




More information about the wine-cvs mailing list