forked from enlightenment/efl
Fix eina hash usage.
When using eina hash we need to create the hash if it does not exist. SVN revision: 38172
This commit is contained in:
parent
c80a55ee14
commit
28bf361096
|
@ -153,6 +153,7 @@ _oid_track(Edje *ed, Evas_Object *o)
|
||||||
evas_object_clip_set(oi->obj, oi->ed->clipper);
|
evas_object_clip_set(oi->obj, oi->ed->clipper);
|
||||||
evas_object_geometry_get(oi->obj, &(oi->x), &(oi->y), &(oi->w), &(oi->h));
|
evas_object_geometry_get(oi->obj, &(oi->x), &(oi->y), &(oi->w), &(oi->h));
|
||||||
snprintf(buf, sizeof(buf), "%i", oi->oid);
|
snprintf(buf, sizeof(buf), "%i", oi->oid);
|
||||||
|
if (!si->oid.hash) si->oid.hash = eina_hash_string_superfast_new(NULL);
|
||||||
eina_hash_add(si->oid.hash, buf, oi);
|
eina_hash_add(si->oid.hash, buf, oi);
|
||||||
return oi;
|
return oi;
|
||||||
}
|
}
|
||||||
|
|
|
@ -298,6 +298,7 @@ edje_color_class_set(const char *color_class, int r, int g, int b, int a, int r2
|
||||||
free(cc);
|
free(cc);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!_edje_color_class_hash) _edje_color_class_hash = eina_hash_string_superfast_new(NULL);
|
||||||
eina_hash_add(_edje_color_class_hash, color_class, cc);
|
eina_hash_add(_edje_color_class_hash, color_class, cc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -573,6 +574,7 @@ edje_text_class_set(const char *text_class, const char *font, Evas_Font_Size siz
|
||||||
free(tc);
|
free(tc);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!_edje_text_class_hash) _edje_text_class_hash = eina_hash_string_superfast_new(NULL);
|
||||||
eina_hash_add(_edje_text_class_hash, text_class, tc);
|
eina_hash_add(_edje_text_class_hash, text_class, tc);
|
||||||
|
|
||||||
tc->font = eina_stringshare_add(font);
|
tc->font = eina_stringshare_add(font);
|
||||||
|
@ -2514,6 +2516,7 @@ _edje_color_class_member_add(Edje *ed, const char *color_class)
|
||||||
}
|
}
|
||||||
|
|
||||||
members = eina_list_prepend(members, ed);
|
members = eina_list_prepend(members, ed);
|
||||||
|
if (!_edje_color_class_member_hash) _edje_color_class_member_hash = eina_hash_string_superfast_new(NULL);
|
||||||
eina_hash_add(_edje_color_class_member_hash, color_class, members);
|
eina_hash_add(_edje_color_class_member_hash, color_class, members);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2530,7 +2533,7 @@ _edje_color_class_member_del(Edje *ed, const char *color_class)
|
||||||
members = eina_list_remove(members, ed);
|
members = eina_list_remove(members, ed);
|
||||||
if (members)
|
if (members)
|
||||||
{
|
{
|
||||||
eina_hash_add(_edje_color_class_member_hash, color_class, members);
|
eina_hash_add(_edje_color_class_member_hash, color_class, members);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2620,6 +2623,7 @@ _edje_text_class_member_add(Edje *ed, const char *text_class)
|
||||||
members = eina_list_prepend(members, ed);
|
members = eina_list_prepend(members, ed);
|
||||||
|
|
||||||
/* Add the member list back */
|
/* Add the member list back */
|
||||||
|
if (!_edje_text_class_member_hash) _edje_text_class_member_hash = eina_hash_string_superfast_new(NULL);
|
||||||
eina_hash_add(_edje_text_class_member_hash, text_class, members);
|
eina_hash_add(_edje_text_class_member_hash, text_class, members);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue