aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-cell-text.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-06-02 08:27:34 +0800
committerChris Lahey <clahey@src.gnome.org>2000-06-02 08:27:34 +0800
commitabac1b7524f99c9cdbd317671fd2debabd7d4d0c (patch)
tree2d080e18a69edeec9979bd227752f194d01086a0 /widgets/table/e-cell-text.c
parent70572672677b4d34b6d3b6a5c6d6458f204c9d50 (diff)
downloadgsoc2013-evolution-abac1b7524f99c9cdbd317671fd2debabd7d4d0c.tar.gz
gsoc2013-evolution-abac1b7524f99c9cdbd317671fd2debabd7d4d0c.tar.zst
gsoc2013-evolution-abac1b7524f99c9cdbd317671fd2debabd7d4d0c.zip
Copy and paste error.
2000-06-01 Christopher James Lahey <clahey@helixcode.com> * e-table-item.c: Copy and paste error. svn path=/trunk/; revision=3353
Diffstat (limited to 'widgets/table/e-cell-text.c')
-rw-r--r--widgets/table/e-cell-text.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c
index a354efde13..d7ef682fde 100644
--- a/widgets/table/e-cell-text.c
+++ b/widgets/table/e-cell-text.c
@@ -73,6 +73,7 @@ enum {
ARG_ELLIPSIS,
ARG_STRIKEOUT_COLUMN,
ARG_BOLD_COLUMN,
+ ARG_TEXT_FILTER,
};
@@ -1045,7 +1046,13 @@ ect_height (ECellView *ecell_view, int model_col, int view_col, int row)
GdkFont *font;
font = text_view->font;
- return (font->ascent + font->descent) * number_of_lines(e_table_model_value_at (ecell_view->e_table_model, model_col, row)) + TEXT_PAD;
+ if (text_view->filter) {
+ char *string = text_view->filter(e_table_model_value_at (ecell_view->e_table_model, model_col, row));
+ int value = (font->ascent + font->descent) * number_of_lines(string) + TEXT_PAD;
+ g_free(string);
+ return value;
+ } else
+ return (font->ascent + font->descent) * number_of_lines(e_table_model_value_at (ecell_view->e_table_model, model_col, row)) + TEXT_PAD;
}
/*
@@ -1055,7 +1062,7 @@ static void *
ect_enter_edit (ECellView *ecell_view, int model_col, int view_col, int row)
{
ECellTextView *text_view = (ECellTextView *) ecell_view;
- const char *str = e_table_model_value_at (ecell_view->e_table_model, model_col, row);
+ char *str;
CellEdit *edit;
edit = g_new (CellEdit, 1);
@@ -1096,7 +1103,12 @@ ect_enter_edit (ECellView *ecell_view, int model_col, int view_col, int row)
edit->pointer_in = FALSE;
edit->default_cursor_shown = TRUE;
- edit->old_text = g_strdup (str);
+ if (ect->filter) {
+ str = ect->filter(e_table_model_value_at (ecell_view->e_table_model, model_col, row));
+ edit->old_text = str;
+ } else {
+ edit->old_text = g_strdup (str);
+ }
edit->cell.text = g_strdup (str);
#if 0