evas_object_textblock: Fix removing Devanagari characters 46/300846/2 accepted/tizen/unified/20231103.163815
authorHubert Stachowiak <h.stachowiak@samsung.com>
Thu, 2 Nov 2023 13:43:33 +0000 (14:43 +0100)
committerHubert Stachowiak <h.stachowiak@samsung.com>
Thu, 2 Nov 2023 18:11:34 +0000 (19:11 +0100)
Check for U+0941 and U+0942 vowels which should be treated
as separete characters when deleting.

Change-Id: I18cbc3a1b2d5c79c7dd17450156447a75e7350bc

src/lib/evas/canvas/evas_object_textblock.c

index a8c5352..3357eeb 100644 (file)
@@ -10777,6 +10777,16 @@ _evas_textblock_cursor_cluster_pos_get(Evas_Textblock_Cursor *cur, Eina_Bool inc
                               }
                             else
                               {
+                                 //TIZEN_ONLY(20231102) evas_object_textblock: Fix removing Devanagari characters
+                                 // Check for U+0941 and U+0942 vowels which should be treated as separete characters when deleting.
+                                 const Eina_Unicode* text = eina_ustrbuf_string_get(cur->node->unicode);
+                                 if (text && cur_pos < eina_unicode_strlen(text))
+                                   {
+                                      uint32_t character = text[cur_pos];
+                                      if (character == 0x941 || character == 0x942)
+                                        return ret;
+                                   }
+                                 //
                                  for (i = 0; i < (int) ti->text_props.len; i++)
                                    {
                                       ot = info->ot[i];