mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 22:23:01 +00:00
[WIN32SS][NTGDI] Improve IntGetOutlineTextMetrics (#1760)
Improve size checking of IntGetOutlineTextMetrics function.
This commit is contained in:
parent
44cddadba8
commit
7547757892
1 changed files with 12 additions and 4 deletions
|
@ -2304,22 +2304,30 @@ IntGetOutlineTextMetrics(PFONTGDI FontGDI,
|
||||||
Cache = &SharedFace->UserLanguage;
|
Cache = &SharedFace->UserLanguage;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Cache->OutlineRequiredSize && Size < Cache->OutlineRequiredSize)
|
if (Size == 0 && Cache->OutlineRequiredSize > 0)
|
||||||
{
|
{
|
||||||
|
ASSERT(Otm == NULL);
|
||||||
return Cache->OutlineRequiredSize;
|
return Cache->OutlineRequiredSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
IntInitFontNames(&FontNames, SharedFace);
|
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)
|
if (Size < Cache->OutlineRequiredSize)
|
||||||
{
|
{
|
||||||
|
DPRINT1("Size %u < OutlineRequiredSize %u\n", Size,
|
||||||
|
Cache->OutlineRequiredSize);
|
||||||
IntFreeFontNames(&FontNames);
|
IntFreeFontNames(&FontNames);
|
||||||
return Cache->OutlineRequiredSize;
|
return 0; /* failure */
|
||||||
}
|
}
|
||||||
|
|
||||||
XScale = Face->size->metrics.x_scale;
|
XScale = Face->size->metrics.x_scale;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue