Ethereal-dev: [Ethereal-dev] Feature or bug in dfilter_expr_dlg.c?

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "Olivier Biot" <ethereal@xxxxxxxxxx>
Date: Wed, 18 Feb 2004 00:07:23 +0100
Hi list,

The code in show_relations() reads as follows:

    if (ftype_can_FOO(ftype) ||
       (ftype_can_slice(ftype) && ftype_can_FOO(FT_BYTES)))
            add_relation_list(relation_list, "FOO");

It will display a relation if the relation applies to the field type
or if both the field type supports slicing *and* FT_BYTES supports the
relation (as a slice yields a FT_BYTES field type). As a result, any
sliceable field type *without* native support for a given operator
which however *is* supported by FT_BYTES will *always* show up,
eventually yielding invalid display filter expressions for which the
end-user receives an error message.

I propose to only make the operator visible if a slice has been
entered in this situation.

The code in show_relations() should then read as:

    if (ftype_can_FOO(ftype) ||
       (sliced && ftype_can_slice(ftype) && ftype_can_FOO(FT_BYTES)))
            add_relation_list(relation_list, "FOO");

The boolean 'sliced' is only set if the "slice" text box is nonempty
(and ideally valid).

Could a GTK expert look at this and provide correct code (I suppose
OBJECT_GET_DATA on E_DFILTER_EXPR_RANGE_ENTRY_KEY may provide us the
input) for this?

Regards,

Olivier