[ros-dev] [ros-diffs] [jgardou] 64176: [GDI32] - Fix up values got from win32k in GetOutlineTextMetrics and do not fail if the provided buffersize is only sizeof(OUTLINETEXTMETRICW). CORE-8507 #resolve

Jérôme Gardou jerome.gardou at reactos.org
Wed Sep 17 21:09:52 UTC 2014


Le 17/09/2014 21:32, Timo Kreuzer a écrit :
> Am 17.09.2014 11:54, schrieb jgardou at svn.reactos.org:
>> Author: jgardou
>> Date: Wed Sep 17 09:54:14 2014
>> New Revision: 64176
>>
>> URL: http://svn.reactos.org/svn/reactos?rev=64176&view=rev
>> Log:
>> [GDI32]
>>   - Fix up values got from win32k in GetOutlineTextMetrics and do not fail if the provided buffersize is only sizeof(OUTLINETEXTMETRICW).
>> CORE-8507 #resolve
>>
>> Modified:
>>      trunk/reactos/win32ss/gdi/gdi32/objects/font.c
>>
>> Modified: trunk/reactos/win32ss/gdi/gdi32/objects/font.c
>> URL: http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/gdi32/objects/font.c?rev=64176&r1=64175&r2=64176&view=diff
>> ==============================================================================
>> --- trunk/reactos/win32ss/gdi/gdi32/objects/font.c	[iso-8859-1] (original)
>> +++ trunk/reactos/win32ss/gdi/gdi32/objects/font.c	[iso-8859-1] Wed Sep 17 09:54:14 2014
>> @@ -9,8 +9,19 @@
>>   
>>   #include <precomp.h>
>>   
>> +#include <math.h>
>> +
>>   #define NDEBUG
>>   #include <debug.h>
>> +
>> +/* Rounds a floating point number to integer. The world-to-viewport
>> + * transformation process is done in floating point internally. This function
>> + * is then used to round these coordinates to integer values.
>> + */
>> +static __inline INT GDI_ROUND(FLOAT val)
>> +{
>> +   return (int)floor(val + 0.5);
>> +}
> roundf() is the appropriate function here. The older MS crt headers
> don't have the *round*() functions, but VS 2013 headers seem to have
> them (according MSDN).
> I propose adding them inside some #ifdef, instead of reimplementing them
> in different places.
Hmm, why not, but we don't use msvcr120.dll.
>
> For the other functions: strange coding style. Is this taken from wine?
>
Yes, I thought I added the copyright notice, obviously forgot to do so.
> _______________________________________________
> Ros-dev mailing list
> Ros-dev at reactos.org
> http://www.reactos.org/mailman/listinfo/ros-dev




More information about the Ros-dev mailing list