Update of /cvsroot/xine/xine-ui/src/xitk/xine-toolkit
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv9703

Modified Files:
        inputtext.c 
Log Message:
Fixed a bug causing that the first char of text could be erased by backspace
when cursor was left of it, which also corrupted cursor position. Code cleanup.


Index: inputtext.c
===================================================================
RCS file: /cvsroot/xine/xine-ui/src/xitk/xine-toolkit/inputtext.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -r1.70 -r1.71
--- inputtext.c 19 Jun 2006 13:56:50 -0000      1.70
+++ inputtext.c 6 Feb 2007 22:41:18 -0000       1.71
@@ -1,5 +1,5 @@
 /* 
- * Copyright (C) 2000-2004 the xine project
+ * Copyright (C) 2000-2007 the xine project
  * 
  * This file is part of xine, a unix video player.
  * 
@@ -688,7 +688,7 @@
   int                       offset;
   
   if(private_data->text && (strlen(private_data->text) >= 1)) {
-    if(private_data->cursor_pos >= 0) {
+    if(private_data->cursor_pos > 0) {
       
       oldtext = strdup(private_data->text);
       newtext = (char *) xitk_xmalloc(strlen(oldtext));
@@ -700,20 +700,15 @@
       pp = newtext;
       
       while(offset < private_data->cursor_pos) {
-       *pp = *p;
-       p++;
-       pp++;
+       *pp++ = *p++;
        offset++;
       }
       p++;
       
       while(*p != '\0') {
-       *pp = *p;
-       offset++;
-       p++;
-       pp++;
+       *pp++ = *p++;
       } 
-      *pp = 0;
+      *pp = '\0';
       
       XITK_FREE(private_data->text);
       private_data->text = strdup(newtext);


-------------------------------------------------------------------------
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
_______________________________________________
Xine-cvslog mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xine-cvslog

Reply via email to