Enlightenment CVS committal

Author  : dj2
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_entry.c 


Log Message:
- minor cleanups

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_entry.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -3 -r1.39 -r1.40
--- ewl_entry.c 29 Nov 2005 06:13:22 -0000      1.39
+++ ewl_entry.c 1 Dec 2005 01:42:22 -0000       1.40
@@ -398,18 +398,19 @@
 void
 ewl_entry_cursor_move_left(Ewl_Entry *e)
 {
+       unsigned int pos;
+
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR("e", e);
        DCHECK_TYPE("e", e, "entry");
 
+       pos = ewl_entry_cursor_position_get(EWL_ENTRY_CURSOR(e->cursor));
+
        /* we're already at the start */
-       if (ewl_entry_cursor_position_get(EWL_ENTRY_CURSOR(e->cursor)) == 0)
-       {
+       if (pos == 0)
                DRETURN(DLEVEL_STABLE);
-       }
-       ewl_entry_cursor_position_set(EWL_ENTRY_CURSOR(e->cursor),
-               ewl_entry_cursor_position_get(EWL_ENTRY_CURSOR(e->cursor)) - 1);
 
+       ewl_entry_cursor_position_set(EWL_ENTRY_CURSOR(e->cursor), pos - 1);
        ewl_widget_configure(EWL_WIDGET(e));
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
@@ -418,19 +419,19 @@
 void
 ewl_entry_cursor_move_right(Ewl_Entry *e)
 {
+       unsigned int pos;
+
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR("e", e);
        DCHECK_TYPE("e", e, "entry");
 
+       pos = ewl_entry_cursor_position_get(EWL_ENTRY_CURSOR(e->cursor));
+
        /* if we are already at the end, stop */
-       if (ewl_entry_cursor_position_get(EWL_ENTRY_CURSOR(e->cursor))
-                                       == ewl_text_length_get(EWL_TEXT(e)))
-       {
+       if (pos == ewl_text_length_get(EWL_TEXT(e)))
                DRETURN(DLEVEL_STABLE);
-       }
-       ewl_entry_cursor_position_set(EWL_ENTRY_CURSOR(e->cursor),
-               ewl_entry_cursor_position_get(EWL_ENTRY_CURSOR(e->cursor)) + 1);
 
+       ewl_entry_cursor_position_set(EWL_ENTRY_CURSOR(e->cursor), pos + 1);
        ewl_widget_configure(EWL_WIDGET(e));
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to