Module: wine Branch: master Commit: abe5dee0bb7f3854a6cb2519faf75facdd08fe6f URL: http://source.winehq.org/git/wine.git/?a=commit;h=abe5dee0bb7f3854a6cb2519fa...
Author: Nikolay Sivov bunglehead@gmail.com Date: Wed Jun 10 03:23:17 2009 +0400
comctl32/listview: Implement callback functionality for item indentation.
---
dlls/comctl32/listview.c | 21 +++++++++++++++++++-- dlls/comctl32/tests/listview.c | 2 +- 2 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index df07384..55519dd 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -6,6 +6,7 @@ * Copyright 2000 Jason Mawdsley * Copyright 2001 CodeWeavers Inc. * Copyright 2002 Dimitrie O. Paun + * Copyright 2009 Nikolay Sivov * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -5746,6 +5747,14 @@ static BOOL LISTVIEW_GetItemT(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, dispInfo.item.iImage = I_IMAGECALLBACK; }
+ /* Only items support indentation */ + if ((lpLVItem->mask & LVIF_INDENT) && lpItem->iIndent == I_INDENTCALLBACK && + (isubitem == 0)) + { + dispInfo.item.mask |= LVIF_INDENT; + dispInfo.item.iIndent = I_INDENTCALLBACK; + } + /* Apps depend on calling back for text if it is NULL or LPSTR_TEXTCALLBACKW */ if ((lpLVItem->mask & LVIF_TEXT) && !(lpLVItem->mask & LVIF_NORECOMPUTE) && !is_textW(pItemHdr->pszText)) @@ -5837,8 +5846,16 @@ static BOOL LISTVIEW_GetItemT(const LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, }
/* and last, but not least, the indent field */ - if (lpLVItem->mask & LVIF_INDENT) - lpLVItem->iIndent = lpItem->iIndent; + if (dispInfo.item.mask & LVIF_INDENT) + { + lpLVItem->iIndent = dispInfo.item.iIndent; + if ((dispInfo.item.mask & LVIF_DI_SETITEM) && lpItem->iIndent == I_INDENTCALLBACK) + lpItem->iIndent = dispInfo.item.iIndent; + } + else if (lpLVItem->mask & LVIF_INDENT) + { + lpLVItem->iIndent = lpItem->iIndent; + }
return TRUE; } diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index e7cbe03..2dce945 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -3304,7 +3304,7 @@ static void test_indentation(void) expect(TRUE, r);
ok_sequence(sequences, PARENT_SEQ_INDEX, single_getdispinfo_parent_seq, - "get indent dispinfo", TRUE); + "get indent dispinfo", FALSE);
DestroyWindow(hwnd); }