Evas font-engine: Fixed *props_info_create to accept a const string.
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 13 Apr 2011 08:36:54 +0000 (08:36 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 13 Apr 2011 08:36:54 +0000 (08:36 +0000)
We don't want to have to alloc just for the engine. We want to be able to
pass our own const copy.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@58618 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/include/evas_private.h
src/modules/engines/software_generic/evas_engine.c

index 68af2c5..b82881d 100644 (file)
@@ -686,7 +686,7 @@ struct _Evas_Func
    void (*image_content_hint_set)          (void *data, void *surface, int hint);
    int  (*image_content_hint_get)          (void *data, void *surface);
    int  (*font_pen_coords_get)            (void *data, void *font, const Evas_Text_Props *intl_props, int pos, int *cpen_x, int *cy, int *cadv, int *ch);
-   Eina_Bool (*font_text_props_info_create)                (void *data __UNUSED__, void *font, Eina_Unicode *text, Evas_Text_Props *intl_props, const Evas_BiDi_Paragraph_Props *par_props, size_t pos, size_t len);
+   Eina_Bool (*font_text_props_info_create)                (void *data __UNUSED__, void *font, const Eina_Unicode *text, Evas_Text_Props *intl_props, const Evas_BiDi_Paragraph_Props *par_props, size_t pos, size_t len);
    int  (*font_right_inset_get)                  (void *data, void *font, const Evas_Text_Props *text_props);
 
    /* EFL-GL Glue Layer */
index b5ffb6a..f3b2835 100644 (file)
@@ -772,18 +772,22 @@ eng_font_pen_coords_get(void *data __UNUSED__, void *font, const Evas_Text_Props
 }
 
 static Eina_Bool
-eng_font_text_props_info_create(void *data __UNUSED__, void *font, Eina_Unicode *text, Evas_Text_Props *text_props, const Evas_BiDi_Paragraph_Props *par_props, size_t pos, size_t len)
+eng_font_text_props_info_create(void *data __UNUSED__, void *font, const Eina_Unicode *text, Evas_Text_Props *text_props, const Evas_BiDi_Paragraph_Props *par_props, size_t pos, size_t len)
 {
-   (void) font;
-   (void) text;
-   (void) text_props;
+   Eina_Bool ret;
    (void) par_props;
    (void) pos;
-   (void) len;
 #if !defined(OT_SUPPORT) && defined(BIDI_SUPPORT)
+   Eina_Unicode *tmp = eina_unicode_strndup(text, len);
+   text = tmp;
    evas_bidi_shape_string(text, par_props, pos, len);
 #endif
-   return evas_common_text_props_content_create(font, text, text_props, len);
+   ret = evas_common_text_props_content_create(font, text, text_props, len);
+
+#if !defined(OT_SUPPORT) && defined(BIDI_SUPPORT)
+   free(tmp);
+#endif
+   return ret;
 }
 
 static int