diff options
author | Miguel de Icaza <miguel@gnu.org> | 1999-12-02 02:28:27 +0800 |
---|---|---|
committer | Arturo Espinosa <unammx@src.gnome.org> | 1999-12-02 02:28:27 +0800 |
commit | f0da5ba3d04aa0c50d96d1002c22cde34909f00c (patch) | |
tree | c2063f4df9016c9ff6b70cdc1d4885db67df32f6 /widgets/e-table | |
parent | 9c0f9f1264f8083d177a01bf01e75e8787d587ed (diff) | |
download | gsoc2013-evolution-f0da5ba3d04aa0c50d96d1002c22cde34909f00c.tar gsoc2013-evolution-f0da5ba3d04aa0c50d96d1002c22cde34909f00c.tar.gz gsoc2013-evolution-f0da5ba3d04aa0c50d96d1002c22cde34909f00c.tar.bz2 gsoc2013-evolution-f0da5ba3d04aa0c50d96d1002c22cde34909f00c.tar.lz gsoc2013-evolution-f0da5ba3d04aa0c50d96d1002c22cde34909f00c.tar.xz gsoc2013-evolution-f0da5ba3d04aa0c50d96d1002c22cde34909f00c.tar.zst gsoc2013-evolution-f0da5ba3d04aa0c50d96d1002c22cde34909f00c.zip |
Keep track of the originally allocated piece of code.
1999-12-01 Miguel de Icaza <miguel@gnu.org>
* e-cell-text.c (ect_draw): Keep track of the originally allocated
piece of code.
svn path=/trunk/; revision=1451
Diffstat (limited to 'widgets/e-table')
-rw-r--r-- | widgets/e-table/ChangeLog | 3 | ||||
-rw-r--r-- | widgets/e-table/e-cell-text.c | 12 |
2 files changed, 10 insertions, 5 deletions
diff --git a/widgets/e-table/ChangeLog b/widgets/e-table/ChangeLog index 1317034e74..76e918b61d 100644 --- a/widgets/e-table/ChangeLog +++ b/widgets/e-table/ChangeLog @@ -1,5 +1,8 @@ 1999-12-01 Miguel de Icaza <miguel@gnu.org> + * e-cell-text.c (ect_draw): Keep track of the originally allocated + piece of code. + * e-table-header-item.c (ethi_unrealize): Removed change cursor from here. diff --git a/widgets/e-table/e-cell-text.c b/widgets/e-table/e-cell-text.c index 78ba01e2ed..e496a50cb4 100644 --- a/widgets/e-table/e-cell-text.c +++ b/widgets/e-table/e-cell-text.c @@ -184,11 +184,13 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable, if (edit_display){ CellEdit *edit = text_view->edit; const char *text = gtk_entry_get_text (edit->entry); - GdkWChar *text_wc = g_new (GdkWChar, strlen (text) + 1); - int text_wc_len = gdk_mbstowcs (text_wc, text, strlen (text)); + GdkWChar *p, *text_wc; + int text_wc_len; const int cursor_pos = GTK_EDITABLE (edit->entry)->current_pos; const int left_len = gdk_text_width_wc (text_view->font, text_wc, cursor_pos); + text_wc = g_new (GdkWChar, strlen (text) + 1); + text_wc_len = gdk_mbstowcs (text_wc, text, strlen (text)); text_wc [text_wc_len] = 0; /* @@ -220,9 +222,9 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable, if ((px + left_len) > x2) px -= left_len - (x2-x1); - for (i = 0; *text_wc; text_wc++, i++){ + for (i = 0, p = text_wc; *p; p++, i++){ gdk_draw_text_wc ( - drawable, font, gc, px, y, text_wc, 1); + drawable, font, gc, px, y, p, 1); if (i == cursor_pos){ gdk_draw_line ( @@ -231,7 +233,7 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable, px, y + font->descent - 1); } - px += gdk_text_width_wc (font, text_wc, 1); + px += gdk_text_width_wc (font, p, 1); } if (i == cursor_pos){ |