1. Attributes can come with random sequence.
So, attribute list should be sorted based on start_index.
2. None tag can be used for some languages' preediting.
So, the tag also needs to be handled the same with other tags.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D11059
Ecore_IMF_Preedit_Attr *attr1 = (Ecore_IMF_Preedit_Attr *)a1;
Ecore_IMF_Preedit_Attr *attr2 = (Ecore_IMF_Preedit_Attr *)a2;
- if (!attr1 || !attr2) return 0;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(attr1, 0);
+ EINA_SAFETY_ON_NULL_RETURN_VAL(attr2, 0);
- if (attr1->start_index <= attr2->start_index) return -1;
+ if (attr1->start_index < attr2->start_index) return -1;
+ else if (attr1->start_index == attr2->start_index) return 0;
else return 1;
}