Igor Tarasov : comctl32: Fix statusbar text alignment bug.

Alexandre Julliard julliard at winehq.org
Wed May 14 06:43:43 CDT 2008


Module: wine
Branch: master
Commit: fb61856b4534f0b23c5e4d7a498527206cb8634f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=fb61856b4534f0b23c5e4d7a498527206cb8634f

Author: Igor Tarasov <tarasov.igor at gmail.com>
Date:   Wed May 14 05:50:20 2008 +0500

comctl32: Fix statusbar text alignment bug.

---

 dlls/comctl32/commctrl.c |   31 ++++++++++++++++++++-----------
 1 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/dlls/comctl32/commctrl.c b/dlls/comctl32/commctrl.c
index 554eb4d..4ff2075 100644
--- a/dlls/comctl32/commctrl.c
+++ b/dlls/comctl32/commctrl.c
@@ -535,18 +535,27 @@ 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;
-            if (*text == '\t') {
-	        text++;
-	        align = DT_RIGHT;
-	    }
-        }
-        r.left += 3;
+        int strCnt = 0;
+
         if (style & SBT_RTLREADING)
-	    FIXME("Unsupported RTL style!\n");
-        DrawTextW (hdc, text, -1, &r, align|DT_VCENTER|DT_SINGLELINE|DT_NOPREFIX);
+            FIXME("Unsupported RTL style!\n");
+        r.left += 3;
+        do {
+            if (*text == '\t') {
+                if (strCnt) {
+                    DrawTextW (hdc, text - strCnt, strCnt, &r, align|DT_VCENTER|DT_SINGLELINE|DT_NOPREFIX);
+                    strCnt = 0;
+                }
+                if (align==DT_RIGHT) {
+                    break;
+                }
+                align = (align==DT_LEFT ? DT_CENTER : DT_RIGHT);
+            } else {
+                strCnt++;
+            }
+        } while(*text++);
+
+        if (strCnt) DrawTextW (hdc, text - strCnt, -1, &r, align|DT_VCENTER|DT_SINGLELINE|DT_NOPREFIX);
 	SetBkMode(hdc, oldbkmode);
     }
 }




More information about the wine-cvs mailing list