Add the range support in blank element
This commit is contained in:
parent
51e352a1bd
commit
d975cdda78
27
src/fcxml.c
27
src/fcxml.c
|
@ -1093,29 +1093,36 @@ static void
|
|||
FcParseBlank (FcConfigParse *parse)
|
||||
{
|
||||
int n = FcVStackElements (parse);
|
||||
FcChar32 i;
|
||||
while (n-- > 0)
|
||||
{
|
||||
FcVStack *v = FcVStackFetch (parse, n);
|
||||
if (v->tag != FcVStackInteger)
|
||||
FcConfigMessage (parse, FcSevereError, "non-integer blank");
|
||||
else
|
||||
{
|
||||
if (!parse->config->blanks)
|
||||
{
|
||||
parse->config->blanks = FcBlanksCreate ();
|
||||
if (!parse->config->blanks)
|
||||
{
|
||||
FcConfigMessage (parse, FcSevereError, "out of memory");
|
||||
break;
|
||||
}
|
||||
goto bail;
|
||||
}
|
||||
switch (v->tag) {
|
||||
case FcVStackInteger:
|
||||
if (!FcBlanksAdd (parse->config->blanks, v->u.integer))
|
||||
goto bail;
|
||||
break;
|
||||
case FcVStackRange:
|
||||
for (i = v->u.range.begin; i <= v->u.range.end; i++)
|
||||
{
|
||||
FcConfigMessage (parse, FcSevereError, "out of memory");
|
||||
if (!FcBlanksAdd (parse->config->blanks, i))
|
||||
goto bail;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
FcConfigMessage (parse, FcSevereError, "invalid element in blank");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
bail:
|
||||
FcConfigMessage (parse, FcSevereError, "out of memory");
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in New Issue