aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorMichel Dänzer <daenzer@debian.org>2010-04-30 20:54:13 +0800
committerMilan Crha <mcrha@redhat.com>2010-04-30 20:54:13 +0800
commit2214b6049d9402f91567d1bea66259b29993ae9f (patch)
treecea88e543510d753a65c94ea52814538e05af9f1 /widgets
parent5a2dda78f9118af6d56cbb23b0bcb223f3193732 (diff)
downloadgsoc2013-evolution-2214b6049d9402f91567d1bea66259b29993ae9f.tar
gsoc2013-evolution-2214b6049d9402f91567d1bea66259b29993ae9f.tar.gz
gsoc2013-evolution-2214b6049d9402f91567d1bea66259b29993ae9f.tar.bz2
gsoc2013-evolution-2214b6049d9402f91567d1bea66259b29993ae9f.tar.lz
gsoc2013-evolution-2214b6049d9402f91567d1bea66259b29993ae9f.tar.xz
gsoc2013-evolution-2214b6049d9402f91567d1bea66259b29993ae9f.tar.zst
gsoc2013-evolution-2214b6049d9402f91567d1bea66259b29993ae9f.zip
Bug #614346 - Use cached table row height rather than recalculate
Diffstat (limited to 'widgets')
-rw-r--r--widgets/table/e-table-item.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c
index b2c27590c7..381f0cd24c 100644
--- a/widgets/table/e-table-item.c
+++ b/widgets/table/e-table-item.c
@@ -749,14 +749,14 @@ eti_get_height (ETableItem *eti)
return 0;
if (eti->uniform_row_height) {
- gint row_height = eti_row_height(eti, -1);
+ gint row_height = ETI_ROW_HEIGHT(eti, -1);
return ((row_height + height_extra) * rows + height_extra);
} else {
gint height;
gint row;
if (eti->length_threshold != -1) {
if (rows > eti->length_threshold) {
- gint row_height = eti_row_height(eti, 0);
+ gint row_height = ETI_ROW_HEIGHT(eti, 0);
if (eti->height_cache) {
height = 0;
for (row = 0; row < rows; row++) {
@@ -768,7 +768,7 @@ eti_get_height (ETableItem *eti)
height += eti->height_cache[row] + height_extra;
}
} else
- height = (eti_row_height (eti, 0) + height_extra) * rows;
+ height = (ETI_ROW_HEIGHT (eti, 0) + height_extra) * rows;
/*
* 1 pixel at the top
@@ -779,7 +779,7 @@ eti_get_height (ETableItem *eti)
height = height_extra;
for (row = 0; row < rows; row++)
- height += eti_row_height (eti, row) + height_extra;
+ height += ETI_ROW_HEIGHT (eti, row) + height_extra;
return height;
}
@@ -817,12 +817,12 @@ e_table_item_row_diff (ETableItem *eti, gint start_row, gint end_row)
end_row = eti->rows;
if (eti->uniform_row_height) {
- return ((end_row - start_row) * (eti_row_height(eti, -1) + height_extra));
+ return ((end_row - start_row) * (ETI_ROW_HEIGHT(eti, -1) + height_extra));
} else {
gint row, total;
total = 0;
for (row = start_row; row < end_row; row++)
- total += eti_row_height (eti, row) + height_extra;
+ total += ETI_ROW_HEIGHT (eti, row) + height_extra;
return total;
}
@@ -1791,11 +1791,11 @@ eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, gint x, gint y, gint wid
* Compute row span.
*/
if (eti->uniform_row_height) {
- first_row = (y - floor (eti_base.y) - height_extra) / (eti_row_height (eti, -1) + height_extra);
- last_row = (y + height - floor (eti_base.y) ) / (eti_row_height (eti, -1) + height_extra) + 1;
+ first_row = (y - floor (eti_base.y) - height_extra) / (ETI_ROW_HEIGHT (eti, -1) + height_extra);
+ last_row = (y + height - floor (eti_base.y) ) / (ETI_ROW_HEIGHT (eti, -1) + height_extra) + 1;
if (first_row > last_row)
goto exit;
- y_offset = floor (eti_base.y) - y + height_extra + first_row * (eti_row_height (eti, -1) + height_extra);
+ y_offset = floor (eti_base.y) - y + height_extra + first_row * (ETI_ROW_HEIGHT (eti, -1) + height_extra);
if (first_row < 0)
first_row = 0;
if (last_row > eti->rows)
@@ -2076,8 +2076,8 @@ find_cell (ETableItem *eti, gdouble x, gdouble y, gint *view_col_res, gint *view
if (eti->uniform_row_height) {
if (y < height_extra)
return FALSE;
- row = (y - height_extra) / (eti_row_height (eti, -1) + height_extra);
- y1 = row * (eti_row_height (eti, -1) + height_extra) + height_extra;
+ row = (y - height_extra) / (ETI_ROW_HEIGHT (eti, -1) + height_extra);
+ y1 = row * (ETI_ROW_HEIGHT (eti, -1) + height_extra) + height_extra;
if (row >= eti->rows)
return FALSE;
} else {