Commit c0ca077f authored by Gerard Patel's avatar Gerard Patel Committed by Alexandre Julliard

Misc fixes in LISTVIEW_SetImageList, LISTVIEW_SetItemCount,

LISTVIEW_UpdateSize.
parent 151023d1
...@@ -7077,6 +7077,7 @@ static LRESULT LISTVIEW_SetImageList(HWND hwnd, INT nType, HIMAGELIST himl) ...@@ -7077,6 +7077,7 @@ static LRESULT LISTVIEW_SetImageList(HWND hwnd, INT nType, HIMAGELIST himl)
{ {
LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0); LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0);
HIMAGELIST himlOld = 0; HIMAGELIST himlOld = 0;
INT oldHeight;
switch (nType) switch (nType)
{ {
...@@ -7097,7 +7098,10 @@ static LRESULT LISTVIEW_SetImageList(HWND hwnd, INT nType, HIMAGELIST himl) ...@@ -7097,7 +7098,10 @@ static LRESULT LISTVIEW_SetImageList(HWND hwnd, INT nType, HIMAGELIST himl)
break; break;
} }
oldHeight = infoPtr->nItemHeight;
infoPtr->nItemHeight = LISTVIEW_GetItemHeight(hwnd); infoPtr->nItemHeight = LISTVIEW_GetItemHeight(hwnd);
if (infoPtr->nItemHeight != oldHeight)
LISTVIEW_UpdateScroll(hwnd);
return (LRESULT)himlOld; return (LRESULT)himlOld;
} }
...@@ -7143,11 +7147,11 @@ static LRESULT LISTVIEW_SetItemA(HWND hwnd, LPLVITEMA lpLVItem) ...@@ -7143,11 +7147,11 @@ static LRESULT LISTVIEW_SetItemA(HWND hwnd, LPLVITEMA lpLVItem)
/*** /***
* DESCRIPTION: * DESCRIPTION:
* Preallocates memory. * Preallocates memory (does *not* set the actual count of items !)
* *
* PARAMETER(S): * PARAMETER(S):
* [I] HWND : window handle * [I] HWND : window handle
* [I] INT : item count (projected number of items) * [I] INT : item count (projected number of items to allocate)
* [I] DWORD : update flags * [I] DWORD : update flags
* *
* RETURN: * RETURN:
...@@ -7189,22 +7193,7 @@ static BOOL LISTVIEW_SetItemCount(HWND hwnd, INT nItems, DWORD dwFlags) ...@@ -7189,22 +7193,7 @@ static BOOL LISTVIEW_SetItemCount(HWND hwnd, INT nItems, DWORD dwFlags)
} }
else else
{ {
if (nItems == 0) FIXME("setitemcount not done for non-ownerdata\n");
return LISTVIEW_DeleteAllItems (hwnd);
if (nItems > GETITEMCOUNT(infoPtr))
{
/* append items */
FIXME("append items\n");
}
else if (nItems < GETITEMCOUNT(infoPtr))
{
/* remove items */
while(nItems < GETITEMCOUNT(infoPtr)) {
LISTVIEW_DeleteItem(hwnd, GETITEMCOUNT(infoPtr) - 1);
}
}
} }
return TRUE; return TRUE;
...@@ -8886,7 +8875,7 @@ static VOID LISTVIEW_UpdateSize(HWND hwnd) ...@@ -8886,7 +8875,7 @@ static VOID LISTVIEW_UpdateSize(HWND hwnd)
if (uView == LVS_LIST) if (uView == LVS_LIST)
{ {
if ((lStyle & WS_HSCROLL) == 0) if (lStyle & WS_HSCROLL)
{ {
INT nHScrollHeight = GetSystemMetrics(SM_CYHSCROLL); INT nHScrollHeight = GetSystemMetrics(SM_CYHSCROLL);
if (infoPtr->rcList.bottom > nHScrollHeight) if (infoPtr->rcList.bottom > nHScrollHeight)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment