sync to wine head

Andrew Talbot <Andrew.Talbot@talbotville.com>
Exclude unused headers.
Mikoaj Zalewski <mikolaj@zalewski.pl>
autocomplete: Don't use sel uninitialized.

svn path=/trunk/; revision=29484
This commit is contained in:
Johannes Anderwald 2007-10-10 21:52:22 +00:00
parent 5bbed73d42
commit a0e410976f

View file

@ -39,7 +39,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#define COBJMACROS #define COBJMACROS
#include "wine/debug.h" #include "wine/debug.h"
@ -52,7 +51,6 @@
#include "objbase.h" #include "objbase.h"
#include "pidl.h" #include "pidl.h"
#include "shlguid.h"
#include "shlobj.h" #include "shlobj.h"
#include "shldisp.h" #include "shldisp.h"
#include "debughlp.h" #include "debughlp.h"
@ -625,7 +623,7 @@ static LRESULT APIENTRY ACLBoxSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam,
{ {
IAutoCompleteImpl *This = (IAutoCompleteImpl *)GetWindowLongPtrW(hwnd, GWLP_USERDATA); IAutoCompleteImpl *This = (IAutoCompleteImpl *)GetWindowLongPtrW(hwnd, GWLP_USERDATA);
WCHAR *msg; WCHAR *msg;
int sel = -1, len; int sel, len;
switch (uMsg) { switch (uMsg) {
case WM_MOUSEMOVE: case WM_MOUSEMOVE:
@ -633,9 +631,11 @@ static LRESULT APIENTRY ACLBoxSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam,
SendMessageW(hwnd, LB_SETCURSEL, (WPARAM)sel, (LPARAM)0); SendMessageW(hwnd, LB_SETCURSEL, (WPARAM)sel, (LPARAM)0);
break; break;
case WM_LBUTTONDOWN: case WM_LBUTTONDOWN:
len = SendMessageW(This->hwndListBox, LB_GETTEXTLEN, sel, (LPARAM)NULL); sel = SendMessageW(hwnd, LB_GETCURSEL, 0, 0);
if (sel < 0)
break;
len = SendMessageW(This->hwndListBox, LB_GETTEXTLEN, sel, 0);
msg = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (len+1)*sizeof(WCHAR)); msg = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (len+1)*sizeof(WCHAR));
sel = (INT)SendMessageW(hwnd, LB_GETCURSEL, 0, 0);
SendMessageW(hwnd, LB_GETTEXT, sel, (LPARAM)msg); SendMessageW(hwnd, LB_GETTEXT, sel, (LPARAM)msg);
SendMessageW(This->hwndEdit, WM_SETTEXT, 0, (LPARAM)msg); SendMessageW(This->hwndEdit, WM_SETTEXT, 0, (LPARAM)msg);
SendMessageW(This->hwndEdit, EM_SETSEL, 0, lstrlenW(msg)); SendMessageW(This->hwndEdit, EM_SETSEL, 0, lstrlenW(msg));