From 91ccb3ec7bd16e9eb4f921de3dd031583294756b Mon Sep 17 00:00:00 2001 From: Igor Tarasov Date: Wed, 14 May 2008 05:50:20 +0500 Subject: [comctl32] Fix statusbar text alignment (bug #12693) --- dlls/comctl32/commctrl.c | 34 ++++++++++++++++++++++++---------- 1 files changed, 24 insertions(+), 10 deletions(-) diff --git a/dlls/comctl32/commctrl.c b/dlls/comctl32/commctrl.c index 554eb4d..c9eccd9 100644 --- a/dlls/comctl32/commctrl.c +++ b/dlls/comctl32/commctrl.c @@ -535,18 +535,32 @@ void WINAPI DrawStatusTextW (HDC hdc, LPCRECT lprc, LPCWSTR text, UINT style) if (text) { int oldbkmode = SetBkMode (hdc, TRANSPARENT); UINT align = DT_LEFT; - if (*text == '\t') { - text++; - align = DT_CENTER; + int strCnt = 0; + + if (style & SBT_RTLREADING) + FIXME("Unsupported RTL style!\n"); + r.left += 3; + do { if (*text == '\t') { - text++; - align = DT_RIGHT; - } + if (strCnt) { + text -= strCnt; + DrawTextW (hdc, text, strCnt, &r, align|DT_VCENTER|DT_SINGLELINE|DT_NOPREFIX); + text += strCnt; + strCnt = 0; + } + if (align==DT_RIGHT) { + break; + } + align = (align==DT_LEFT ? DT_CENTER : DT_RIGHT); + } else { + strCnt++; + } + } while(*text++); + + if (strCnt) { + text -= strCnt; + DrawTextW (hdc, text, -1, &r, align|DT_VCENTER|DT_SINGLELINE|DT_NOPREFIX); } - r.left += 3; - if (style & SBT_RTLREADING) - FIXME("Unsupported RTL style!\n"); - DrawTextW (hdc, text, -1, &r, align|DT_VCENTER|DT_SINGLELINE|DT_NOPREFIX); SetBkMode(hdc, oldbkmode); } } -- 1.5.4.3