Function wDefaultFillAttributes() rewritten
The function wDefaultFillAttributes can be changed a lot:
1. Initialitation to NULL: If the pointers are initialized to NULL
then, the "if's" don't need the else block:
WMPropList *value, *dw, *dc, *dn, *da;
dw = dc = dn = da = NULL;
if's:
= if (instance)
= key2 = WMCreatePLString(instance);
- else
- key2 = NULL;
2. Added StrConcatDot in the class + instance block:
= if (class && instance) {
+ buffer = StrConcatDot(instance, class);
- buffer = wmalloc(strlen(class) + strlen(instance) + 2);
- sprintf(buffer, "%s.%s", instance, class);
3. init_wdefaults(scr); moved above. This function is used only
to load the default value "AnyWindow" (value "*"), to search
the default value. Can be moved above without problems.
4. Preprocessor code of APPLY_VAL moved to the top of the file.
5. New function get_value_from_instanceclass() to do the rest of
the (repetitive) code. This function is called to create the
proplist, search the value, and return the proplist.
EXTRA:
1. Added StrConcatDot (like dot 2) in wDefaultChangeIcon()
2. Added a comment in get_value()