TWPAttrCache doesn't seem to work anymore

  • I'm not sure if this is important, users haven't experienced any negative effects from it, but it seems flawed.

    When debugging i noticed the FCacheCount going very high. I've traced it back to the following code inside function TWPAttrCache.GetIndex(const CharAttr: TWPCharAttr): Integer;

    Code
    if (FCache[i].MaskHash = CmpHashCode) and        CompareMem(@(FCache[i].Values[1]), @(CharAttr.Values[1]), 16 * SizeOf(word)) then      begin

    In WpTools 5 this used to be:

    Code
    if (FCache[i].MaskHash and $FFFF) = (CmpHashCode and $FFFF) then

    The WP6 condition never seems to evaluate to true because FCache[i].MaskHash <> CmpHashCode
    I haven't looked further into why this fails.

    WpTools 6.13.1

    • Offizieller Beitrag

    Thank You,

    if (FCache[i].MaskHash and $FFFF = CmpHashCode and $FFFF) and
    CompareMem(@(FCache[i].Values[1]), @(CharAttr.Values[1]), 16 * SizeOf(word)) then

    is certainly correct - thanks for finding this problem.

    Julian