aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/table')
-rw-r--r--widgets/table/e-cell-date-edit.c1
-rw-r--r--widgets/table/e-cell-pixbuf.c6
-rw-r--r--widgets/table/e-cell-text.c13
-rw-r--r--widgets/table/e-cell-toggle.c30
-rw-r--r--widgets/table/e-table-group-container.c9
-rw-r--r--widgets/table/e-table-group.c1
-rw-r--r--widgets/table/e-table-header-item.c2
-rw-r--r--widgets/table/e-table-header-utils.c2
-rw-r--r--widgets/table/e-table-header.c2
-rw-r--r--widgets/table/e-table-item.c8
-rw-r--r--widgets/table/e-tree.c2
11 files changed, 15 insertions, 61 deletions
diff --git a/widgets/table/e-cell-date-edit.c b/widgets/table/e-cell-date-edit.c
index 88b077595e..39443c3960 100644
--- a/widgets/table/e-cell-date-edit.c
+++ b/widgets/table/e-cell-date-edit.c
@@ -679,7 +679,6 @@ e_cell_date_edit_get_popup_pos (ECellDateEdit *ecde,
if (*y - row_height > avail_height) {
/* We don't, so we show the popup above the cell
instead of below it. */
- avail_height = *y - row_height;
*y -= (popup_requisition.height + row_height);
if (*y < 0)
*y = 0;
diff --git a/widgets/table/e-cell-pixbuf.c b/widgets/table/e-cell-pixbuf.c
index 666f556ec3..3f7ee1d378 100644
--- a/widgets/table/e-cell-pixbuf.c
+++ b/widgets/table/e-cell-pixbuf.c
@@ -114,7 +114,7 @@ pixbuf_draw (ECellView *ecell_view, GdkDrawable *drawable,
gint x1, gint y1, gint x2, gint y2)
{
GdkPixbuf *cell_pixbuf;
- gint real_x, real_y, real_w, real_h;
+ gint real_x, real_y;
gint pix_w, pix_h;
cairo_t *cr;
@@ -136,19 +136,15 @@ pixbuf_draw (ECellView *ecell_view, GdkDrawable *drawable,
if (x2 - x1 > pix_w) {
gint diff = (x2 - x1) - pix_w;
real_x = x1 + diff/2;
- real_w = pix_w;
} else {
real_x = x1;
- real_w = x2 - x1;
}
if (y2 - y1 > pix_h) {
gint diff = (y2 - y1) - pix_h;
real_y = y1 + diff/2;
- real_h = pix_h;
} else {
real_y = y1;
- real_h = y2 - y1;
}
cr = gdk_cairo_create (drawable);
diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c
index 24f7dc5cd8..852f8ec980 100644
--- a/widgets/table/e-cell-text.c
+++ b/widgets/table/e-cell-text.c
@@ -1299,17 +1299,6 @@ ect_free_state (ECellView *ecell_view, gint model_col, gint view_col, gint row,
g_free (save_state);
}
-#define FONT_NAME "Sans Regular"
-
-static PangoFontDescription *
-get_font_description_for_size (double h)
-{
- PangoFontDescription *font_des = pango_font_description_new ();
- pango_font_description_set_family (font_des, FONT_NAME);
- pango_font_description_set_size (font_des, h * PANGO_SCALE);
- return font_des;
-}
-
static void
get_font_size (PangoLayout *layout, PangoFontDescription *font, const gchar *text,
double *width, double *height)
@@ -1334,7 +1323,7 @@ ect_print (ECellView *ecell_view, GtkPrintContext *context,
gint model_col, gint view_col, gint row,
double width, double height)
{
- PangoFontDescription *font_des = get_font_description_for_size (12);
+ PangoFontDescription *font_des;
PangoLayout *layout;
PangoContext *pango_context;
PangoFontMetrics *font_metrics;
diff --git a/widgets/table/e-cell-toggle.c b/widgets/table/e-cell-toggle.c
index 4903602763..a03eed037e 100644
--- a/widgets/table/e-cell-toggle.c
+++ b/widgets/table/e-cell-toggle.c
@@ -199,16 +199,13 @@ cell_toggle_draw (ECellView *ecell_view,
gint y2)
{
ECellTogglePrivate *priv;
- ECellToggleView *toggle_view;
GdkPixbuf *image;
- gint x, y, width, height;
- gint cache_seq;
+ gint x, y;
cairo_t *cr;
const gint value = GPOINTER_TO_INT (
e_table_model_value_at (ecell_view->e_table_model, model_col, row));
- toggle_view = (ECellToggleView *) ecell_view;
priv = E_CELL_TOGGLE_GET_PRIVATE (ecell_view->ecell);
if (value < 0 || value >= priv->pixbufs->len) {
@@ -217,34 +214,17 @@ cell_toggle_draw (ECellView *ecell_view,
return;
}
- if (flags & E_CELL_SELECTED) {
- if (GTK_WIDGET_HAS_FOCUS (toggle_view->canvas))
- cache_seq = 0;
- else
- cache_seq = 1;
- } else
- cache_seq = 2;
-
- if (E_TABLE_ITEM (ecell_view->e_table_item_view)->alternating_row_colors && (row % 2) == 0)
- cache_seq += 3;
-
image = g_ptr_array_index (priv->pixbufs, value);
- if ((x2 - x1) < gdk_pixbuf_get_width (image)) {
+ if ((x2 - x1) < gdk_pixbuf_get_width (image))
x = x1;
- width = x2 - x1;
- } else {
+ else
x = x1 + ((x2 - x1) - gdk_pixbuf_get_width (image)) / 2;
- width = gdk_pixbuf_get_width (image);
- }
- if ((y2 - y1) < gdk_pixbuf_get_height (image)) {
+ if ((y2 - y1) < gdk_pixbuf_get_height (image))
y = y1;
- height = y2 - y1;
- } else {
+ else
y = y1 + ((y2 - y1) - gdk_pixbuf_get_height (image)) / 2;
- height = gdk_pixbuf_get_height (image);
- }
cr = gdk_cairo_create (drawable);
cairo_save (cr);
diff --git a/widgets/table/e-table-group-container.c b/widgets/table/e-table-group-container.c
index 43513ddc89..2552cb6789 100644
--- a/widgets/table/e-table-group-container.c
+++ b/widgets/table/e-table-group-container.c
@@ -609,7 +609,7 @@ static void
etgc_increment (ETableGroup *etg, gint position, gint amount)
{
ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER(etg);
- GList *list = etgc->children;
+ GList *list;
for (list = etgc->children; list; list = g_list_next (list))
e_table_group_increment (((ETableGroupContainerChildNode *)list->data)->child,
@@ -620,7 +620,7 @@ static void
etgc_decrement (ETableGroup *etg, gint position, gint amount)
{
ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER(etg);
- GList *list = etgc->children;
+ GList *list;
for (list = etgc->children; list; list = g_list_next (list))
e_table_group_decrement (((ETableGroupContainerChildNode *)list->data)->child,
@@ -1116,7 +1116,7 @@ e_table_group_apply_to_leafs (ETableGroup *etg, ETableGroupLeafFn fn, gpointer c
{
if (E_IS_TABLE_GROUP_CONTAINER (etg)) {
ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg);
- GList *list = etgc->children;
+ GList *list;
/* Protect from unrefs in the callback functions */
g_object_ref (etg);
@@ -1168,7 +1168,7 @@ e_table_group_container_print_page (EPrintable *ep,
ETGCPrintContext *groupcontext)
{
cairo_t *cr;
- gdouble yd = height;
+ gdouble yd;
gdouble child_height;
ETableGroupContainerChildNode *child_node;
GList *child;
@@ -1180,7 +1180,6 @@ e_table_group_container_print_page (EPrintable *ep,
child_printable = groupcontext->child_printable;
child = groupcontext->child;
yd = 6.5 * 72;
- height = 5 * 72;
if (child_printable) {
if (child)
diff --git a/widgets/table/e-table-group.c b/widgets/table/e-table-group.c
index ebf861657c..7193ab87c6 100644
--- a/widgets/table/e-table-group.c
+++ b/widgets/table/e-table-group.c
@@ -601,6 +601,7 @@ etg_event (GnomeCanvasItem *item, GdkEvent *event)
case GDK_FOCUS_CHANGE:
etg->has_focus = event->focus_change.in;
return_val = FALSE;
+ break;
default:
return_val = FALSE;
diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c
index 067ce72c4b..0ea785bc86 100644
--- a/widgets/table/e-table-header-item.c
+++ b/widgets/table/e-table-header-item.c
@@ -1516,7 +1516,6 @@ static void
ethi_header_context_menu (ETableHeaderItem *ethi, GdkEventButton *event)
{
EthiHeaderInfo *info = g_new (EthiHeaderInfo, 1);
- ETableCol *col;
GtkMenu *popup;
gint ncol, sort_count, sort_col;
GtkWidget *menu_item, *sub_menu;
@@ -1526,7 +1525,6 @@ ethi_header_context_menu (ETableHeaderItem *ethi, GdkEventButton *event)
info->ethi = ethi;
info->col = ethi_find_col_by_x (ethi, event->x);
- col = e_table_header_get_column (ethi->eth, info->col);
popup = e_popup_menu_create_with_domain (ethi_context_menu,
1 +
diff --git a/widgets/table/e-table-header-utils.c b/widgets/table/e-table-header-utils.c
index c6e694da2e..f2a3c1a826 100644
--- a/widgets/table/e-table-header-utils.c
+++ b/widgets/table/e-table-header-utils.c
@@ -472,8 +472,6 @@ e_table_header_draw_button (GdkDrawable *drawable, ETableCol *ecol,
inner_x + inner_width - arrow_width,
inner_y + (inner_height - arrow_height) / 2,
arrow_width, arrow_height);
-
- inner_width -= arrow_width + HEADER_PADDING;
break;
}
diff --git a/widgets/table/e-table-header.c b/widgets/table/e-table-header.c
index 1016acf5c0..8d382f5a92 100644
--- a/widgets/table/e-table-header.c
+++ b/widgets/table/e-table-header.c
@@ -790,8 +790,6 @@ eth_set_size (ETableHeader *eth, gint idx, gint size)
return;
}
- /* Remove from total_extra the amount used for this column. */
- total_extra -= size - (eth->columns[idx]->min_width + eth->width_extras);
for (i = idx + 1; i < eth->col_count; i++) {
if (eth->columns[idx]->resizable) {
/* old_expansion != 0 by (2) */
diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c
index 8b94ad8833..006c5c02cf 100644
--- a/widgets/table/e-table-item.c
+++ b/widgets/table/e-table-item.c
@@ -1752,8 +1752,8 @@ eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, gint x, gint y, gint wid
* First column to draw, last column to draw
*/
first_col = -1;
- last_col = x_offset = 0;
- x1 = x2 = floor (eti_base.x);
+ x_offset = 0;
+ x1 = floor (eti_base.x);
for (col = 0; col < cols; col++, x1 = x2) {
ETableCol *ecol = e_table_header_get_column (eti->header, col);
@@ -3443,10 +3443,8 @@ e_table_item_print_page (EPrintable *ep,
gp_draw_rect(context, xd, height, 1, yd - height);
}
- if (next_page) {
+ if (next_page)
cairo_show_page (cr);
- next_page = 0;
- }
g_free (widths);
}
diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c
index ba50be0625..d612fc93bc 100644
--- a/widgets/table/e-tree.c
+++ b/widgets/table/e-tree.c
@@ -506,8 +506,6 @@ et_search_search (ETableSearch *search, gchar *string, ETableSearchFlags flags,
e_tree_table_adapter_show_node (et->priv->etta, found);
model_row = e_tree_table_adapter_row_of_node (et->priv->etta, found);
- cursor = found;
-
e_selection_model_select_as_key_press(E_SELECTION_MODEL (et->priv->selection), model_row, col->col_idx, GDK_CONTROL_MASK);
return TRUE;
} else if (cursor && !(flags & E_TABLE_SEARCH_FLAGS_CHECK_CURSOR_FIRST)) {