Author: hyperion
Date: Thu Oct 16 18:49:31 2008
New Revision: 36776
URL:
http://svn.reactos.org/svn/reactos?rev=36776&view=rev
Log:
The original GetTextFaceW implementation (r28730) was right all along, except GDI APIs
don't usually set the last error (GetTextFaceW doesn't). The conditional was
non-intuitive but nevertheless correct (tested under Windows Vista SP1). This commit
negates the conditional (the AND form is more readable) and switches the "if"
branches, and removes the call to SetLastError. If Coverity really flagged this, it could
mean the bug is actually in NtGdiGetTextFaceW
Modified:
trunk/reactos/dll/win32/gdi32/objects/text.c
Modified: trunk/reactos/dll/win32/gdi32/objects/text.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/te…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/objects/text.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdi32/objects/text.c [iso-8859-1] Thu Oct 16 18:49:31 2008
@@ -365,14 +365,13 @@
{
INT retValue;
- if (!pFaceName || (pFaceName && nCount))
+ if (pFaceName && !nCount)
+ {
+ retValue = 0;
+ }
+ else
{
retValue = NtGdiGetTextFaceW(hDC, nCount, pFaceName, 0);
- }
- else
- {
- SetLastError(ERROR_INVALID_PARAMETER);
- retValue = 0;
}
return retValue;