fix bug hermet added in font code! :)
[framework/uifw/elementary.git] / src / lib / elm_index.c
index da1022e..b4670db 100644 (file)
@@ -265,6 +265,10 @@ _index_box_auto_fill(Evas_Object *obj, Evas_Object *box, int level)
         const char *stacking;
 
         if (it->level != level) continue;
+
+//FIXME: Need to check. This cause one less items show up.
+//        if(i > wd->max_supp_items_count) break;
+
         o = edje_object_add(evas_object_evas_get(obj));
         VIEW(it) = o;
         edje_object_mirrored_set(VIEW(it), rtl);
@@ -288,7 +292,7 @@ _index_box_auto_fill(Evas_Object *obj, Evas_Object *box, int level)
                                      elm_widget_style_get(obj));
           }
 
-        edje_object_part_text_set(o, "elm.text", it->letter);
+        edje_object_part_text_escaped_set(o, "elm.text", it->letter);
         edje_object_size_min_restricted_calc(o, &mw, &mh, 0, 0);
         evas_object_size_hint_min_set(o, mw, mh);
         evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
@@ -368,8 +372,8 @@ _sel_eval(Evas_Object *obj, Evas_Coord evx, Evas_Coord evy)
         evas_object_geometry_get(wd->bx[i], &bx, &by, &bw, &bh);
         EINA_LIST_FOREACH(wd->items, l, it)
           {
-             if (!((it->level == i) && (VIEW(it)))) continue;
-             if ((VIEW(it)) && (it->level != wd->level))
+             if (it->level != i) continue;
+             if (it->level != wd->level)
                {
                   if (it->selected)
                     {
@@ -436,26 +440,30 @@ _sel_eval(Evas_Object *obj, Evas_Coord evx, Evas_Coord evy)
         if (it_closest)
           {
              it = it_closest;
-             if (!last)
+             if (!last && it->letter)
                last = strdup(it->letter);
              else
                {
-                  if (!label) label = strdup(last);
+                  if (!label && last) label = strdup(last);
                   else
                     {
-                       /* FIXME: realloc return NULL if the request fails */
-                       label = realloc(label, strlen(label) + strlen(last) + 1);
-                       strcat(label, last);
+                       if (label && last)
+                         {
+                            label = realloc(label, strlen(label) +
+                                            strlen(last) + 1);
+                            if (!label) return;
+                            strcat(label, last);
+                         }
                     }
                   free(last);
-                  last = strdup(it->letter);
+                  if (it->letter) last = strdup(it->letter);
                }
           }
      }
    if (!label) label = strdup("");
    if (!last) last = strdup("");
-   edje_object_part_text_set(wd->base, "elm.text.body", label);
-   edje_object_part_text_set(wd->base, "elm.text", last);
+   edje_object_part_text_escaped_set(wd->base, "elm.text.body", label);
+   edje_object_part_text_escaped_set(wd->base, "elm.text", last);
    free(label);
    free(last);
 }
@@ -639,18 +647,6 @@ elm_index_add(Evas_Object *parent)
    return obj;
 }
 
-EINA_DEPRECATED EAPI void
-elm_index_active_set(Evas_Object *obj, Eina_Bool active)
-{
-   elm_index_autohide_disabled_set(obj, !active);
-}
-
-EINA_DEPRECATED EAPI Eina_Bool
-elm_index_active_get(const Evas_Object *obj)
-{
-   return !elm_index_autohide_disabled_get(obj);
-}
-
 EAPI void
 elm_index_autohide_disabled_set(Evas_Object *obj, Eina_Bool disabled)
 {
@@ -670,7 +666,7 @@ elm_index_autohide_disabled_set(Evas_Object *obj, Eina_Bool disabled)
    else
      edje_object_signal_emit(wd->base, "elm,state,inactive", "elm");
 
-   //FIXME: Should be update indicator based on the indicator visiblility 
+   //FIXME: Should be update indicator based on the indicator visiblility
 }
 
 EAPI Eina_Bool
@@ -709,7 +705,7 @@ elm_index_item_selected_set(Elm_Object_Item *it, Eina_Bool selected)
    Widget_Data *wd = elm_widget_data_get(WIDGET(it));
    if (!wd) return;
 
-   //FIXME: Should be update indicator based on the autohidden status & indicator visiblility 
+   //FIXME: Should be update indicator based on the autohidden status & indicator visiblility
 
    if (selected)
      {
@@ -721,12 +717,6 @@ elm_index_item_selected_set(Elm_Object_Item *it, Eina_Bool selected)
 
 }
 
-EINA_DEPRECATED EAPI Elm_Object_Item *
-elm_index_item_selected_get(const Evas_Object *obj, int level)
-{
-   return elm_index_selected_item_get(obj, level);
-}
-
 EAPI Elm_Object_Item *
 elm_index_selected_item_get(const Evas_Object *obj, int level)
 {
@@ -773,12 +763,6 @@ elm_index_item_prepend(Evas_Object *obj, const char *letter, Evas_Smart_Cb func,
 }
 
 EINA_DEPRECATED EAPI Elm_Object_Item *
-elm_index_item_append_relative(Evas_Object *obj, const char *letter, const void *item, const Elm_Object_Item *relative)
-{
-   return elm_index_item_insert_after(obj, (Elm_Object_Item *) relative, letter, NULL, item);
-}
-
-EINA_DEPRECATED EAPI Elm_Object_Item *
 elm_index_item_prepend_relative(Evas_Object *obj, const char *letter, const void *item, const Elm_Object_Item *relative)
 {
    return elm_index_item_insert_before(obj, (Elm_Object_Item *) relative, letter, NULL, item);
@@ -853,12 +837,6 @@ elm_index_item_sorted_insert(Evas_Object *obj, const char *letter, Evas_Smart_Cb
    return (Elm_Object_Item *)it;
 }
 
-EAPI void
-elm_index_item_del(Evas_Object *obj __UNUSED__, Elm_Object_Item *it)
-{
-   elm_object_item_del(it);
-}
-
 EAPI Elm_Object_Item *
 elm_index_item_find(Evas_Object *obj, const void *data)
 {
@@ -889,12 +867,6 @@ elm_index_item_clear(Evas_Object *obj)
      }
 }
 
-EINA_DEPRECATED EAPI void
-elm_index_item_go(Evas_Object *obj, int level __UNUSED__)
-{
-   elm_index_level_go(obj, level);
-}
-
 EAPI void
 elm_index_level_go(Evas_Object *obj, int level __UNUSED__)
 {
@@ -905,18 +877,6 @@ elm_index_level_go(Evas_Object *obj, int level __UNUSED__)
    if (wd->level == 1) _index_box_auto_fill(obj, wd->bx[1], 1);
 }
 
-EAPI void *
-elm_index_item_data_get(const Elm_Object_Item *it)
-{
-   return elm_object_item_data_get(it);
-}
-
-EAPI void
-elm_index_item_data_set(Elm_Object_Item *it, const void *data)
-{
-   elm_object_item_data_set(it, (void *) data);
-}
-
 EAPI void
 elm_index_indicator_disabled_set(Evas_Object *obj, Eina_Bool disabled)
 {
@@ -944,12 +904,6 @@ elm_index_indicator_disabled_get(const Evas_Object *obj)
    return wd->indicator_disabled;
 }
 
-EAPI void
-elm_index_item_del_cb_set(Elm_Object_Item *it, Evas_Smart_Cb func)
-{
-   elm_object_item_del_cb_set(it, func);
-}
-
 EAPI const char *
 elm_index_item_letter_get(const Elm_Object_Item *it)
 {
@@ -978,4 +932,3 @@ elm_index_horizontal_get(const Evas_Object *obj)
    if (!wd) return EINA_FALSE;
    return wd->horizontal;
 }
-