Author: tkreuzer
Date: Wed Sep 12 18:17:10 2012
New Revision: 57286
URL:
http://svn.reactos.org/svn/reactos?rev=57286&view=rev
Log:
[GDI32]
Fix SetTextAlign:
- return GDI_ERROR (-1) not 0 on error
- properly handle LAYOUT_RTL
Modified:
trunk/reactos/win32ss/gdi/gdi32/objects/text.c
Modified: trunk/reactos/win32ss/gdi/gdi32/objects/text.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/objects/…
==============================================================================
--- trunk/reactos/win32ss/gdi/gdi32/objects/text.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/gdi32/objects/text.c [iso-8859-1] Wed Sep 12 18:17:10 2012
@@ -572,7 +572,7 @@
UINT fMode)
{
PDC_ATTR Dc_Attr;
- INT OldMode = 0;
+ INT OldMode;
#if 0
if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
{
@@ -593,17 +593,16 @@
}
}
#endif
- if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID)
&Dc_Attr)) return OldMode;
+ if (!GdiGetHandleUserData((HGDIOBJ) hdc, GDI_OBJECT_TYPE_DC, (PVOID)
&Dc_Attr)) return GDI_ERROR;
OldMode = Dc_Attr->lTextAlign;
Dc_Attr->lTextAlign = fMode; // Raw
if (Dc_Attr->dwLayout & LAYOUT_RTL)
{
- if(!(fMode & TA_CENTER)) fMode |= TA_RIGHT;
- }
- Dc_Attr->flTextAlign = fMode & (TA_BASELINE|TA_UPDATECP|TA_CENTER);
+ if ((fMode & TA_CENTER) != TA_CENTER) fMode ^= TA_RIGHT;
+ }
+ Dc_Attr->flTextAlign = fMode & TA_MASK;
return OldMode;
-
}