Enlightenment CVS committal

Author  : dj2
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_text.c 


Log Message:
- fix line up and line down

===================================================================
RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_text.c,v
retrieving revision 1.121
retrieving revision 1.122
diff -u -3 -r1.121 -r1.122
--- ewl_text.c  9 Sep 2006 04:52:03 -0000       1.121
+++ ewl_text.c  9 Sep 2006 04:59:42 -0000       1.122
@@ -761,7 +761,7 @@
 ewl_text_cursor_position_line_up_get(Ewl_Text *t)
 {
        Evas_Textblock_Cursor *cursor;
-       unsigned int cur_char_idx;
+       unsigned int cur_char_idx, byte_idx = 0;
        Evas_Coord cx, cw;
        Evas_Coord lx, ly, lw, lh;
        int line;
@@ -771,7 +771,9 @@
        DCHECK_TYPE_RET("t", t, EWL_TEXT_TYPE, t->cursor_position);
 
        cur_char_idx = ewl_text_cursor_position_get(t);
-       cursor = ewl_text_textblock_cursor_position(t, cur_char_idx);
+       ewl_text_char_to_byte(t, cur_char_idx, 0, &byte_idx, NULL);
+
+       cursor = ewl_text_textblock_cursor_position(t, byte_idx);
        line = evas_textblock_cursor_char_geometry_get(cursor, &cx, NULL, 
                                                                &cw, NULL);
        line --;
@@ -791,7 +793,9 @@
                }
 
        }
-       cur_char_idx = ewl_text_textblock_cursor_to_index(cursor);
+       byte_idx = ewl_text_textblock_cursor_to_index(cursor);
+       cur_char_idx = 0;
+       ewl_text_byte_to_char(t, byte_idx, 0, &cur_char_idx, NULL);
 
        DRETURN_INT(cur_char_idx, DLEVEL_STABLE);
 }
@@ -805,7 +809,7 @@
 ewl_text_cursor_position_line_down_get(Ewl_Text *t)
 {
        Evas_Textblock_Cursor *cursor;
-       unsigned int cur_char_idx;
+       unsigned int cur_char_idx, byte_idx = 0;
        Evas_Coord cx, cw;
        Evas_Coord lx, ly, lw, lh;
        int line;
@@ -815,7 +819,9 @@
        DCHECK_TYPE_RET("t", t, EWL_TEXT_TYPE, t->cursor_position);
 
        cur_char_idx = ewl_text_cursor_position_get(t);
-       cursor = ewl_text_textblock_cursor_position(t, cur_char_idx);
+       ewl_text_char_to_byte(t, cur_char_idx, 0, &byte_idx, NULL);
+
+       cursor = ewl_text_textblock_cursor_position(t, byte_idx);
        line = evas_textblock_cursor_char_geometry_get(cursor, &cx, NULL, 
                                                                &cw, NULL);
        line ++;
@@ -835,7 +841,9 @@
                }
 
        }
-       cur_char_idx = ewl_text_textblock_cursor_to_index(cursor);
+       byte_idx = ewl_text_textblock_cursor_to_index(cursor);
+       cur_char_idx = 0;
+       ewl_text_byte_to_char(t, byte_idx, 0, &cur_char_idx, NULL);
 
        DRETURN_INT(cur_char_idx, DLEVEL_STABLE);
 }



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to