Fixup: Promote ints to ranges when appropriate

Pointed out by Akira Tagoh.
This commit is contained in:
Matthias Clasen 2020-08-22 02:35:24 -04:00
parent 148ebf98ed
commit 835f9bbdbe
1 changed files with 7 additions and 7 deletions

View File

@ -939,6 +939,13 @@ FcConfigPromote (FcValue v, FcValue u, FcValuePromotionBuffer *buf)
case FcTypeInteger:
v.type = FcTypeDouble;
v.u.d = (double) v.u.i;
/* Fallthrough */
case FcTypeDouble:
if (u.type == FcTypeRange && buf)
{
v.u.r = FcRangePromote (v.u.d, buf);
v.type = FcTypeRange;
}
break;
case FcTypeVoid:
if (u.type == FcTypeMatrix)
@ -964,13 +971,6 @@ FcConfigPromote (FcValue v, FcValue u, FcValuePromotionBuffer *buf)
v.type = FcTypeLangSet;
}
break;
case FcTypeDouble:
if (u.type == FcTypeRange && buf)
{
v.u.r = FcRangePromote (v.u.d, buf);
v.type = FcTypeRange;
}
break;
default:
break;
}