Add two edit mode, "delete" and "delete_all".
what values are being deleted depends on <test> as documented.
if the target object is same to what is tested, matching value there
will be deleted. otherwise all of values in the object will be deleted.
so this would means both edit mode will not take any expressions.
e.g.
Given that the testing is always true here, the following rules:
<match>
<test name="foo" compare="eq">
<string>bar</string>
</test>
<edit name="foo" mode="delete"/>
</match>
will removes "bar" string from "foo" object. and:
<match>
<test name="foo" compare="eq">
<string>foo</string>
</test>
<edit name="bar" mode="delete"/>
</match>
will removes all of values in "bar" object.
"prepend_first" Insert at head of list Insert at head of list
"append" Append after matching Append at end of list
"append_last" Append at end of list Append at end of list
+ "delete" Delete matching value Delete all values
+ "delete_all" Delete all values Delete all values
</programlisting>
</para></refsect2>
<refsect2><title><literal><int></literal>, <literal><double></literal>, <literal><string></literal>, <literal><bool></literal></title><para>
<!ELEMENT edit (%expr;)*>
<!ATTLIST edit
name CDATA #REQUIRED
- mode (assign|assign_replace|prepend|append|prepend_first|append_last) "assign"
+ mode (assign|assign_replace|prepend|append|prepend_first|append_last|delete|delete_all) "assign"
binding (weak|strong|same) "weak">
<!--
case FcOpAppendLast:
FcConfigPatternAdd (p, e->object, l, FcTrue);
break;
+ case FcOpDelete:
+ if (t)
+ {
+ FcConfigDel (&st[i].elt->values, st[i].value);
+ break;
+ }
+ /* fall through ... */
+ case FcOpDeleteAll:
+ FcConfigPatternDel (p, e->object);
+ break;
default:
FcValueListDestroy (l);
break;
FcValuePrintWithPosition (const FcValue v, FcBool show_pos_mark)
{
if (show_pos_mark)
- printf (" [insert here] ");
+ printf (" [marker] ");
else
printf (" ");
_FcValuePrintFile (stdout, v);
FcValueBindingPrint (l);
}
if (!pos)
- printf (" [insert here]");
+ printf (" [marker]");
}
void
case FcOpPrependFirst: printf ("PrependFirst"); break;
case FcOpAppend: printf ("Append"); break;
case FcOpAppendLast: printf ("AppendLast"); break;
+ case FcOpDelete: printf ("Delete"); break;
+ case FcOpDeleteAll: printf ("DeleteAll"); break;
case FcOpQuest: printf ("Quest"); break;
case FcOpOr: printf ("Or"); break;
case FcOpAnd: printf ("And"); break;
FcOpField, FcOpConst,
FcOpAssign, FcOpAssignReplace,
FcOpPrependFirst, FcOpPrepend, FcOpAppend, FcOpAppendLast,
+ FcOpDelete, FcOpDeleteAll,
FcOpQuest,
FcOpOr, FcOpAnd, FcOpEqual, FcOpNotEqual,
FcOpContains, FcOpListing, FcOpNotContains,
case FcOpPrependFirst:
case FcOpAppend:
case FcOpAppendLast:
+ case FcOpDelete:
+ case FcOpDeleteAll:
break;
case FcOpOr:
case FcOpAnd:
{ "prepend_first", FcOpPrependFirst },
{ "append", FcOpAppend },
{ "append_last", FcOpAppendLast },
+ { "delete", FcOpDelete },
+ { "delete_all", FcOpDeleteAll },
};
#define NUM_MODE_OPS (int) (sizeof fcModeOps / sizeof fcModeOps[0])
return;
expr = FcPopBinary (parse, FcOpComma);
+ if ((mode == FcOpDelete || mode == FcOpDeleteAll) &&
+ expr != NULL)
+ {
+ FcConfigMessage (parse, FcSevereWarning, "Expression doesn't take any effects for delete and delete_all");
+ FcExprDestroy (expr);
+ expr = NULL;
+ }
edit = FcEditCreate (parse, FcObjectFromName ((char *) name),
mode, expr, binding);
if (!edit)