aboutsummaryrefslogtreecommitdiff
path: root/fontconfig/src/fcmatch.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-11-19 10:47:23 +0100
committermarha <marha@users.sourceforge.net>2012-11-19 10:47:23 +0100
commitb3e1e62c45f525cdd332073aaa34d8452cb23374 (patch)
tree221ee6420074033279921fadc971d30d63d6847b /fontconfig/src/fcmatch.c
parentb142593315b909b9e202f0f4585b96bf2e74b9db (diff)
downloadvcxsrv-b3e1e62c45f525cdd332073aaa34d8452cb23374.tar.gz
vcxsrv-b3e1e62c45f525cdd332073aaa34d8452cb23374.tar.bz2
vcxsrv-b3e1e62c45f525cdd332073aaa34d8452cb23374.zip
git update 19 nov 2012
fontconfig: c20ac78b01df3f0919352bba16b5b48b3b5d4d6d libxcb: 76a2166de9c80b35f987fdc3f3a228bafa0de94e mesa: ddb901fbf4489ffcd85d3320f23913eb1d4fbdfe pixman: 44dd746bb68625b2f6be77c3f80292b45defe9d7 xserver: 6a6c3afe71ac82a93d9fd0034dd5bbdcf0eae1ea xkeyboard-config: 709e05c069428236ca2567e784c9971eecc8ca50
Diffstat (limited to 'fontconfig/src/fcmatch.c')
-rw-r--r--fontconfig/src/fcmatch.c63
1 files changed, 45 insertions, 18 deletions
diff --git a/fontconfig/src/fcmatch.c b/fontconfig/src/fcmatch.c
index 623538bd3..970339201 100644
--- a/fontconfig/src/fcmatch.c
+++ b/fontconfig/src/fcmatch.c
@@ -432,7 +432,7 @@ FcFontRenderPrepare (FcConfig *config,
FcPattern *new;
int i;
FcPatternElt *fe, *pe, *fel, *pel;
- FcValue v, vl;
+ FcValue v;
FcResult result;
assert (pat != NULL);
@@ -440,7 +440,7 @@ FcFontRenderPrepare (FcConfig *config,
new = FcPatternCreate ();
if (!new)
- return 0;
+ return NULL;
for (i = 0; i < font->num; i++)
{
fe = &FcPatternElts(font)[i];
@@ -478,47 +478,74 @@ FcFontRenderPrepare (FcConfig *config,
FcPatternEltValues(fe), &v, NULL, NULL, &result))
{
FcPatternDestroy (new);
- return 0;
+ return NULL;
}
if (fel && pel)
{
int n = 1, j;
+ FcValueListPtr l1, l2, ln = NULL, ll = NULL;
match = FcObjectToMatcher (pel->object, FcTrue);
if (!FcCompareValueList (pel->object, match,
FcPatternEltValues (pel),
- FcPatternEltValues (fel), &vl, NULL, &n, &result))
+ FcPatternEltValues (fel), NULL, NULL, &n, &result))
{
FcPatternDestroy (new);
return NULL;
}
- else
- {
- FcValueListPtr l;
- for (j = 0, l = FcPatternEltValues (fe);
- j < n && l != NULL;
- j++, l = FcValueListNext (l));
- if (l)
- v = FcValueCanonicalize (&l->value);
+ for (j = 0, l1 = FcPatternEltValues (fe), l2 = FcPatternEltValues (fel);
+ l1 != NULL || l2 != NULL;
+ j++, l1 = l1 ? FcValueListNext (l1) : NULL, l2 = l2 ? FcValueListNext (l2) : NULL)
+ {
+ if (j == n)
+ {
+ if (l1)
+ ln = FcValueListPrepend (ln,
+ FcValueCanonicalize (&l1->value),
+ FcValueBindingStrong);
+ if (l2)
+ ll = FcValueListPrepend (ll,
+ FcValueCanonicalize (&l2->value),
+ FcValueBindingStrong);
+ }
else
- v = FcValueCanonicalize (&FcPatternEltValues (fe)->value);
+ {
+ if (l1)
+ ln = FcValueListAppend (ln,
+ FcValueCanonicalize (&l1->value),
+ FcValueBindingStrong);
+ if (l2)
+ ll = FcValueListAppend (ll,
+ FcValueCanonicalize (&l2->value),
+ FcValueBindingStrong);
+ }
}
+ FcPatternObjectListAdd (new, fe->object, ln, FcFalse);
+ FcPatternObjectListAdd (new, fel->object, ll, FcFalse);
+
+ continue;
}
else if (fel)
{
- vl = FcValueCanonicalize (&FcPatternEltValues (fel)->value);
+ FcValueListPtr l1, l2;
+
+ copy_lang:
+ l1 = FcValueListDuplicate (FcPatternEltValues (fe));
+ l2 = FcValueListDuplicate (FcPatternEltValues (fel));
+ FcPatternObjectListAdd (new, fe->object, l1, FcFalse);
+ FcPatternObjectListAdd (new, fel->object, l2, FcFalse);
+
+ continue;
}
}
else
{
- v = FcValueCanonicalize(&FcPatternEltValues (fe)->value);
if (fel)
- vl = FcValueCanonicalize (&FcPatternEltValues (fel)->value);
+ goto copy_lang;
+ v = FcValueCanonicalize(&FcPatternEltValues (fe)->value);
}
FcPatternObjectAdd (new, fe->object, v, FcFalse);
- if (fel)
- FcPatternObjectAdd (new, fel->object, vl, FcFalse);
}
for (i = 0; i < pat->num; i++)
{