mirror of
https://github.com/reactos/reactos.git
synced 2025-06-29 04:59:43 +00:00
[GDI32] Improve IntFontFamilyListUnique function (#1491)
Make gdi32!IntFontFamilyListUnique function std::unique compatible. Previous code didn't set the first entry correctly. CORE-15785
This commit is contained in:
parent
672ac75033
commit
ae80eb824e
1 changed files with 7 additions and 6 deletions
|
@ -264,18 +264,19 @@ IntFontFamilyListUnique(FONTFAMILYINFO *InfoList, INT nCount,
|
||||||
if ((dwFlags & IEFF_EXTENDED) && plf->lfCharSet == DEFAULT_CHARSET)
|
if ((dwFlags & IEFF_EXTENDED) && plf->lfCharSet == DEFAULT_CHARSET)
|
||||||
dwCompareFlags |= IFFCX_CHARSET;
|
dwCompareFlags |= IFFCX_CHARSET;
|
||||||
|
|
||||||
|
first = InfoList;
|
||||||
|
last = &InfoList[nCount];
|
||||||
|
|
||||||
// std::unique(first, last, IntFontFamilyCompareEx);
|
// std::unique(first, last, IntFontFamilyCompareEx);
|
||||||
if (nCount == 0)
|
if (first == last)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
result = first = InfoList;
|
result = first;
|
||||||
last = &InfoList[nCount];
|
|
||||||
while (++first != last)
|
while (++first != last)
|
||||||
{
|
{
|
||||||
if (IntFontFamilyCompareEx(result, first, dwCompareFlags) != 0 &&
|
if (IntFontFamilyCompareEx(result, first, dwCompareFlags) != 0)
|
||||||
++result != first)
|
|
||||||
{
|
{
|
||||||
*result = *first;
|
*(++result) = *first;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nCount = (int)(++result - InfoList);
|
nCount = (int)(++result - InfoList);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue