mirror of
https://github.com/reactos/reactos.git
synced 2024-06-28 17:01:28 +00:00
[WIN32SS][NTGDI] Improve IntGetOutlineTextMetrics (#1760)
Improve size checking of IntGetOutlineTextMetrics function.
This commit is contained in:
parent
44cddadba8
commit
7547757892
|
@ -2304,22 +2304,30 @@ IntGetOutlineTextMetrics(PFONTGDI FontGDI,
|
|||
Cache = &SharedFace->UserLanguage;
|
||||
}
|
||||
|
||||
if (Cache->OutlineRequiredSize && Size < Cache->OutlineRequiredSize)
|
||||
if (Size == 0 && Cache->OutlineRequiredSize > 0)
|
||||
{
|
||||
ASSERT(Otm == NULL);
|
||||
return Cache->OutlineRequiredSize;
|
||||
}
|
||||
|
||||
IntInitFontNames(&FontNames, SharedFace);
|
||||
Cache->OutlineRequiredSize = FontNames.OtmSize;
|
||||
|
||||
if (!Cache->OutlineRequiredSize)
|
||||
if (Size == 0)
|
||||
{
|
||||
Cache->OutlineRequiredSize = FontNames.OtmSize;
|
||||
ASSERT(Otm == NULL);
|
||||
IntFreeFontNames(&FontNames);
|
||||
return Cache->OutlineRequiredSize;
|
||||
}
|
||||
|
||||
ASSERT(Otm != NULL);
|
||||
|
||||
if (Size < Cache->OutlineRequiredSize)
|
||||
{
|
||||
DPRINT1("Size %u < OutlineRequiredSize %u\n", Size,
|
||||
Cache->OutlineRequiredSize);
|
||||
IntFreeFontNames(&FontNames);
|
||||
return Cache->OutlineRequiredSize;
|
||||
return 0; /* failure */
|
||||
}
|
||||
|
||||
XScale = Face->size->metrics.x_scale;
|
||||
|
|
Loading…
Reference in a new issue