CVS: sylpheed-claws/src/gtk quicksearch.c,1.1.2.42,1.1.2.43
Colin Leroy <[email protected]>
| Newsgroups | gmane.mail.sylpheed.claws.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/sylpheed-claws/sylpheed-claws/src/gtk
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31118/src/gtk
Modified Files:
Tag: gtk2
quicksearch.c
Log Message:
2006-04-23 [colin] 2.1.1cvs26
* src/gtk/quicksearch.c
Fix replacing in quicksearch, and fix inserting
in the middle of the string. (introduced at cvs22)
Index: quicksearch.c
===================================================================
RCS file: /cvsroot/sylpheed-claws/sylpheed-claws/src/gtk/quicksearch.c,v
retrieving revision 1.1.2.42
retrieving revision 1.1.2.43
diff -u -r1.1.2.42 -r1.1.2.43
--- quicksearch.c 21 Apr 2006 18:18:30 -0000 1.1.2.42
+++ quicksearch.c 23 Apr 2006 14:41:11 -0000 1.1.2.43
@@ -870,6 +870,16 @@
char key[7] = "";
guint char_len = 0;
+ if (gtk_editable_get_selection_bounds(GTK_EDITABLE(entry), NULL, NULL)) {
+ /* remove selection */
+ gtk_editable_delete_selection(GTK_EDITABLE(entry));
+ curpos = gtk_editable_get_position(GTK_EDITABLE(entry));
+ /* refresh string */
+ g_free(str);
+ str = g_strdup(gtk_entry_get_text(entry));
+ begin = str;
+ }
+
if (!(c = gdk_keyval_to_unicode(val))) {
g_free(str);
return;
@@ -879,7 +889,10 @@
return;
key[char_len] = '\0';
if (curpos < g_utf8_strlen(str, -1)) {
- end = g_utf8_offset_to_pointer(str, curpos+1);
+ gchar *stop = g_utf8_offset_to_pointer(begin, curpos);
+ end = g_strdup(g_utf8_offset_to_pointer(str, curpos));
+ *stop = '\0';
+ printf("new %s %s %s\n", begin, key, end);
new = g_strdup_printf("%s%s%s", begin, key, end);
gtk_entry_set_text(entry, new);
g_free(end);
-------------------------------------------------------
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