From 88c26b9c0121308f6801d92d2fd2901ef74e809c Mon Sep 17 00:00:00 2001 From: "Dimitrie O. Paun" Date: Mon, 21 Oct 2002 19:31:01 +0000 Subject: [PATCH] More docs compliant alignment handling for subitems. --- dlls/comctl32/listview.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 9680ecbd0e6..ebf29cac8c1 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -3385,11 +3385,12 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_INFO *infoPtr, HDC hdc, INT nItem, INT nS { COLUMN_INFO *lpColumnInfo = DPA_GetPtr(infoPtr->hdpaColumns, nSubItem); if (lpColumnInfo) - { - if (lpColumnInfo->fmt & LVCFMT_LEFT) uFormat |= DT_LEFT; - else if (lpColumnInfo->fmt & LVCFMT_RIGHT) uFormat |= DT_RIGHT; - else if (lpColumnInfo->fmt & LVCFMT_CENTER) uFormat |= DT_CENTER; - } + switch (lpColumnInfo->fmt & LVCFMT_JUSTIFYMASK) + { + case LVCFMT_RIGHT: uFormat |= DT_RIGHT; break; + case LVCFMT_CENTER: uFormat |= DT_CENTER; break; + default: uFormat |= DT_LEFT; + } } if (!(uFormat & (DT_RIGHT | DT_CENTER))) rcLabel.left += 2; DrawTextW(hdc, lvItem.pszText, -1, &rcLabel, uFormat);