aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc/e-cell-date-edit.c
diff options
context:
space:
mode:
authorDamon Chaplin <damon@ximian.com>2001-10-23 07:47:32 +0800
committerDamon Chaplin <damon@src.gnome.org>2001-10-23 07:47:32 +0800
commitf59604582dc64d50c7b6974aa4322863da594483 (patch)
tree157cef3013b6a0ef414d3637f76c0968e2c9f68d /widgets/misc/e-cell-date-edit.c
parent1c090bee53d04e7ba57c12e700c5f4f142c6bbf7 (diff)
downloadgsoc2013-evolution-f59604582dc64d50c7b6974aa4322863da594483.tar
gsoc2013-evolution-f59604582dc64d50c7b6974aa4322863da594483.tar.gz
gsoc2013-evolution-f59604582dc64d50c7b6974aa4322863da594483.tar.bz2
gsoc2013-evolution-f59604582dc64d50c7b6974aa4322863da594483.tar.lz
gsoc2013-evolution-f59604582dc64d50c7b6974aa4322863da594483.tar.xz
gsoc2013-evolution-f59604582dc64d50c7b6974aa4322863da594483.tar.zst
gsoc2013-evolution-f59604582dc64d50c7b6974aa4322863da594483.zip
use the new ECellText methods to get the text and set the value.
2001-10-22 Damon Chaplin <damon@ximian.com> * e-cell-date-edit.c (e_cell_date_edit_set_popup_values): (e_cell_date_edit_update_cell): use the new ECellText methods to get the text and set the value. * e-cell-percent.c: new subclass of ECellText to display & edit a percentage value. svn path=/trunk/; revision=13916
Diffstat (limited to 'widgets/misc/e-cell-date-edit.c')
-rw-r--r--widgets/misc/e-cell-date-edit.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/widgets/misc/e-cell-date-edit.c b/widgets/misc/e-cell-date-edit.c
index 2554b70ff1..6e2daf5326 100644
--- a/widgets/misc/e-cell-date-edit.c
+++ b/widgets/misc/e-cell-date-edit.c
@@ -37,6 +37,7 @@
#include <gdk/gdkkeysyms.h>
#include <gal/util/e-util.h>
#include <gal/e-table/e-table-item.h>
+#include <gal/e-table/e-cell-text.h>
#include <libgnomeui/gnome-messagebox.h>
#include <libgnomeui/gnome-stock.h>
#include <libgnome/gnome-i18n.h>
@@ -437,6 +438,7 @@ static void
e_cell_date_edit_set_popup_values (ECellDateEdit *ecde)
{
ECellPopup *ecp = E_CELL_POPUP (ecde);
+ ECellText *ecell_text = E_CELL_TEXT (ecp->child);
ECellView *ecv = (ECellView*) ecp->popup_cell_view;
ETableItem *eti = E_TABLE_ITEM (ecp->popup_cell_view->cell_view.e_table_item_view);
ETableCol *ecol;
@@ -448,8 +450,8 @@ e_cell_date_edit_set_popup_values (ECellDateEdit *ecde)
char buffer[64];
ecol = e_table_header_get_column (eti->header, ecp->popup_view_col);
- cell_text = e_table_model_value_at (ecv->e_table_model,
- ecol->col_idx, ecp->popup_row);
+ cell_text = e_cell_text_get_text (ecell_text, ecv->e_table_model,
+ ecol->col_idx, ecp->popup_row);
status = e_time_parse_date_and_time (cell_text, &date_tm);
@@ -472,6 +474,8 @@ e_cell_date_edit_set_popup_values (ECellDateEdit *ecde)
e_cell_date_edit_select_matching_time (ecde, buffer);
}
+
+ e_cell_text_free_text (ecell_text, cell_text);
}
@@ -822,6 +826,7 @@ e_cell_date_edit_update_cell (ECellDateEdit *ecde,
char *text)
{
ECellPopup *ecp = E_CELL_POPUP (ecde);
+ ECellText *ecell_text = E_CELL_TEXT (ecp->child);
ECellView *ecv = (ECellView*) ecp->popup_cell_view;
ETableItem *eti = E_TABLE_ITEM (ecv->e_table_item_view);
ETableCol *ecol;
@@ -829,15 +834,17 @@ e_cell_date_edit_update_cell (ECellDateEdit *ecde,
/* Compare the new text with the existing cell contents. */
ecol = e_table_header_get_column (eti->header, ecp->popup_view_col);
- old_text = e_table_model_value_at (ecv->e_table_model,
- ecol->col_idx, ecp->popup_row);
+
+ old_text = e_cell_text_get_text (ecell_text, ecv->e_table_model,
+ ecol->col_idx, ecp->popup_row);
/* If they are different, update the cell contents. */
if (strcmp (old_text, text)) {
- e_table_model_set_value_at (ecv->e_table_model,
- ecol->col_idx, ecp->popup_row,
- text);
+ e_cell_text_set_value (ecell_text, ecv->e_table_model,
+ ecol->col_idx, ecp->popup_row, text);
}
+
+ e_cell_text_free_text (ecell_text, old_text);
}