aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-table-item.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-10-22 14:03:03 +0800
committerChris Lahey <clahey@src.gnome.org>2000-10-22 14:03:03 +0800
commit4273e3adbe22aa8dbb34b9eaeeb206811d497646 (patch)
tree4c74a102e3848b7c6c0015c0a551574aefb2f213 /widgets/table/e-table-item.c
parente4e6331ee588f6b72c9f98840f09d2eb41e23cb3 (diff)
downloadgsoc2013-evolution-4273e3adbe22aa8dbb34b9eaeeb206811d497646.tar.gz
gsoc2013-evolution-4273e3adbe22aa8dbb34b9eaeeb206811d497646.tar.zst
gsoc2013-evolution-4273e3adbe22aa8dbb34b9eaeeb206811d497646.zip
Made it so that it doesn't recalculate all the rows if a row is changed,
2000-10-22 Christopher James Lahey <clahey@helixcode.com> * e-table-item.c: Made it so that it doesn't recalculate all the rows if a row is changed, inserted or deleted. * e-table-subset.c: Added debugging code (turned off). svn path=/trunk/; revision=6102
Diffstat (limited to 'widgets/table/e-table-item.c')
-rw-r--r--widgets/table/e-table-item.c31
1 files changed, 27 insertions, 4 deletions
diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c
index 20259b0ed7..0c9551f60c 100644
--- a/widgets/table/e-table-item.c
+++ b/widgets/table/e-table-item.c
@@ -672,7 +672,9 @@ eti_request_region_show (ETableItem *eti,
static void
eti_table_model_row_changed (ETableModel *table_model, int row, ETableItem *eti)
{
- if (eti->renderers_can_change_size) {
+ if (eti->renderers_can_change_size &&
+ eti->height_cache && eti->height_cache[row] != -1 &&
+ eti_row_height_real(eti, row) != eti->height_cache[row]) {
eti_table_model_changed (table_model, eti);
return;
}
@@ -683,7 +685,9 @@ eti_table_model_row_changed (ETableModel *table_model, int row, ETableItem *eti)
static void
eti_table_model_cell_changed (ETableModel *table_model, int col, int row, ETableItem *eti)
{
- if (eti->renderers_can_change_size) {
+ if (eti->renderers_can_change_size &&
+ eti->height_cache && eti->height_cache[row] != -1 &&
+ eti_row_height_real(eti, row) != eti->height_cache[row]) {
eti_table_model_changed (table_model, eti);
return;
}
@@ -694,13 +698,32 @@ eti_table_model_cell_changed (ETableModel *table_model, int col, int row, ETable
static void
eti_table_model_row_inserted (ETableModel *table_model, int row, ETableItem *eti)
{
- eti_table_model_changed (table_model, eti);
+ eti->rows = e_table_model_row_count (eti->table_model);
+
+ if (eti->height_cache) {
+ eti->height_cache = g_renew(int, eti->height_cache, eti->rows);
+ memmove(eti->height_cache + row + 1, eti->height_cache + row, (eti->rows - 1 - row) * sizeof(int));
+ eti->height_cache[row] = -1;
+ }
+
+ eti->needs_compute_height = 1;
+ e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (eti));
+ eti->needs_redraw = 1;
+ gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (eti));
}
static void
eti_table_model_row_deleted (ETableModel *table_model, int row, ETableItem *eti)
{
- eti_table_model_changed (table_model, eti);
+ eti->rows = e_table_model_row_count (eti->table_model);
+
+ if (eti->height_cache)
+ memmove(eti->height_cache + row, eti->height_cache + row + 1, (eti->rows - row) * sizeof(int));
+
+ eti->needs_compute_height = 1;
+ e_canvas_item_request_reflow (GNOME_CANVAS_ITEM (eti));
+ eti->needs_redraw = 1;
+ gnome_canvas_item_request_update (GNOME_CANVAS_ITEM (eti));
}
void