# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1335803022 0 # Node ID 831aa3a679e6582177043b4e83d8760da43cfc99 # Parent 35c5314083a79abb8e2452ade1eb7253a7e5964c Gr... messed up tabs in the last commit. diff -r 35c5314083a7 -r 831aa3a679e6 os2/dw.c --- a/os2/dw.c Mon Apr 30 16:22:03 2012 +0000 +++ b/os2/dw.c Mon Apr 30 16:23:42 2012 +0000 @@ -2034,34 +2034,34 @@ { PFNWP myfunc = blah->oldproc; - switch(msg) - { - case WM_PAINT: - { - HPS hpsPaint; - RECTL rclPaint; - int len = WinQueryWindowTextLength(hWnd); - ULONG style = WinQueryWindowULong(hWnd, QWL_STYLE) & (DT_TOP|DT_VCENTER|DT_BOTTOM|DT_LEFT|DT_CENTER|DT_RIGHT|DT_WORDBREAK); - char *tempbuf = alloca(len + 2); - ULONG fcolor = DT_TEXTATTRS, bcolor = DT_TEXTATTRS; - - WinQueryWindowText(hWnd, len + 1, (PSZ)tempbuf); - - hpsPaint = WinBeginPaint(hWnd, 0, 0); - WinQueryWindowRect(hWnd, &rclPaint); - if(WinQueryPresParam(hWnd, PP_BACKGROUNDCOLOR, 0, NULL, sizeof(bcolor), &bcolor, QPF_NOINHERIT) || + switch(msg) + { + case WM_PAINT: + { + HPS hpsPaint; + RECTL rclPaint; + int len = WinQueryWindowTextLength(hWnd); + ULONG style = WinQueryWindowULong(hWnd, QWL_STYLE) & (DT_TOP|DT_VCENTER|DT_BOTTOM|DT_LEFT|DT_CENTER|DT_RIGHT|DT_WORDBREAK); + char *tempbuf = alloca(len + 2); + ULONG fcolor = DT_TEXTATTRS, bcolor = DT_TEXTATTRS; + + WinQueryWindowText(hWnd, len + 1, (PSZ)tempbuf); + + hpsPaint = WinBeginPaint(hWnd, 0, 0); + WinQueryWindowRect(hWnd, &rclPaint); + if(WinQueryPresParam(hWnd, PP_BACKGROUNDCOLOR, 0, NULL, sizeof(bcolor), &bcolor, QPF_NOINHERIT) || WinQueryPresParam(hWnd, PP_BACKGROUNDCOLORINDEX, 0, NULL, sizeof(bcolor), &bcolor, QPF_NOINHERIT)) - GpiSetBackColor(hpsPaint, bcolor); - if(WinQueryPresParam(hWnd, PP_FOREGROUNDCOLOR, 0, NULL, sizeof(fcolor), &fcolor, QPF_NOINHERIT) || - WinQueryPresParam(hWnd, PP_FOREGROUNDCOLORINDEX, 0, NULL, sizeof(fcolor), &fcolor, QPF_NOINHERIT)) - GpiSetColor(hpsPaint, fcolor); + GpiSetBackColor(hpsPaint, bcolor); + if(WinQueryPresParam(hWnd, PP_FOREGROUNDCOLOR, 0, NULL, sizeof(fcolor), &fcolor, QPF_NOINHERIT) || + WinQueryPresParam(hWnd, PP_FOREGROUNDCOLORINDEX, 0, NULL, sizeof(fcolor), &fcolor, QPF_NOINHERIT)) + GpiSetColor(hpsPaint, fcolor); WinDrawText(hpsPaint, -1, tempbuf, &rclPaint, DT_TEXTATTRS, DT_TEXTATTRS, style | DT_TEXTATTRS | DT_ERASERECT); - WinEndPaint(hpsPaint); - return (MRESULT)TRUE; - } - default: - return myfunc(hWnd, msg, mp1, mp2); - } + WinEndPaint(hpsPaint); + return (MRESULT)TRUE; + } + default: + return myfunc(hWnd, msg, mp1, mp2); + } } return WinDefWindowProc(hWnd, msg, mp1, mp2);