aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table
diff options
context:
space:
mode:
authorMiguel de Icaza <miguel@gnu.org>1999-12-02 02:28:27 +0800
committerArturo Espinosa <unammx@src.gnome.org>1999-12-02 02:28:27 +0800
commitf0da5ba3d04aa0c50d96d1002c22cde34909f00c (patch)
treec2063f4df9016c9ff6b70cdc1d4885db67df32f6 /widgets/table
parent9c0f9f1264f8083d177a01bf01e75e8787d587ed (diff)
downloadgsoc2013-evolution-f0da5ba3d04aa0c50d96d1002c22cde34909f00c.tar.gz
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/table')
-rw-r--r--widgets/table/e-cell-text.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c
index 78ba01e2ed..e496a50cb4 100644
--- a/widgets/table/e-cell-text.c
+++ b/widgets/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){
36 +0800'>2013-08-061-2/+2 * - Convert to new perl frameworkaz2013-08-031-2/+1 * - Convert to optionsNG (fold two same-condition blocks into one while here)rene2012-12-061-19/+19 * Throw my ports back in the pool, and make my intentions clear for thedougb2012-10-081-6/+1 * - update png to 1.5.10dinoex2012-06-011-1/+1 * Remove more tags from pkg-descr files fo the form:dougb2011-10-241-3/+0 * - Add LDFLAGS to CONFIGURE_ENV and MAKE_ENV (as it was done with LDFLAGS)amdmi32011-09-241-2/+2 * Add conflicts with foomatic-filtersdougb2011-09-101-0/+4 * Miscellaneous cleanups and fixes, some of the windowmaker stuffdougb2011-05-162-2/+2 * Join the party, remove MD5 from the last of my portsdougb2011-03-211-1/+0 * - remove BROKENdinoex2010-03-281-2/+0 * - update to 1.4.1dinoex2010-03-281-1/+1 * - update to jpeg-8dinoex2010-02-051-2/+2 * - Mark BROKEN: does not installpav2009-12-131-0/+2 * - Switch SourceForge ports to the new File Release System: categories startin...amdmi32009-08-221-2/+1 * - Connect print/hplip3 to buildamdmi32009-08-051-0/+2 * - update to jpeg7dinoex2009-07-181-2/+2 * Bump portrevision due to upgrade of devel/gettext.edwin2008-06-061-1/+1 * Add WANT_PERL. This will be needed to conditionalize bsd.perl.mk inclusion.linimon2007-09-301-0/+1 * - Welcome X.org 7.2 \o/.flz2007-05-201-0/+1 * Remove USE_REINPLACE from all categories starting with Pedwin2006-05-131-1/+0 * Add SHA256 checksums to my portsdougb2005-11-241-0/+1 * Respect LOCALBASE.ale2005-11-052-5/+8 * Fix build on FreeBSD 4.x.ale2005-11-031-0/+20 * Update to 2.1.4 release:ale2005-11-02