diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-07-19 02:05:05 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-07-19 02:05:38 +0800 |
commit | dcf2c0e754d6e251733cea74c2427738122620af (patch) | |
tree | 358d2c639c2a5b5cf5fc8f28c515076f8b4d4e5d /widgets | |
parent | 76fc1247ba88575c0f6e0040672e19e66f53da4f (diff) | |
download | gsoc2013-evolution-dcf2c0e754d6e251733cea74c2427738122620af.tar.gz gsoc2013-evolution-dcf2c0e754d6e251733cea74c2427738122620af.tar.zst gsoc2013-evolution-dcf2c0e754d6e251733cea74c2427738122620af.zip |
More whitespace cleanup.
Diffstat (limited to 'widgets')
44 files changed, 239 insertions, 241 deletions
diff --git a/widgets/menus/gal-define-views-dialog.c b/widgets/menus/gal-define-views-dialog.c index 3670218456..148960e4d5 100644 --- a/widgets/menus/gal-define-views-dialog.c +++ b/widgets/menus/gal-define-views-dialog.c @@ -391,7 +391,7 @@ gal_define_views_dialog_set_property (GObject *object, guint prop_id, const GVal dialog = GAL_DEFINE_VIEWS_DIALOG (object); - switch (prop_id){ + switch (prop_id) { case PROP_COLLECTION: if (g_value_get_object (value)) gal_define_views_dialog_set_collection(dialog, GAL_VIEW_COLLECTION(g_value_get_object (value))); diff --git a/widgets/menus/gal-define-views-model.c b/widgets/menus/gal-define-views-model.c index a977e0a787..e5425f7552 100644 --- a/widgets/menus/gal-define-views-model.c +++ b/widgets/menus/gal-define-views-model.c @@ -213,7 +213,7 @@ gal_define_views_model_set_property (GObject *object, guint prop_id, const GValu model = GAL_DEFINE_VIEWS_MODEL (object); - switch (prop_id){ + switch (prop_id) { case PROP_EDITABLE: model->editable = g_value_get_boolean (value); break; diff --git a/widgets/menus/gal-view-new-dialog.c b/widgets/menus/gal-view-new-dialog.c index 7fc263d9bd..e2f62c7e99 100644 --- a/widgets/menus/gal-view-new-dialog.c +++ b/widgets/menus/gal-view-new-dialog.c @@ -241,7 +241,7 @@ gal_view_new_dialog_set_property (GObject *object, guint prop_id, const GValue * dialog = GAL_VIEW_NEW_DIALOG (object); - switch (prop_id){ + switch (prop_id) { case PROP_NAME: entry = glade_xml_get_widget(dialog->gui, "entry-name"); if (entry && GTK_IS_ENTRY(entry)) { diff --git a/widgets/misc/e-canvas-background.c b/widgets/misc/e-canvas-background.c index 41b03d7f65..04c163ef06 100644 --- a/widgets/misc/e-canvas-background.c +++ b/widgets/misc/e-canvas-background.c @@ -212,7 +212,7 @@ ecb_set_property (GObject *object, item = GNOME_CANVAS_ITEM (object); ecb = E_CANVAS_BACKGROUND (object); - switch (prop_id){ + switch (prop_id) { case PROP_FILL_COLOR: if (g_value_get_string (value)) gdk_color_parse (g_value_get_string (value), &color); @@ -288,7 +288,7 @@ ecb_get_property (GObject *object, ecb = E_CANVAS_BACKGROUND (object); - switch (prop_id){ + switch (prop_id) { case PROP_FILL_COLOR_GDK: g_value_set_boxed (value, gdk_color_copy (&ecb->priv->color)); break; diff --git a/widgets/misc/e-canvas-vbox.c b/widgets/misc/e-canvas-vbox.c index a7e8191bc4..af159b2000 100644 --- a/widgets/misc/e-canvas-vbox.c +++ b/widgets/misc/e-canvas-vbox.c @@ -126,7 +126,7 @@ e_canvas_vbox_set_property (GObject *object, guint prop_id, const GValue *value, item = GNOME_CANVAS_ITEM (object); e_canvas_vbox = E_CANVAS_VBOX (object); - switch (prop_id){ + switch (prop_id) { case PROP_WIDTH: case PROP_MINIMUM_WIDTH: e_canvas_vbox->minimum_width = g_value_get_double (value); @@ -329,7 +329,7 @@ e_canvas_vbox_reflow( GnomeCanvasItem *item, gint flags ) max_width = item_width; list = g_list_next(list); - for(; list; list = g_list_next(list)) { + for (; list; list = g_list_next(list)) { running_height += e_canvas_vbox->spacing; g_object_get (list->data, diff --git a/widgets/misc/e-combo-button.c b/widgets/misc/e-combo-button.c index f482f06094..3caf793611 100644 --- a/widgets/misc/e-combo-button.c +++ b/widgets/misc/e-combo-button.c @@ -452,7 +452,7 @@ e_combo_button_pack_hbox (EComboButton *combo_button) priv = combo_button->priv; - if(priv->is_already_packed){ + if (priv->is_already_packed) { gtk_widget_destroy (priv->hbox); } @@ -487,7 +487,7 @@ e_combo_button_pack_vbox (EComboButton *combo_button) priv = combo_button->priv; - if(priv->is_already_packed){ + if (priv->is_already_packed) { gtk_widget_destroy (priv->hbox); } diff --git a/widgets/misc/e-cursors.c b/widgets/misc/e-cursors.c index e8f4221b60..4ec2717d1c 100644 --- a/widgets/misc/e-cursors.c +++ b/widgets/misc/e-cursors.c @@ -80,12 +80,12 @@ create_bitmap_and_mask_from_xpm (GdkBitmap **bitmap, GdkBitmap **mask, const gch black_color = '.'; yofs = colors + 1; - for (y = 0; y < 32; y++){ - for (x = 0; x < 32;){ + for (y = 0; y < 32; y++) { + for (x = 0; x < 32;) { gchar value = 0, maskv = 0; - for (pix = 0; pix < 8; pix++, x++){ - if (xpm [y + yofs][x] != transparent_color){ + for (pix = 0; pix < 8; pix++, x++) { + if (xpm [y + yofs][x] != transparent_color) { maskv |= 1 << pix; /* @@ -94,7 +94,7 @@ create_bitmap_and_mask_from_xpm (GdkBitmap **bitmap, GdkBitmap **mask, const gch * We reverse the foreground & background in the next * routine to compensate. */ - if (xpm [y + yofs][x] == black_color){ + if (xpm [y + yofs][x] == black_color) { value |= 1 << pix; } } @@ -114,7 +114,7 @@ e_cursors_init (void) e_color_init (); - for (i = 0; cursors [i].hot_x; i++){ + for (i = 0; cursors [i].hot_x; i++) { if (cursors [i].hot_x < 0) cursors [i].cursor = gdk_cursor_new (cursors [i].hot_y); else { diff --git a/widgets/misc/e-dateedit.c b/widgets/misc/e-dateedit.c index e7b1a0555e..775ab3b8a3 100644 --- a/widgets/misc/e-dateedit.c +++ b/widgets/misc/e-dateedit.c @@ -200,7 +200,7 @@ e_date_edit_get_type (void) { static GType date_edit_type = 0; - if (!date_edit_type){ + if (!date_edit_type) { static const GTypeInfo date_edit_info = { sizeof (EDateEditClass), NULL, /* base_init */ diff --git a/widgets/misc/e-gui-utils.c b/widgets/misc/e-gui-utils.c index 6cd4958127..d33e3c1139 100644 --- a/widgets/misc/e-gui-utils.c +++ b/widgets/misc/e-gui-utils.c @@ -50,7 +50,7 @@ e_popup_menu (GtkMenu *menu, GdkEvent *event) else if ((event->type == GDK_BUTTON_PRESS) || (event->type == GDK_BUTTON_RELEASE) || (event->type == GDK_2BUTTON_PRESS) || - (event->type == GDK_3BUTTON_PRESS)){ + (event->type == GDK_3BUTTON_PRESS)) { gtk_menu_popup (menu, NULL, NULL, NULL, NULL, event->button.button, event->button.time); diff --git a/widgets/misc/e-icon-entry.c b/widgets/misc/e-icon-entry.c index 90130ccbd6..87b89f61d5 100644 --- a/widgets/misc/e-icon-entry.c +++ b/widgets/misc/e-icon-entry.c @@ -393,7 +393,6 @@ e_icon_entry_create_text (const gchar *text) return eventbox; } - GtkWidget * e_icon_entry_create_separator () { diff --git a/widgets/misc/e-popup-menu.c b/widgets/misc/e-popup-menu.c index 129a52e0ca..953d0c67dd 100644 --- a/widgets/misc/e-popup-menu.c +++ b/widgets/misc/e-popup-menu.c @@ -53,7 +53,7 @@ make_item (GtkMenu *menu, GtkMenuItem *item, const gchar *name, GtkWidget *pixma gtk_container_add (GTK_CONTAINER (item), label); - if (pixmap && GTK_IS_IMAGE_MENU_ITEM (item)){ + if (pixmap && GTK_IS_IMAGE_MENU_ITEM (item)) { gtk_widget_show (pixmap); gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), pixmap); } diff --git a/widgets/misc/e-reflow.c b/widgets/misc/e-reflow.c index 63e92dbe2b..794e650ea1 100644 --- a/widgets/misc/e-reflow.c +++ b/widgets/misc/e-reflow.c @@ -710,7 +710,7 @@ e_reflow_set_property (GObject *object, guint prop_id, const GValue *value, GPar item = GNOME_CANVAS_ITEM (object); reflow = E_REFLOW (object); - switch (prop_id){ + switch (prop_id) { case PROP_HEIGHT: reflow->height = g_value_get_double (value); reflow->need_reflow_columns = TRUE; @@ -839,7 +839,7 @@ e_reflow_realize (GnomeCanvasItem *item) reflow->default_cursor = gdk_cursor_new (GDK_LEFT_PTR); count = reflow->count; - for(i = 0; i < count; i++) { + for (i = 0; i < count; i++) { if (reflow->items[i]) gnome_canvas_item_set(reflow->items[i], "width", reflow->column_width, @@ -899,7 +899,7 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) reflow = E_REFLOW (item); - switch( event->type ) + switch ( event->type ) { case GDK_KEY_PRESS: return_val = e_selection_model_key_press(reflow->selection, (GdkEventKey *) event); @@ -946,7 +946,7 @@ e_reflow_event (GnomeCanvasItem *item, GdkEvent *event) } #endif case GDK_BUTTON_PRESS: - switch(event->button.button) + switch (event->button.button) { case 1: { diff --git a/widgets/misc/e-search-bar.c b/widgets/misc/e-search-bar.c index 36e0e6dc52..0a778531b7 100644 --- a/widgets/misc/e-search-bar.c +++ b/widgets/misc/e-search-bar.c @@ -77,10 +77,10 @@ static void emit_query_changed (ESearchBar *esb); static void esb_paint_label (GtkWidget *label, gboolean active) { - static char *sens = NULL; - static char *insens = NULL; - char *text; - + static gchar *sens = NULL; + static gchar *insens = NULL; + gchar *text; + if (!label) return; @@ -564,7 +564,7 @@ scopeoption_changed_cb (GtkWidget *option_menu, ESearchBar *search_bar) if (!(text && *text)) gtk_widget_grab_focus (search_bar->entry); - if(!search_bar->block_search) + if (!search_bar->block_search) emit_query_changed (search_bar); g_free (text); @@ -985,7 +985,6 @@ idle_activate_hack (gpointer ptr) return FALSE; } - void e_search_bar_construct (ESearchBar *search_bar, ESearchBarItem *menu_items, diff --git a/widgets/misc/e-selection-model-array.c b/widgets/misc/e-selection-model-array.c index 84a18eb925..9a2a6a8e68 100644 --- a/widgets/misc/e-selection-model-array.c +++ b/widgets/misc/e-selection-model-array.c @@ -194,7 +194,7 @@ esma_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *ps { ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY (object); - switch (prop_id){ + switch (prop_id) { case PROP_CURSOR_ROW: g_value_set_int (value, esma->cursor_row); break; @@ -211,7 +211,7 @@ esma_set_property (GObject *object, guint prop_id, const GValue *value, GParamSp ESelectionModel *esm = E_SELECTION_MODEL (object); ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY (object); - switch (prop_id){ + switch (prop_id) { case PROP_CURSOR_ROW: e_selection_model_do_something(esm, g_value_get_int (value), esma->cursor_col, 0); break; diff --git a/widgets/misc/e-selection-model.c b/widgets/misc/e-selection-model.c index cc1d3b3780..fb43d73ffb 100644 --- a/widgets/misc/e-selection-model.c +++ b/widgets/misc/e-selection-model.c @@ -84,7 +84,7 @@ esm_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *psp { ESelectionModel *esm = E_SELECTION_MODEL (object); - switch (prop_id){ + switch (prop_id) { case PROP_SORTER: g_value_set_object (value, esm->sorter); break; @@ -104,7 +104,7 @@ esm_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpe { ESelectionModel *esm = E_SELECTION_MODEL (object); - switch (prop_id){ + switch (prop_id) { case PROP_SORTER: drop_sorter(esm); add_sorter(esm, g_value_get_object (value) ? E_SORTER(g_value_get_object(value)) : NULL); diff --git a/widgets/misc/e-send-options.c b/widgets/misc/e-send-options.c index eff79544fd..aa6c41e6d2 100644 --- a/widgets/misc/e-send-options.c +++ b/widgets/misc/e-send-options.c @@ -249,7 +249,7 @@ sensitize_widgets (ESendOptionsDialog *sod) if (!gopts->expiration_enabled) gtk_widget_set_sensitive (priv->expire_after, FALSE); - if (!gopts->delay_enabled){ + if (!gopts->delay_enabled) { gtk_widget_set_sensitive (priv->delay_until, FALSE); } diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c index e2b0f991b3..f960760189 100644 --- a/widgets/table/e-cell-text.c +++ b/widgets/table/e-cell-text.c @@ -290,7 +290,7 @@ ect_stop_editing (ECellTextView *text_view, gboolean commit) text = edit->text; if (edit->tep) g_object_unref (edit->tep); - if (! edit->default_cursor_shown){ + if (! edit->default_cursor_shown) { gdk_window_set_cursor (GTK_WIDGET(text_view->canvas)->window, NULL); edit->default_cursor_shown = TRUE; } @@ -412,7 +412,7 @@ ect_unrealize (ECellView *ecv) g_object_unref (text_view->gc); text_view->gc = NULL; - if (text_view->edit){ + if (text_view->edit) { ect_cancel_edit (text_view); } @@ -979,7 +979,7 @@ ect_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col return 1; } - if (event->key.keyval == GDK_Escape){ + if (event->key.keyval == GDK_Escape) { /* if not changed, then pass this even to parent */ return_val = text_view->edit != NULL && text_view->edit->text && text_view->edit->old_text && 0 != strcmp (text_view->edit->text, text_view->edit->old_text); ect_cancel_edit (text_view); @@ -1109,7 +1109,7 @@ ect_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col edit->pointer_in = TRUE; #endif if (edit_display) { - if (edit->default_cursor_shown){ + if (edit->default_cursor_shown) { gdk_window_set_cursor (canvas->window, text_view->i_cursor); edit->default_cursor_shown = FALSE; } @@ -1120,7 +1120,7 @@ ect_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_col text_view->pointer_in = FALSE; #endif if (edit_display) { - if (! edit->default_cursor_shown){ + if (! edit->default_cursor_shown) { gdk_window_set_cursor (canvas->window, NULL); edit->default_cursor_shown = TRUE; } @@ -1213,8 +1213,8 @@ ect_enter_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row) edit->text = g_strdup (edit->old_text); #if 0 - if (edit->pointer_in){ - if (edit->default_cursor_shown){ + if (edit->pointer_in) { + if (edit->default_cursor_shown) { gdk_window_set_cursor (GTK_WIDGET(item->canvas)->window, text_view->i_cursor); edit->default_cursor_shown = FALSE; } @@ -1234,7 +1234,7 @@ ect_leave_edit (ECellView *ecell_view, gint model_col, gint view_col, gint row, ECellTextView *text_view = (ECellTextView *) ecell_view; CellEdit *edit = text_view->edit; - if (edit){ + if (edit) { ect_stop_editing (text_view, TRUE); } else { /* @@ -1968,9 +1968,9 @@ e_cell_text_delete_surrounding_cb (GtkIMContext *context, edit->text + MIN (edit->selection_start, edit->selection_end)); begin_pos += offset; end_pos = begin_pos + n_chars; - if(begin_pos < 0 || text_len < begin_pos) + if (begin_pos < 0 || text_len < begin_pos) return FALSE; - if(end_pos > text_len) + if (end_pos > text_len) end_pos = text_len; edit->selection_start = g_utf8_offset_to_pointer (edit->text, begin_pos) - edit->text; @@ -2009,9 +2009,9 @@ e_cell_text_init (ECellText *ect) ECell * e_cell_text_construct (ECellText *cell, const gchar *fontname, GtkJustification justify) { - if(!cell) + if (!cell) return E_CELL(NULL); - if(fontname) + if (fontname) cell->font_name = g_strdup (fontname); cell->justify = justify; return E_CELL(cell); @@ -2143,7 +2143,7 @@ _blink_scroll_timeout (gpointer data) redraw = TRUE; edit->show_cursor = FALSE; } - if (redraw){ + if (redraw) { ect_queue_redraw (text_view, edit->view_col, edit->row); } return TRUE; @@ -2561,7 +2561,7 @@ e_cell_text_view_command (ETextEventProcessor *tep, ETextEventProcessorCommand * } } - if (redraw){ + if (redraw) { ect_queue_redraw (text_view, edit->view_col, edit->row); } } diff --git a/widgets/table/e-cell-toggle.c b/widgets/table/e-cell-toggle.c index b1748b4350..45e6c50651 100644 --- a/widgets/table/e-cell-toggle.c +++ b/widgets/table/e-cell-toggle.c @@ -122,7 +122,7 @@ etog_draw (ECellView *ecell_view, GdkDrawable *drawable, const gint value = GPOINTER_TO_INT ( e_table_model_value_at (ecell_view->e_table_model, model_col, row)); - if (value < 0 || value >= toggle->n_states){ + if (value < 0 || value >= toggle->n_states) { g_warning ("Value from the table model is %d, the states we support are [0..%d)\n", value, toggle->n_states); return; @@ -141,7 +141,7 @@ etog_draw (ECellView *ecell_view, GdkDrawable *drawable, image = toggle->images[value]; - if ((x2 - x1) < gdk_pixbuf_get_width (image)){ + if ((x2 - x1) < gdk_pixbuf_get_width (image)) { x = x1; width = x2 - x1; } else { @@ -149,7 +149,7 @@ etog_draw (ECellView *ecell_view, GdkDrawable *drawable, 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 { @@ -194,7 +194,7 @@ etog_event (ECellView *ecell_view, GdkEvent *event, gint model_col, gint view_co return FALSE; #endif - switch (event->type){ + switch (event->type) { case GDK_KEY_PRESS: if (event->key.keyval != GDK_space) return FALSE; @@ -237,7 +237,7 @@ etog_print (ECellView *ecell_view, GtkPrintContext *context, e_table_model_value_at (ecell_view->e_table_model, model_col, row)); cairo_t *cr; - if (value >= toggle->n_states){ + if (value >= toggle->n_states) { g_warning ("Value from the table model is %d, the states we support are [0..%d)\n", value, toggle->n_states); return; @@ -360,7 +360,7 @@ e_cell_toggle_construct (ECellToggle *etog, gint border, gint n_states, GdkPixbu etog->images = g_new (GdkPixbuf *, n_states); - for (i = 0; i < n_states; i++){ + for (i = 0; i < n_states; i++) { etog->images [i] = images [i]; if (images[i]) { g_object_ref (images [i]); diff --git a/widgets/table/e-table-click-to-add.c b/widgets/table/e-table-click-to-add.c index c2024e4bcb..3b9f6d7d8a 100644 --- a/widgets/table/e-table-click-to-add.c +++ b/widgets/table/e-table-click-to-add.c @@ -197,7 +197,7 @@ etcta_set_property (GObject *object, guint prop_id, const GValue *value, GParamS item = GNOME_CANVAS_ITEM (object); etcta = E_TABLE_CLICK_TO_ADD (object); - switch (prop_id){ + switch (prop_id) { case PROP_HEADER: etcta_drop_table_header (etcta); etcta_add_table_header (etcta, E_TABLE_HEADER(g_value_get_object (value))); @@ -267,7 +267,7 @@ etcta_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *p etcta = E_TABLE_CLICK_TO_ADD (object); - switch (prop_id){ + switch (prop_id) { case PROP_HEADER: g_value_set_object (value, etcta->eth); break; @@ -378,7 +378,7 @@ etcta_event (GnomeCanvasItem *item, GdkEvent *e) { ETableClickToAdd *etcta = E_TABLE_CLICK_TO_ADD (item); - switch (e->type){ + switch (e->type) { case GDK_FOCUS_CHANGE: if (!e->focus_change.in) return TRUE; diff --git a/widgets/table/e-table-column.c b/widgets/table/e-table-column.c index 0969a79410..699fe95e69 100644 --- a/widgets/table/e-table-column.c +++ b/widgets/table/e-table-column.c @@ -141,7 +141,7 @@ e_table_column_index (ETableColumn *etc, const gchar *identifier) g_return_val_if_fail (E_IS_TABLE_COLUMN (etc), 0); g_return_val_if_fail (identifier != NULL, 0); - for (i = 0; i < etc->col_count; i++){ + for (i = 0; i < etc->col_count; i++) { ETableCol *tc = etc->columns [i]; if (strcmp (i->id, identifier) == 0) @@ -161,7 +161,7 @@ e_table_column_get_index_at (ETableColumn *etc, gint x_offset) g_return_val_if_fail (identifier != NULL, 0); total = 0; - for (i = 0; i < etc->col_count; i++){ + for (i = 0; i < etc->col_count; i++) { total += etc->columns [i]->width; if (x_offset < total) @@ -205,7 +205,7 @@ ve_table_column_get_selected (ETableColumn *etc) g_return_val_if_fail (etc != NULL, 0); g_return_val_if_fail (E_IS_TABLE_COLUMN (etc), 0); - for (i = 0; i < etc->col_count; i++){ + for (i = 0; i < etc->col_count; i++) { if (etc->columns [i]->selected) selected++; } diff --git a/widgets/table/e-table-config.c b/widgets/table/e-table-config.c index 3de22f54f3..634cadafb3 100644 --- a/widgets/table/e-table-config.c +++ b/widgets/table/e-table-config.c @@ -237,7 +237,7 @@ find_column_in_spec (ETableSpecification *spec, gint model_col) { ETableColumnSpecification **column; - for (column = spec->columns; *column; column++){ + for (column = spec->columns; *column; column++) { if ((*column)->disabled) continue; if ((*column)->model_col != model_col) @@ -254,7 +254,7 @@ find_model_column_by_name (ETableSpecification *spec, const gchar *s) { ETableColumnSpecification **column; - for (column = spec->columns; *column; column++){ + for (column = spec->columns; *column; column++) { if ((*column)->disabled) continue; @@ -270,7 +270,7 @@ update_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort) ETableConfigSortWidgets *widgets; gint count, i; - if (is_sort){ + if (is_sort) { count = e_table_sort_info_sorting_get_count ( config->temp_state->sort_info); widgets = &config->sort [0]; @@ -280,7 +280,7 @@ update_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort) widgets = &config->group [0]; } - for (i = 0; i < 4; i++){ + for (i = 0; i < 4; i++) { gboolean sensitive = (i <= count); const gchar *text = ""; @@ -296,7 +296,7 @@ update_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort) widgets [i].combo, widgets [i].changed_id); - if (i < count){ + if (i < count) { GtkToggleButton *a, *d; ETableSortColumn col = is_sort @@ -310,7 +310,7 @@ update_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort) ETableColumnSpecification *column = find_column_in_spec (config->source_spec, col.column); - if (!column){ + if (!column) { /* * This is a bug in the programmer * stuff, but by the time we arrive @@ -372,7 +372,7 @@ config_sort_info_update (ETableConfig *config) ETableColumnSpecification *column; column = find_column_in_spec (config->source_spec, col.column); - if (!column){ + if (!column) { g_warning ("Could not find column model in specification"); continue; } @@ -414,7 +414,7 @@ config_group_info_update (ETableConfig *config) ETableColumnSpecification *column; column = find_column_in_spec (config->source_spec, col.column); - if (!column){ + if (!column) { g_warning ("Could not find model column in specification"); continue; } @@ -468,8 +468,8 @@ config_fields_info_update (ETableConfig *config) GString *res = g_string_new (""); gint i, j; - for (i = 0; i < config->state->col_count; i++){ - for (j = 0, column = config->source_spec->columns; *column; column++, j++){ + for (i = 0; i < config->state->col_count; i++) { + for (j = 0, column = config->source_spec->columns; *column; column++, j++) { if ((*column)->disabled) continue; @@ -513,9 +513,9 @@ do_sort_and_group_config_dialog (ETableConfig *config, gboolean is_sort) do { response = gtk_dialog_run (dialog); - switch (response){ + switch (response) { case 0: /* clear fields */ - if (is_sort){ + if (is_sort) { e_table_sort_info_sorting_truncate ( config->temp_state->sort_info, 0); } else { @@ -568,7 +568,7 @@ do_fields_config_dialog (ETableConfig *config) do { response = gtk_dialog_run (GTK_DIALOG(config->dialog_show_fields)); - switch (response){ + switch (response) { case GTK_RESPONSE_OK: g_object_unref (config->state); config->state = config->temp_state; @@ -787,7 +787,7 @@ sort_combo_changed (GtkComboBox *combo_box, ETableConfigSortWidgets *sort) gint col; col = find_model_column_by_name (config->source_spec, s); - if (col == -1){ + if (col == -1) { g_warning ("sort: This should not happen (%s)", s); g_free (s); return; @@ -827,7 +827,7 @@ configure_sort_dialog (ETableConfig *config, GladeXML *gui) GSList *l; gint i; - for (i = 0; i < 4; i++){ + for (i = 0; i < 4; i++) { gchar buffer [80]; snprintf (buffer, sizeof (buffer), "sort-combo-%d", i + 1); @@ -855,10 +855,10 @@ configure_sort_dialog (ETableConfig *config, GladeXML *gui) config->sort [i].e_table_config = config; } - for (l = config->column_names; l; l = l->next){ + for (l = config->column_names; l; l = l->next) { gchar *label = l->data; - for (i = 0; i < 4; i++){ + for (i = 0; i < 4; i++) { configure_combo_box_add ( GTK_COMBO_BOX (config->sort[i].combo), dgettext (config->domain, label), label); @@ -868,7 +868,7 @@ configure_sort_dialog (ETableConfig *config, GladeXML *gui) /* * After we have runtime modified things, signal connect */ - for (i = 0; i < 4; i++){ + for (i = 0; i < 4; i++) { config->sort [i].changed_id = g_signal_connect ( config->sort [i].combo, "changed", G_CALLBACK (sort_combo_changed), @@ -897,7 +897,7 @@ group_combo_changed (GtkComboBox *combo_box, ETableConfigSortWidgets *group) gint col; col = find_model_column_by_name (config->source_spec, s); - if (col == -1){ + if (col == -1) { g_warning ("grouping: this should not happen, %s", s); g_free (s); return; @@ -937,7 +937,7 @@ configure_group_dialog (ETableConfig *config, GladeXML *gui) GSList *l; gint i; - for (i = 0; i < 4; i++){ + for (i = 0; i < 4; i++) { gchar buffer [80]; snprintf (buffer, sizeof (buffer), "group-combo-%d", i + 1); @@ -972,10 +972,10 @@ configure_group_dialog (ETableConfig *config, GladeXML *gui) config->group [i].e_table_config = config; } - for (l = config->column_names; l; l = l->next){ + for (l = config->column_names; l; l = l->next) { gchar *label = l->data; - for (i = 0; i < 4; i++){ + for (i = 0; i < 4; i++) { configure_combo_box_add ( GTK_COMBO_BOX (config->group[i].combo), dgettext (config->domain, label), label); @@ -985,7 +985,7 @@ configure_group_dialog (ETableConfig *config, GladeXML *gui) /* * After we have runtime modified things, signal connect */ - for (i = 0; i < 4; i++){ + for (i = 0; i < 4; i++) { config->group [i].changed_id = g_signal_connect ( config->group [i].combo, "changed", G_CALLBACK (group_combo_changed), @@ -1293,7 +1293,7 @@ e_table_config_construct (ETableConfig *config, config->domain = g_strdup (spec->domain); - for (column = config->source_spec->columns; *column; column++){ + for (column = config->source_spec->columns; *column; column++) { gchar *label = (*column)->title; if ((*column)->disabled) @@ -1333,7 +1333,7 @@ e_table_config_new (const gchar *header, { ETableConfig *config = g_object_new (E_TABLE_CONFIG_TYPE, NULL); - if (e_table_config_construct (config, header, spec, state, parent_window) == NULL){ + if (e_table_config_construct (config, header, spec, state, parent_window) == NULL) { g_object_unref (config); return NULL; } diff --git a/widgets/table/e-table-example-1.c b/widgets/table/e-table-example-1.c index 39d9719b03..a45868bf72 100644 --- a/widgets/table/e-table-example-1.c +++ b/widgets/table/e-table-example-1.c @@ -208,7 +208,7 @@ create_table (void) ETableModel *e_table_model = NULL; /* First we fill in the simple data. */ - for (i = 0; i < ROWS; i++){ + for (i = 0; i < ROWS; i++) { for (j = 0; j < COLS; j++) table_data [i] [j] = g_strdup (""); } diff --git a/widgets/table/e-table-example-2.c b/widgets/table/e-table-example-2.c index f5dc15d74d..2c2cbe0ffe 100644 --- a/widgets/table/e-table-example-2.c +++ b/widgets/table/e-table-example-2.c @@ -148,13 +148,13 @@ my_row_count (ETableModel *etc, gpointer data) static gpointer my_value_at (ETableModel *etc, gint col, gint row, gpointer data) { - if (col == COLOR_COLUMN){ - if (importance_data[row]){ + if (col == COLOR_COLUMN) { + if (importance_data[row]) { return color1; } else { return color2; } - } else if (col == IMPORTANCE_COLUMN){ + } else if (col == IMPORTANCE_COLUMN) { return (gpointer) importance_data[row]; } else { return (gpointer) table_data [row][col]; @@ -164,8 +164,8 @@ my_value_at (ETableModel *etc, gint col, gint row, gpointer data) static void my_set_value_at (ETableModel *etc, gint col, gint row, gconstpointer val, gpointer data) { - if (col == COLOR_COLUMN){ - } else if (col == IMPORTANCE_COLUMN){ + if (col == COLOR_COLUMN) { + } else if (col == IMPORTANCE_COLUMN) { importance_data[row] = (gboolean) val; } else { g_free (table_data [row][col]); @@ -185,9 +185,9 @@ my_is_cell_editable (ETableModel *etc, gint col, gint row, gpointer data) static gpointer my_duplicate_value (ETableModel *etc, gint col, gconstpointer value, gpointer data) { - if (col == COLOR_COLUMN){ + if (col == COLOR_COLUMN) { return (gpointer) value; - } else if (col == IMPORTANCE_COLUMN){ + } else if (col == IMPORTANCE_COLUMN) { return (gpointer) value; } else { return g_strdup (value); @@ -197,8 +197,8 @@ my_duplicate_value (ETableModel *etc, gint col, gconstpointer value, gpointer da static void my_free_value (ETableModel *etc, gint col, gpointer value, gpointer data) { - if (col == COLOR_COLUMN){ - } else if (col == IMPORTANCE_COLUMN){ + if (col == COLOR_COLUMN) { + } else if (col == IMPORTANCE_COLUMN) { } else { g_free (value); } @@ -207,9 +207,9 @@ my_free_value (ETableModel *etc, gint col, gpointer value, gpointer data) static gpointer my_initialize_value (ETableModel *etc, gint col, gpointer data) { - if (col == COLOR_COLUMN){ + if (col == COLOR_COLUMN) { return NULL; - } else if (col == IMPORTANCE_COLUMN){ + } else if (col == IMPORTANCE_COLUMN) { return NULL; } else { return g_strdup (""); @@ -219,9 +219,9 @@ my_initialize_value (ETableModel *etc, gint col, gpointer data) static gboolean my_value_is_empty (ETableModel *etc, gint col, gconstpointer value, gpointer data) { - if (col == COLOR_COLUMN){ + if (col == COLOR_COLUMN) { return value == NULL; - } else if (col == IMPORTANCE_COLUMN){ + } else if (col == IMPORTANCE_COLUMN) { return value == NULL; } else { return !(value && *(gchar *)value); @@ -231,9 +231,9 @@ my_value_is_empty (ETableModel *etc, gint col, gconstpointer value, gpointer dat static gchar * my_value_to_string (ETableModel *etc, gint col, gconstpointer value, gpointer data) { - if (col == COLOR_COLUMN){ + if (col == COLOR_COLUMN) { return g_strdup_printf("%d", (gint) value); - } else if (col == IMPORTANCE_COLUMN){ + } else if (col == IMPORTANCE_COLUMN) { return g_strdup_printf("%d", (gint) value); } else { return g_strdup(value); @@ -254,8 +254,8 @@ create_table () GdkPixbuf *pixbuf; /* First we fill in the simple data. */ - for (i = 0; i < ROWS; i++){ - for (j = 0; j < VIEW_COLS; j++){ + for (i = 0; i < ROWS; i++) { + for (j = 0; j < VIEW_COLS; j++) { table_data[i][j] = g_strdup (""); } importance_data[i] = FALSE; @@ -290,7 +290,7 @@ create_table () /* Next we create a column object for each view column and add them to the header. We don't create a column object for the importance column since it will not be shown. */ - for (i = 0; i < VIEW_COLS; i++){ + for (i = 0; i < VIEW_COLS; i++) { /* Create the column. */ ETableCol *ecol = e_table_col_new ( i, headers [i], diff --git a/widgets/table/e-table-field-chooser-dialog.c b/widgets/table/e-table-field-chooser-dialog.c index e3c059d748..b1bd18d499 100644 --- a/widgets/table/e-table-field-chooser-dialog.c +++ b/widgets/table/e-table-field-chooser-dialog.c @@ -145,7 +145,7 @@ static void e_table_field_chooser_dialog_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { ETableFieldChooserDialog *etfcd = E_TABLE_FIELD_CHOOSER_DIALOG(object); - switch (prop_id){ + switch (prop_id) { case PROP_DND_CODE: g_free(etfcd->dnd_code); etfcd->dnd_code = g_strdup(g_value_get_string (value)); diff --git a/widgets/table/e-table-field-chooser-item.c b/widgets/table/e-table-field-chooser-item.c index d897d16f85..7f0f39a9f9 100644 --- a/widgets/table/e-table-field-chooser-item.c +++ b/widgets/table/e-table-field-chooser-item.c @@ -334,7 +334,7 @@ etfci_set_property (GObject *object, guint prop_id, const GValue *value, GParamS item = GNOME_CANVAS_ITEM (object); etfci = E_TABLE_FIELD_CHOOSER_ITEM (object); - switch (prop_id){ + switch (prop_id) { case PROP_FULL_HEADER: etfci_drop_full_header (etfci); if (g_value_get_object (value)) @@ -366,7 +366,7 @@ etfci_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *p etfci = E_TABLE_FIELD_CHOOSER_ITEM (object); - switch (prop_id){ + switch (prop_id) { case PROP_DND_CODE: g_value_set_string (value, etfci->dnd_code); @@ -468,7 +468,7 @@ etfci_draw (GnomeCanvasItem *item, GdkDrawable *drawable, gint x, gint y, gint w state = GTK_WIDGET_STATE (canvas); y1 = y2 = 0; - for (row = 0; row < rows; row++, y1 = y2){ + for (row = 0; row < rows; row++, y1 = y2) { ETableCol *ecol; ecol = e_table_header_get_column (etfci->combined_header, row); @@ -582,7 +582,7 @@ etfci_event (GnomeCanvasItem *item, GdkEvent *e) GnomeCanvas *canvas = item->canvas; gint x, y; - switch (e->type){ + switch (e->type) { case GDK_MOTION_NOTIFY: gnome_canvas_w2c (canvas, e->motion.x, e->motion.y, &x, &y); @@ -593,7 +593,7 @@ etfci_event (GnomeCanvasItem *item, GdkEvent *e) case GDK_BUTTON_PRESS: gnome_canvas_w2c (canvas, e->button.x, e->button.y, &x, &y); - if (e->button.button == 1){ + if (e->button.button == 1) { etfci->click_x = x; etfci->click_y = y; etfci->maybe_drag = TRUE; diff --git a/widgets/table/e-table-field-chooser.c b/widgets/table/e-table-field-chooser.c index fb66d9618a..231ad0801f 100644 --- a/widgets/table/e-table-field-chooser.c +++ b/widgets/table/e-table-field-chooser.c @@ -228,7 +228,7 @@ e_table_field_chooser_set_property (GObject *object, guint prop_id, const GValue { ETableFieldChooser *etfc = E_TABLE_FIELD_CHOOSER(object); - switch (prop_id){ + switch (prop_id) { case PROP_DND_CODE: g_free(etfc->dnd_code); etfc->dnd_code = g_strdup(g_value_get_string(value)); diff --git a/widgets/table/e-table-group-container.c b/widgets/table/e-table-group-container.c index 6ec62e5607..523e948a2d 100644 --- a/widgets/table/e-table-group-container.c +++ b/widgets/table/e-table-group-container.c @@ -244,7 +244,7 @@ etgc_event (GnomeCanvasItem *item, GdkEvent *event) use_col = FALSE; direction = E_FOCUS_START; } - if (change_focus){ + if (change_focus) { GList *list; for (list = etgc->children; list; list = list->next) { ETableGroupContainerChildNode *child_node; @@ -471,7 +471,7 @@ etgc_add (ETableGroup *etg, gint row) ETableGroupContainerChildNode *child_node; gint i = 0; - for (; list; list = g_list_next (list), i++){ + for (; list; list = g_list_next (list), i++) { gint comp_val; child_node = list->data; @@ -1017,7 +1017,7 @@ etgc_reflow (GnomeCanvasItem *item, gint flags) if (frozen) return; - if (GTK_OBJECT_FLAGS(etgc)& GNOME_CANVAS_ITEM_REALIZED){ + if (GTK_OBJECT_FLAGS(etgc)& GNOME_CANVAS_ITEM_REALIZED) { gdouble running_height = 0; gdouble running_width = 0; gdouble old_height; @@ -1025,7 +1025,7 @@ etgc_reflow (GnomeCanvasItem *item, gint flags) old_height = etgc->height; old_width = etgc->width; - if (etgc->children == NULL){ + if (etgc->children == NULL) { } else { GList *list; gdouble extra_height = 0; @@ -1049,7 +1049,7 @@ etgc_reflow (GnomeCanvasItem *item, gint flags) running_height = extra_height; - for ( list = etgc->children; list; list = g_list_next (list)){ + for ( list = etgc->children; list; list = g_list_next (list)) { ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *) list->data; ETableGroup *child = child_node->child; @@ -1060,7 +1060,7 @@ etgc_reflow (GnomeCanvasItem *item, gint flags) if (item_width > running_width) running_width = item_width; } - for ( list = etgc->children; list; list = g_list_next (list)){ + for ( list = etgc->children; list; list = g_list_next (list)) { ETableGroupContainerChildNode *child_node = (ETableGroupContainerChildNode *) list->data; ETableGroup *child = child_node->child; g_object_get (child, @@ -1114,21 +1114,21 @@ etgc_init (ETableGroupContainer *container) void e_table_group_apply_to_leafs (ETableGroup *etg, ETableGroupLeafFn fn, gpointer closure) { - if (E_IS_TABLE_GROUP_CONTAINER (etg)){ + if (E_IS_TABLE_GROUP_CONTAINER (etg)) { ETableGroupContainer *etgc = E_TABLE_GROUP_CONTAINER (etg); GList *list = etgc->children; /* Protect from unrefs in the callback functions */ g_object_ref (etg); - for (list = etgc->children; list; list = list->next){ + for (list = etgc->children; list; list = list->next) { ETableGroupContainerChildNode *child_node = list->data; e_table_group_apply_to_leafs (child_node->child, fn, closure); } g_object_unref (etg); - } else if (E_IS_TABLE_GROUP_LEAF (etg)){ + } else if (E_IS_TABLE_GROUP_LEAF (etg)) { (*fn) (E_TABLE_GROUP_LEAF (etg)->item, closure); } else { g_error ("Unknown ETableGroup found: %s", diff --git a/widgets/table/e-table-group.c b/widgets/table/e-table-group.c index 7d3499f8f0..ebf861657c 100644 --- a/widgets/table/e-table-group.c +++ b/widgets/table/e-table-group.c @@ -605,7 +605,7 @@ etg_event (GnomeCanvasItem *item, GdkEvent *event) default: return_val = FALSE; } - if (return_val == FALSE){ + if (return_val == FALSE) { if (GNOME_CANVAS_ITEM_CLASS(etg_parent_class)->event) return GNOME_CANVAS_ITEM_CLASS(etg_parent_class)->event (item, event); } diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c index cc6886f848..b3c68be346 100644 --- a/widgets/table/e-table-header-item.c +++ b/widgets/table/e-table-header-item.c @@ -115,7 +115,7 @@ static void scroll_off (ETableHeaderItem *ethi); static void scroll_on (ETableHeaderItem *ethi, guint scroll_direction); static void -ethi_dispose (GObject *object){ +ethi_dispose (GObject *object) { ETableHeaderItem *ethi = E_TABLE_HEADER_ITEM (object); ethi_drop_table_header (ethi); @@ -301,7 +301,7 @@ ethi_set_property (GObject *object, item = GNOME_CANVAS_ITEM (object); ethi = E_TABLE_HEADER_ITEM (object); - switch (prop_id){ + switch (prop_id) { case PROP_TABLE_HEADER: ethi_drop_table_header (ethi); ethi_add_table_header (ethi, E_TABLE_HEADER(g_value_get_object (value))); @@ -325,7 +325,7 @@ ethi_set_property (GObject *object, break; case PROP_SORT_INFO: - if (ethi->sort_info){ + if (ethi->sort_info) { if (ethi->sort_info_changed_id) g_signal_handler_disconnect ( ethi->sort_info, @@ -374,7 +374,7 @@ ethi_get_property (GObject *object, ethi = E_TABLE_HEADER_ITEM (object); - switch (prop_id){ + switch (prop_id) { case PROP_FULL_HEADER: g_value_set_object (value, ethi->full_header); break; @@ -403,7 +403,7 @@ ethi_find_col_by_x (ETableHeaderItem *ethi, gint x) return 0; } - for (col = 0; col < cols; col++){ + for (col = 0; col < cols; col++) { ETableCol *ecol = e_table_header_get_column (ethi->eth, col); if ((x >= x1) && (x <= x1 + ecol->width)) { @@ -429,7 +429,7 @@ ethi_find_col_by_x_nearest (ETableHeaderItem *ethi, gint x) if (x < x1) return 0; - for (col = 0; col < cols; col++){ + for (col = 0; col < cols; col++) { ETableCol *ecol = e_table_header_get_column (ethi->eth, col); x1 += (ecol->width / 2); @@ -497,7 +497,7 @@ ethi_add_drop_marker (ETableHeaderItem *ethi, gint col, gboolean recreate) if (col > 0) x += ethi->group_indent_width; - if (!arrow_up){ + if (!arrow_up) { arrow_up = make_shaped_window_from_xpm (arrow_up_xpm); arrow_down = make_shaped_window_from_xpm (arrow_down_xpm); } @@ -591,7 +591,7 @@ do_drag_motion(ETableHeaderItem *ethi, d(g_print("x = %d, y = %d, ethi->width = %d, ethi->height = %d\n", x, y, ethi->width, ethi->height)); if ((x >= 0) && (x <= (ethi->width)) && - (y >= 0) && (y <= (ethi->height))){ + (y >= 0) && (y <= (ethi->height))) { gint col; d(g_print("In header\n")); @@ -604,7 +604,7 @@ do_drag_motion(ETableHeaderItem *ethi, ethi_remove_drop_marker (ethi); gdk_drag_status (context, context->suggested_action, time); } - else if (col != -1){ + else if (col != -1) { if (ethi->drag_col != -1) ethi_remove_destroy_marker (ethi); @@ -837,7 +837,7 @@ ethi_drag_drop (GtkWidget *canvas, gboolean successful = FALSE; if ((x >= 0) && (x <= (ethi->width)) && - (y >= 0) && (y <= (ethi->height))){ + (y >= 0) && (y <= (ethi->height))) { gint col; col = ethi_find_col_by_x_nearest (ethi, x); @@ -924,7 +924,7 @@ ethi_unrealize (GnomeCanvasItem *item) gtk_drag_dest_unset (GTK_WIDGET (item->canvas)); - if (ethi->stipple){ + if (ethi->stipple) { g_object_unref (ethi->stipple); ethi->stipple = NULL; } @@ -968,7 +968,7 @@ ethi_draw (GnomeCanvasItem *item, GdkDrawable *drawable, gint x, gint y, gint wi ethi->width = e_table_header_total_width (ethi->eth) + ethi->group_indent_width; x1 = x2 = 0; x2 += ethi->group_indent_width; - for (col = 0; col < cols; col++, x1 = x2){ + for (col = 0; col < cols; col++, x1 = x2) { ETableCol *ecol = e_table_header_get_column (ethi->eth, col); gint col_width; @@ -1021,7 +1021,7 @@ is_pointer_on_division (ETableHeaderItem *ethi, gint pos, gint *the_total, gint gint col, total; total = 0; - for (col = 0; col < cols; col++){ + for (col = 0; col < cols; col++) { ETableCol *ecol = e_table_header_get_column (ethi->eth, col); if (col == 0) @@ -1029,7 +1029,7 @@ is_pointer_on_division (ETableHeaderItem *ethi, gint pos, gint *the_total, gint total += ecol->width; - if ((total - TOLERANCE < pos)&& (pos < total + TOLERANCE)){ + if ((total - TOLERANCE < pos)&& (pos < total + TOLERANCE)) { if (return_col) *return_col = col; if (the_total) @@ -1070,7 +1070,7 @@ set_cursor (ETableHeaderItem *ethi, gint pos) /* Column is not resizable if all columns after it are also not resizable */ - for (; c <= last_col; c++){ + for (; c <= last_col; c++) { ETableCol *ecol2; ecol2 = e_table_header_get_column (ethi->eth, c); @@ -1225,7 +1225,7 @@ ethi_popup_sort_ascending(GtkWidget *widget, EthiHeaderInfo *info) ETableSortColumn column = e_table_sort_info_grouping_get_nth ( ethi->sort_info, i); - if (model_col == column.column){ + if (model_col == column.column) { column.ascending = 1; e_table_sort_info_grouping_set_nth ( ethi->sort_info, i, column); @@ -1240,7 +1240,7 @@ ethi_popup_sort_ascending(GtkWidget *widget, EthiHeaderInfo *info) ETableSortColumn column = e_table_sort_info_sorting_get_nth( ethi->sort_info, i); - if (model_col == column.column || model_col == -1){ + if (model_col == column.column || model_col == -1) { column.ascending = 1; e_table_sort_info_sorting_set_nth ( ethi->sort_info, i, column); @@ -1279,7 +1279,7 @@ ethi_popup_sort_descending(GtkWidget *widget, EthiHeaderInfo *info) for (i = 0; i < length; i++) { ETableSortColumn column = e_table_sort_info_grouping_get_nth( ethi->sort_info, i); - if (model_col == column.column){ + if (model_col == column.column) { column.ascending = 0; e_table_sort_info_grouping_set_nth( ethi->sort_info, i, column); @@ -1294,7 +1294,7 @@ ethi_popup_sort_descending(GtkWidget *widget, EthiHeaderInfo *info) e_table_sort_info_sorting_get_nth( ethi->sort_info, i); - if (model_col == column.column || model_col == -1){ + if (model_col == column.column || model_col == -1) { column.ascending = 0; e_table_sort_info_sorting_set_nth ( ethi->sort_info, i, column); @@ -1622,7 +1622,7 @@ ethi_change_sort_state (ETableHeaderItem *ethi, ETableCol *col) length = e_table_sort_info_grouping_get_count(ethi->sort_info); for (i = 0; i < length; i++) { ETableSortColumn column = e_table_sort_info_grouping_get_nth(ethi->sort_info, i); - if (model_col == column.column || model_col == -1){ + if (model_col == column.column || model_col == -1) { gint ascending = column.ascending; ascending = ! ascending; column.ascending = ascending; @@ -1638,10 +1638,10 @@ ethi_change_sort_state (ETableHeaderItem *ethi, ETableCol *col) for (i = 0; i < length; i++) { ETableSortColumn column = e_table_sort_info_sorting_get_nth(ethi->sort_info, i); - if (model_col == column.column || model_col == -1){ + if (model_col == column.column || model_col == -1) { gint ascending = column.ascending; - if (ascending == 0 && model_col != -1){ + if (ascending == 0 && model_col != -1) { /* * This means the user has clicked twice * already, lets kill sorting of this column now. @@ -1689,7 +1689,7 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) gint x, y, start, col; gint was_maybe_drag = 0; - switch (e->type){ + switch (e->type) { case GDK_ENTER_NOTIFY: convert (canvas, e->crossing.x, e->crossing.y, &x, &y); set_cursor (ethi, x); @@ -1703,10 +1703,10 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) case GDK_MOTION_NOTIFY: convert (canvas, e->motion.x, e->motion.y, &x, &y); - if (resizing){ + if (resizing) { gint new_width; - if (ethi->resize_guide == NULL){ + if (ethi->resize_guide == NULL) { /* Quick hack until I actually bind the views */ ethi->resize_guide = GINT_TO_POINTER (1); @@ -1722,7 +1722,7 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) e_table_header_set_size (ethi->eth, ethi->resize_col, new_width); gnome_canvas_item_request_update (GNOME_CANVAS_ITEM(ethi)); - } else if (ethi_maybe_start_drag (ethi, &e->motion)){ + } else if (ethi_maybe_start_drag (ethi, &e->motion)) { ethi_start_drag (ethi, e); } else set_cursor (ethi, x); @@ -1734,7 +1734,7 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) convert (canvas, e->button.x, e->button.y, &x, &y); - if (is_pointer_on_division (ethi, x, &start, &col) && e->button.button == 1){ + if (is_pointer_on_division (ethi, x, &start, &col) && e->button.button == 1) { ETableCol *ecol; /* @@ -1752,7 +1752,7 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) ethi->resize_start_pos = start - ecol->width; ethi->resize_min_width = ecol->min_width; } else { - if (e->button.button == 1){ + if (e->button.button == 1) { ethi->click_x = e->button.x; ethi->click_y = e->button.y; ethi->maybe_drag = TRUE; @@ -1760,7 +1760,7 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) ethi->selected_col = col; if (GTK_WIDGET_CAN_FOCUS (GTK_WIDGET (item->canvas))) e_canvas_item_grab_focus (item, TRUE); - } else if (e->button.button == 3){ + } else if (e->button.button == 3) { ethi_header_context_menu (ethi, &e->button); } else ethi_button_pressed (ethi, &e->button); @@ -1793,7 +1793,7 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) ethi->maybe_drag = FALSE; - if (ethi->resize_col != -1){ + if (ethi->resize_col != -1) { needs_ungrab = (ethi->resize_guide != NULL); ethi_end_resize (ethi); } else if (was_maybe_drag && ethi->sort_info) { diff --git a/widgets/table/e-table-header.c b/widgets/table/e-table-header.c index 37a1e3c332..1016acf5c0 100644 --- a/widgets/table/e-table-header.c +++ b/widgets/table/e-table-header.c @@ -172,7 +172,7 @@ eth_finalize (GObject *object) /* * Destroy columns */ - for (i = cols - 1; i >= 0; i--){ + for (i = cols - 1; i >= 0; i--) { eth_do_remove (eth, i, TRUE); } g_free (eth->columns); @@ -348,7 +348,7 @@ eth_update_offsets (ETableHeader *eth) gint i; gint x = 0; - for (i = 0; i < eth->col_count; i++){ + for (i = 0; i < eth->col_count; i++) { ETableCol *etc = eth->columns [i]; etc->x = x; @@ -505,7 +505,7 @@ e_table_header_get_index_at (ETableHeader *eth, gint x_offset) g_return_val_if_fail (E_IS_TABLE_HEADER (eth), 0); total = 0; - for (i = 0; i < eth->col_count; i++){ + for (i = 0; i < eth->col_count; i++) { total += eth->columns [i]->width; if (x_offset < total) @@ -560,7 +560,7 @@ e_table_header_get_selected (ETableHeader *eth) g_return_val_if_fail (eth != NULL, 0); g_return_val_if_fail (E_IS_TABLE_HEADER (eth), 0); - for (i = 0; i < eth->col_count; i++){ + for (i = 0; i < eth->col_count; i++) { if (eth->columns [i]->selected) selected++; } @@ -728,7 +728,7 @@ eth_set_size (ETableHeader *eth, gint idx, gint size) /* (1) If none of the columns to the right are expandable, use * all the expansion space in this column. */ - if(expandable_count == 0) { + if (expandable_count == 0) { eth->columns[idx]->expansion = expansion; for (i = idx + 1; i < eth->col_count; i++) { eth->columns[i]->expansion = 0; @@ -827,7 +827,7 @@ e_table_header_col_diff (ETableHeader *eth, gint start_col, gint end_col) end_col = eth->col_count; total = 0; - for (col = start_col; col < end_col; col++){ + for (col = start_col; col < end_col; col++) { total += eth->columns [col]->width; } diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c index 8d34e5c663..d009774dc9 100644 --- a/widgets/table/e-table-item.c +++ b/widgets/table/e-table-item.c @@ -250,7 +250,7 @@ eti_get_cell_background_color (ETableItem *eti, gint row, gint col, gboolean sel gchar *color_spec = NULL; gboolean allocated = FALSE; - if (selected){ + if (selected) { if (GTK_WIDGET_HAS_FOCUS(canvas)) background = &canvas->style->bg [GTK_STATE_SELECTED]; else @@ -298,7 +298,7 @@ eti_get_cell_foreground_color (ETableItem *eti, gint row, gint col, gboolean sel if (allocated) *allocated = FALSE; - if (selected){ + if (selected) { if (GTK_WIDGET_HAS_FOCUS (canvas)) foreground = &canvas->style->fg [GTK_STATE_SELECTED]; else @@ -370,7 +370,7 @@ eti_attach_cell_views (ETableItem *eti) eti->n_cells = eti->cols; eti->cell_views = g_new (ECellView *, eti->n_cells); - for (i = 0; i < eti->n_cells; i++){ + for (i = 0; i < eti->n_cells; i++) { ETableCol *ecol = e_table_header_get_column (eti->header, i); eti->cell_views [i] = e_cell_new_view (ecol->ecell, eti->table_model, eti); @@ -408,7 +408,7 @@ eti_detach_cell_views (ETableItem *eti) eti_free_save_state (eti); - for (i = 0; i < eti->n_cells; i++){ + for (i = 0; i < eti->n_cells; i++) { e_cell_kill_view (eti->cell_views [i]); eti->cell_views [i] = NULL; } @@ -589,7 +589,7 @@ eti_remove_header_model (ETableItem *eti) g_signal_handler_disconnect (G_OBJECT (eti->header), eti->header_request_width_id); - if (eti->cell_views){ + if (eti->cell_views) { eti_unrealize_cell_views (eti); eti_detach_cell_views (eti); } @@ -618,7 +618,7 @@ eti_row_height_real (ETableItem *eti, gint row) max_h = 0; - for (col = 0; col < cols; col++){ + for (col = 0; col < cols; col++) { h = e_cell_height (eti->cell_views [col], view_to_model_col(eti, col), col, row); if (h > max_h) @@ -746,8 +746,8 @@ eti_get_height (ETableItem *eti) } else { gint height; gint row; - if (eti->length_threshold != -1){ - if (rows > eti->length_threshold){ + if (eti->length_threshold != -1) { + if (rows > eti->length_threshold) { gint row_height = eti_row_height(eti, 0); if (eti->height_cache) { height = 0; @@ -1352,7 +1352,7 @@ eti_header_structure_changed (ETableHeader *eth, ETableItem *eti) * BUT: then you can't remove all columns from a header and add new ones. */ - if (eti->cell_views){ + if (eti->cell_views) { eti_unrealize_cell_views (eti); eti_detach_cell_views (eti); eti_attach_cell_views (eti); @@ -1463,7 +1463,7 @@ eti_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpe eti = E_TABLE_ITEM (object); - switch (prop_id){ + switch (prop_id) { case PROP_TABLE_HEADER: eti_remove_header_model (eti); eti_add_header_model (eti, E_TABLE_HEADER(g_value_get_object (value))); @@ -1547,7 +1547,7 @@ eti_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *psp eti = E_TABLE_ITEM (object); - switch (prop_id){ + switch (prop_id) { case PROP_WIDTH: g_value_set_double (value, eti->width); break; @@ -1846,7 +1846,7 @@ eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, gint x, gint y, gint wid first_col = -1; last_col = x_offset = 0; x1 = x2 = floor (eti_base.x); - for (col = 0; col < cols; col++, x1 = x2){ + for (col = 0; col < cols; col++, x1 = x2) { ETableCol *ecol = e_table_header_get_column (eti->header, col); x2 = x1 + ecol->width; @@ -1855,7 +1855,7 @@ eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, gint x, gint y, gint wid break; if (x2 < x) continue; - if (first_col == -1){ + if (first_col == -1) { x_offset = x1 - x; first_col = col; } @@ -1888,7 +1888,7 @@ eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, gint x, gint y, gint wid first_row = -1; y1 = y2 = floor (eti_base.y) + height_extra; - for (row = 0; row < rows; row++, y1 = y2){ + for (row = 0; row < rows; row++, y1 = y2) { y2 += ETI_ROW_HEIGHT (eti, row) + height_extra; @@ -1898,7 +1898,7 @@ eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, gint x, gint y, gint wid if (y2 < y) continue; - if (first_row == -1){ + if (first_row == -1) { y_offset = y1 - y; first_row = row; } @@ -1919,7 +1919,7 @@ eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, gint x, gint y, gint wid f_x1 = f_x2 = f_y1 = f_y2 = -1; f_found = FALSE; - if (eti->horizontal_draw_grid && first_row == 0){ + if (eti->horizontal_draw_grid && first_row == 0) { gdk_draw_line ( drawable, eti->grid_gc, eti_base.x - x, yd, eti_base.x + eti->width - x, yd); @@ -1927,7 +1927,7 @@ eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, gint x, gint y, gint wid yd += height_extra; - for (row = first_row; row < last_row; row++){ + for (row = first_row; row < last_row; row++) { gint xd; gboolean selected; gint cursor_col, cursor_row; @@ -1943,7 +1943,7 @@ eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, gint x, gint y, gint wid "cursor_row", &cursor_row, NULL); - for (col = first_col; col < last_col; col++){ + for (col = first_col; col < last_col; col++) { ETableCol *ecol = e_table_header_get_column (eti->header, col); ECellView *ecell_view = eti->cell_views [col]; gboolean col_selected = selected; @@ -2075,10 +2075,10 @@ eti_draw (GnomeCanvasItem *item, GdkDrawable *drawable, gint x, gint y, gint wid } } - if (eti->vertical_draw_grid){ + if (eti->vertical_draw_grid) { gint xd = x_offset; - for (col = first_col; col <= last_col; col++){ + for (col = first_col; col <= last_col; col++) { ETableCol *ecol = e_table_header_get_column (eti->header, col); gdk_draw_line ( @@ -2142,7 +2142,7 @@ find_cell (ETableItem *eti, double x, double y, gint *view_col_res, gint *view_r y -= eti->y1; x1 = 0; - for (col = 0; col < cols - 1; col++, x1 = x2){ + for (col = 0; col < cols - 1; col++, x1 = x2) { ETableCol *ecol = e_table_header_get_column (eti->header, col); if (x < x1) @@ -2319,7 +2319,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) if (!eti->header) return FALSE; - switch (e->type){ + switch (e->type) { case GDK_BUTTON_PRESS: { double x1, y1; double realx, realy; @@ -2502,7 +2502,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) "eti_editing: %s, row:%d:%d, col:%d:%d\n", __FUNCTION__, e->button.button, __LINE__, eti_editing(eti)?"true":"false", cursor_row, view_to_model_row(eti, row), cursor_col, view_to_model_col(eti, col))); - if (eti_editing (eti) && cursor_row == view_to_model_row(eti, row) && cursor_col == view_to_model_col(eti, col)){ + if (eti_editing (eti) && cursor_row == view_to_model_row(eti, row) && cursor_col == view_to_model_col(eti, col)) { d(g_print("%s: GDK_BUTTON_RELEASE received, button %d, line: %d\n", __FUNCTION__, e->button.button, __LINE__)) ; @@ -2645,7 +2645,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) #endif flags = 0; - if (cursor_row == view_to_model_row(eti, row) && cursor_col == view_to_model_col(eti, col)){ + if (cursor_row == view_to_model_row(eti, row) && cursor_col == view_to_model_col(eti, col)) { flags = E_CELL_EDITING | E_CELL_CURSOR; } @@ -2684,7 +2684,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) eti->in_key_press = TRUE; - switch (e->key.keyval){ + switch (e->key.keyval) { case GDK_Left: case GDK_KP_Left: if (eti_editing (eti)) { @@ -2765,7 +2765,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) break; } if (eti->cursor_mode == E_CURSOR_SPREADSHEET) { - if ((e->key.state & GDK_SHIFT_MASK) != 0){ + if ((e->key.state & GDK_SHIFT_MASK) != 0) { /* shift tab */ if (cursor_col != view_to_model_col(eti, 0)) eti_cursor_move_left (eti); @@ -2801,7 +2801,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) case GDK_KP_Enter: case GDK_ISO_Enter: case GDK_3270_Enter: - if (eti_editing (eti)){ + if (eti_editing (eti)) { ecell_view = eti->cell_views [eti->editing_col]; return_val = eti_e_cell_event (eti, ecell_view, e, e->key.time, view_to_model_col (eti, eti->editing_col), @@ -2842,7 +2842,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) break; default: - if (!eti_editing (eti)){ + if (!eti_editing (eti)) { gint col, row; row = model_to_view_row(eti, cursor_row); col = model_to_view_col(eti, cursor_col); @@ -2850,7 +2850,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) e_table_item_enter_edit (eti, col, row); } } - if (!eti_editing (eti)){ + if (!eti_editing (eti)) { g_signal_emit (eti, eti_signals [KEY_PRESS], 0, model_to_view_row(eti, cursor_row), cursor_col, e, &return_val); if (!return_val) @@ -2883,7 +2883,7 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) if (cursor_col == -1) return FALSE; - if (eti_editing (eti)){ + if (eti_editing (eti)) { ecell_view = eti->cell_views [eti->editing_col]; return_val = eti_e_cell_event (eti, ecell_view, e, e->key.time, view_to_model_col(eti, eti->editing_col), @@ -3576,12 +3576,12 @@ e_table_item_print_page (EPrintable *ep, * Draw cells */ - if (eti->horizontal_draw_grid){ + if (eti->horizontal_draw_grid) { gp_draw_rect(context, 0, yd, width, 1); } yd++; - for (row = rows_printed; row < rows; row++){ + for (row = rows_printed; row < rows; row++) { gdouble xd = 1, row_height; row_height = eti_printed_row_height(eti, widths, context, row); @@ -3597,7 +3597,7 @@ e_table_item_print_page (EPrintable *ep, } } - for (col = 0; col < cols; col++){ + for (col = 0; col < cols; col++) { ECellView *ecell_view = eti->cell_views [col]; cairo_save(cr); @@ -3617,16 +3617,16 @@ e_table_item_print_page (EPrintable *ep, } yd += row_height; - if (eti->horizontal_draw_grid){ + if (eti->horizontal_draw_grid) { gp_draw_rect(context, 0, yd, width, 1); } yd ++; } itemcontext->rows_printed = row; - if (eti->vertical_draw_grid){ + if (eti->vertical_draw_grid) { gdouble xd = 0; - for (col = 0; col < cols; col++){ + for (col = 0; col < cols; col++) { gp_draw_rect(context, xd, height, 1, yd - height); xd += widths[col]; } @@ -3681,7 +3681,7 @@ e_table_item_height (EPrintable *ep, */ yd++; - for (row = rows_printed; row < rows; row++){ + for (row = rows_printed; row < rows; row++) { gdouble row_height; row_height = eti_printed_row_height(item, widths, context, row); @@ -3732,7 +3732,7 @@ e_table_item_will_fit (EPrintable *ep, */ yd++; - for (row = rows_printed; row < rows; row++){ + for (row = rows_printed; row < rows; row++) { gdouble row_height; row_height = eti_printed_row_height(item, widths, context, row); diff --git a/widgets/table/e-table-scrolled.c b/widgets/table/e-table-scrolled.c index 778041d73c..3d937dd9cd 100644 --- a/widgets/table/e-table-scrolled.c +++ b/widgets/table/e-table-scrolled.c @@ -163,7 +163,7 @@ ets_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *psp { ETableScrolled *ets = E_TABLE_SCROLLED (object); - switch (prop_id){ + switch (prop_id) { case PROP_TABLE: g_value_set_object (value, ets->table); break; diff --git a/widgets/table/e-table-selection-model.c b/widgets/table/e-table-selection-model.c index 22ec5af7d5..67a27cde01 100644 --- a/widgets/table/e-table-selection-model.c +++ b/widgets/table/e-table-selection-model.c @@ -246,7 +246,7 @@ etsm_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *ps { ETableSelectionModel *etsm = E_TABLE_SELECTION_MODEL (object); - switch (prop_id){ + switch (prop_id) { case PROP_MODEL: g_value_set_object (value, etsm->model); break; @@ -261,7 +261,7 @@ etsm_set_property (GObject *object, guint prop_id, const GValue *value, GParamSp { ETableSelectionModel *etsm = E_TABLE_SELECTION_MODEL (object); - switch (prop_id){ + switch (prop_id) { case PROP_MODEL: drop_model(etsm); add_model(etsm, g_value_get_object (value) ? E_TABLE_MODEL(g_value_get_object (value)) : NULL); diff --git a/widgets/table/e-table-sorted-variable.c b/widgets/table/e-table-sorted-variable.c index a65046234a..f4e35d1fd8 100644 --- a/widgets/table/e-table-sorted-variable.c +++ b/widgets/table/e-table-sorted-variable.c @@ -170,7 +170,7 @@ etsv_add_all (ETableSubsetVariable *etssv) rows = e_table_model_row_count(etss->source); - if (etss->n_map + rows > etssv->n_vals_allocated){ + if (etss->n_map + rows > etssv->n_vals_allocated) { etssv->n_vals_allocated += MAX(INCREMENT_AMOUNT, rows); etss->map_table = g_realloc (etss->map_table, etssv->n_vals_allocated * sizeof(gint)); } @@ -190,7 +190,7 @@ e_table_sorted_variable_new (ETableModel *source, ETableHeader *full_header, ETa ETableSortedVariable *etsv = g_object_new (E_TABLE_SORTED_VARIABLE_TYPE, NULL); ETableSubsetVariable *etssv = E_TABLE_SUBSET_VARIABLE (etsv); - if (e_table_subset_variable_construct (etssv, source) == NULL){ + if (e_table_subset_variable_construct (etssv, source) == NULL) { g_object_unref (etsv); return NULL; } diff --git a/widgets/table/e-table-sorted.c b/widgets/table/e-table-sorted.c index 16bb3cf888..75a8e768d3 100644 --- a/widgets/table/e-table-sorted.c +++ b/widgets/table/e-table-sorted.c @@ -131,7 +131,7 @@ e_table_sorted_new (ETableModel *source, ETableHeader *full_header, ETableSortIn if (E_TABLE_SUBSET_CLASS (ets_parent_class)->proxy_model_pre_change) (E_TABLE_SUBSET_CLASS (ets_parent_class)->proxy_model_pre_change) (etss, source); - if (e_table_subset_construct (etss, source, 0) == NULL){ + if (e_table_subset_construct (etss, source, 0) == NULL) { g_object_unref (ets); return NULL; } @@ -267,7 +267,7 @@ ets_proxy_model_rows_deleted (ETableSubset *etss, ETableModel *source, gint row, shift = row == etss->n_map - count; for (j = 0; j < count; j++) { - for (i = 0; i < etss->n_map; i++){ + for (i = 0; i < etss->n_map; i++) { if (etss->map_table[i] == row + j) { if (shift) e_table_model_pre_change (etm); diff --git a/widgets/table/e-table-specification.c b/widgets/table/e-table-specification.c index e7acd90f34..d837b7344e 100644 --- a/widgets/table/e-table-specification.c +++ b/widgets/table/e-table-specification.c @@ -369,7 +369,7 @@ e_table_specification_save_to_node (ETableSpecification *specification, e_xml_set_bool_prop_by_name (node, (const guchar *)"horizontal-resize", specification->horizontal_resize); e_xml_set_bool_prop_by_name (node, (const guchar *)"allow-grouping", specification->allow_grouping); - switch (specification->selection_mode){ + switch (specification->selection_mode) { case GTK_SELECTION_SINGLE: s = "single"; break; @@ -390,7 +390,7 @@ e_table_specification_save_to_node (ETableSpecification *specification, xmlSetProp (node, (const guchar *)"_click-to-add-message", (guchar *)specification->click_to_add_message); xmlSetProp (node, (const guchar *)"gettext-domain", (guchar *)specification->domain); - if (specification->columns){ + if (specification->columns) { gint i; for (i = 0; specification->columns [i]; i++) diff --git a/widgets/table/e-table-subset-variable.c b/widgets/table/e-table-subset-variable.c index de1d7ccacf..b63ecd01ec 100644 --- a/widgets/table/e-table-subset-variable.c +++ b/widgets/table/e-table-subset-variable.c @@ -46,7 +46,7 @@ etssv_add (ETableSubsetVariable *etssv, e_table_model_pre_change(etm); - if (etss->n_map + 1 > etssv->n_vals_allocated){ + if (etss->n_map + 1 > etssv->n_vals_allocated) { etssv->n_vals_allocated += INCREMENT_AMOUNT; etss->map_table = g_realloc (etss->map_table, etssv->n_vals_allocated * sizeof(gint)); } @@ -67,7 +67,7 @@ etssv_add_array (ETableSubsetVariable *etssv, e_table_model_pre_change(etm); - if (etss->n_map + count > etssv->n_vals_allocated){ + if (etss->n_map + count > etssv->n_vals_allocated) { etssv->n_vals_allocated += MAX(INCREMENT_AMOUNT, count); etss->map_table = g_realloc (etss->map_table, etssv->n_vals_allocated * sizeof(gint)); } @@ -88,7 +88,7 @@ etssv_add_all (ETableSubsetVariable *etssv) e_table_model_pre_change(etm); rows = e_table_model_row_count(etss->source); - if (etss->n_map + rows > etssv->n_vals_allocated){ + if (etss->n_map + rows > etssv->n_vals_allocated) { etssv->n_vals_allocated += MAX(INCREMENT_AMOUNT, rows); etss->map_table = g_realloc (etss->map_table, etssv->n_vals_allocated * sizeof(gint)); } @@ -106,7 +106,7 @@ etssv_remove (ETableSubsetVariable *etssv, ETableSubset *etss = E_TABLE_SUBSET(etssv); gint i; - for (i = 0; i < etss->n_map; i++){ + for (i = 0; i < etss->n_map; i++) { if (etss->map_table[i] == row) { e_table_model_pre_change (etm); memmove (etss->map_table + i, etss->map_table + i + 1, (etss->n_map - i - 1) * sizeof(gint)); @@ -150,7 +150,7 @@ e_table_subset_variable_new (ETableModel *source) { ETableSubsetVariable *etssv = g_object_new (E_TABLE_SUBSET_VARIABLE_TYPE, NULL); - if (e_table_subset_variable_construct (etssv, source) == NULL){ + if (e_table_subset_variable_construct (etssv, source) == NULL) { g_object_unref (etssv); return NULL; } @@ -252,7 +252,7 @@ e_table_subset_variable_set_allocation (ETableSubsetVariable *etssv, ETableSubset *etss = E_TABLE_SUBSET(etssv); if (total <= 0) total = 1; - if (total > etss->n_map){ + if (total > etss->n_map) { etss->map_table = g_realloc (etss->map_table, total * sizeof(gint)); } } diff --git a/widgets/table/e-table-subset.c b/widgets/table/e-table-subset.c index a860aba24f..6253c74327 100644 --- a/widgets/table/e-table-subset.c +++ b/widgets/table/e-table-subset.c @@ -61,7 +61,7 @@ etss_get_view_row (ETableSubset *etss, gint row) gint initial = MAX (MIN (etss->last_access, end), start); for (i = initial; i < end; i++) { - if (map_table [i] == row){ + if (map_table [i] == row) { d(g_print("a) Found %d from %d\n", i, etss->last_access)); etss->last_access = i; return i; @@ -69,15 +69,15 @@ etss_get_view_row (ETableSubset *etss, gint row) } for (i = initial - 1; i >= start; i--) { - if (map_table [i] == row){ + if (map_table [i] == row) { d(g_print("b) Found %d from %d\n", i, etss->last_access)); etss->last_access = i; return i; } } - for (i = 0; i < n; i++){ - if (map_table [i] == row){ + for (i = 0; i < n; i++) { + if (map_table [i] == row) { d(g_print("c) Found %d from %d\n", i, etss->last_access)); etss->last_access = i; return i; @@ -431,7 +431,7 @@ e_table_subset_new (ETableModel *source, const gint nvals) { ETableSubset *etss = g_object_new (E_TABLE_SUBSET_TYPE, NULL); - if (e_table_subset_construct (etss, source, nvals) == NULL){ + if (e_table_subset_construct (etss, source, nvals) == NULL) { g_object_unref (etss); return NULL; } diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c index bd1175ae86..b25ae6a3ce 100644 --- a/widgets/table/e-table.c +++ b/widgets/table/e-table.c @@ -1817,7 +1817,7 @@ et_build_column_spec (ETable *e_table) columns_shown = xmlNewNode (NULL, "columns-shown"); col_count = e_table_header_count (e_table->header); - for (i = 0; i < col_count; i++){ + for (i = 0; i < col_count; i++) { gchar *text = g_strdup_printf ("%d", e_table_header_index(e_table->header, i)); xmlNewChild (columns_shown, NULL, "column", text); g_free (text); @@ -2121,7 +2121,7 @@ et_get_property (GObject *object, { ETable *etable = E_TABLE (object); - switch (prop_id){ + switch (prop_id) { case PROP_MODEL: g_value_set_object (value, etable->model); break; @@ -2152,7 +2152,7 @@ et_set_property (GObject *object, { ETable *etable = E_TABLE (object); - switch (prop_id){ + switch (prop_id) { case PROP_LENGTH_THRESHOLD: etable->length_threshold = g_value_get_int (value); if (etable->group) { diff --git a/widgets/table/e-tree-scrolled.c b/widgets/table/e-tree-scrolled.c index fc729ab411..eac80443d0 100644 --- a/widgets/table/e-tree-scrolled.c +++ b/widgets/table/e-tree-scrolled.c @@ -173,7 +173,7 @@ ets_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *psp { ETreeScrolled *ets = E_TREE_SCROLLED (object); - switch (prop_id){ + switch (prop_id) { case PROP_TREE: g_value_set_object (value, ets->tree); break; diff --git a/widgets/table/e-tree-selection-model.c b/widgets/table/e-tree-selection-model.c index eedb201fae..6f89816fbe 100644 --- a/widgets/table/e-tree-selection-model.c +++ b/widgets/table/e-tree-selection-model.c @@ -301,7 +301,7 @@ etsm_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *ps { ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (object); - switch (prop_id){ + switch (prop_id) { case PROP_CURSOR_ROW: g_value_set_int (value, get_cursor_row(etsm)); break; @@ -326,7 +326,7 @@ etsm_set_property (GObject *object, guint prop_id, const GValue *value, GParamSp ESelectionModel *esm = E_SELECTION_MODEL (object); ETreeSelectionModel *etsm = E_TREE_SELECTION_MODEL (object); - switch (prop_id){ + switch (prop_id) { case PROP_CURSOR_ROW: e_selection_model_do_something(esm, g_value_get_int (value), etsm->priv->cursor_col, 0); break; diff --git a/widgets/table/e-tree-sorted-variable.c b/widgets/table/e-tree-sorted-variable.c index 7c7718d0cf..a919f900b4 100644 --- a/widgets/table/e-tree-sorted-variable.c +++ b/widgets/table/e-tree-sorted-variable.c @@ -154,7 +154,7 @@ e_tree_sorted_variable_new (ETreeModel *source, ETableHeader *full_header, ETabl ETreeSortedVariable *etsv = g_object_new (E_TREE_SORTED_VARIABLE_TYPE, NULL); ETreeSortedVariable *etsv = E_TABLE_SUBSET_VARIABLE (etsv); - if (e_table_subset_variable_construct (etsv, source) == NULL){ + if (e_table_subset_variable_construct (etsv, source) == NULL) { g_object_unref (etsv); return NULL; } diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c index 796bec1f39..8c8b05e2d4 100644 --- a/widgets/table/e-tree.c +++ b/widgets/table/e-tree.c @@ -1807,7 +1807,7 @@ et_get_property (GObject *object, { ETree *etree = E_TREE (object); - switch (prop_id){ + switch (prop_id) { case PROP_ETTA: g_value_set_object (value, etree->priv->etta); break; @@ -1836,7 +1836,7 @@ et_set_property (GObject *object, { ETree *etree = E_TREE (object); - switch (prop_id){ + switch (prop_id) { case PROP_LENGTH_THRESHOLD: etree->priv->length_threshold = g_value_get_int (value); if (etree->priv->item) { diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c index 88235e0e60..0fb9f926e1 100644 --- a/widgets/text/e-text.c +++ b/widgets/text/e-text.c @@ -1402,7 +1402,7 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable, "height", &thisheight, NULL); - if (text->draw_borders){ + if (text->draw_borders) { gtk_paint_shadow (widget->style, drawable, GTK_STATE_NORMAL, GTK_SHADOW_IN, @@ -1521,7 +1521,7 @@ e_text_draw (GnomeCanvasItem *item, GdkDrawable *drawable, /* Need to reset the layout to cleanly clear the preedit buffer when * typing in CJK & using backspace on the preedit */ - if(!text->preedit_len) + if (!text->preedit_len) reset_layout (text); if (!pango_layout_get_text (text->layout)) @@ -2048,7 +2048,7 @@ _do_tooltip (gpointer data) tooltip_height = E_TEXT(tooltip_text)->height; tooltip_x = 0; tooltip_y = 0; - switch(E_TEXT(tooltip_text)->justification) { + switch (E_TEXT(tooltip_text)->justification) { case GTK_JUSTIFY_CENTER: tooltip_x = - tooltip_width / 2; break; @@ -2060,7 +2060,7 @@ _do_tooltip (gpointer data) tooltip_x = 0; break; } - switch(text->anchor) { + switch (text->anchor) { case GTK_ANCHOR_NW: case GTK_ANCHOR_N: case GTK_ANCHOR_NE: @@ -2078,7 +2078,7 @@ _do_tooltip (gpointer data) tooltip_y -= tooltip_height; break; } - switch(E_TEXT(tooltip_text)->anchor) { + switch (E_TEXT(tooltip_text)->anchor) { case GTK_ANCHOR_NW: case GTK_ANCHOR_W: case GTK_ANCHOR_SW: @@ -2288,7 +2288,7 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) if (event->key.keyval == GDK_F10 && (event->key.state & GDK_SHIFT_MASK) - && text->handle_popup ){ + && text->handle_popup ) { /* Simulate a GdkEventButton here, so that we can call e_text_do_popup directly */ @@ -2665,7 +2665,7 @@ popup_menu_placement_cb (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpo GnomeCanvasItem *item = &text->item; GnomeCanvas *parent = item->canvas; - if (parent){ + if (parent) { gdk_window_get_origin (((GtkWidget*) parent)->window, x, y); *x += item->x1 + text->width / 2; *y += item->y1 + text->height / 2; @@ -2746,7 +2746,7 @@ popup_targets_received (GtkClipboard *clipboard, popup_menu); /* If invoked by S-F10 key binding, button will be 0. */ - if (button->button == 0){ + if (button->button == 0) { gtk_menu_popup (GTK_MENU (popup_menu), NULL, NULL, popup_menu_placement_cb, (gpointer)text, button->button, GDK_CURRENT_TIME); @@ -2868,14 +2868,14 @@ _get_updated_position (EText *text, gboolean direction) length = g_utf8_strlen (text->text, -1); /* length checks to make sure we are not wandering off into nonexistant memory... */ - if((text->selection_end >= length) && (TRUE == direction)) /* forward */ + if ((text->selection_end >= length) && (TRUE == direction)) /* forward */ return length; /* checking for -ve value wont hurt! */ - if((text->selection_end <= 0) && (FALSE == direction)) /* backward */ + if ((text->selection_end <= 0) && (FALSE == direction)) /* backward */ return 0; /* check for validness of full text->text */ - if(!g_utf8_validate(text->text, -1, NULL)) + if (!g_utf8_validate(text->text, -1, NULL)) return text->selection_end; /* get layout's PangoLogAttr to facilitate moving when moving across grapheme cluster as in indic langs */ @@ -2886,32 +2886,32 @@ _get_updated_position (EText *text, gboolean direction) p = g_utf8_offset_to_pointer (text->text, text->selection_end); new_pos = text->selection_end; - while(1) + while (1) { /* check before moving forward/backwards if we have more chars to move or not */ - if(TRUE == direction) + if (TRUE == direction) p = g_utf8_next_char (p); else p = g_utf8_prev_char (p); /* validate the new string & return with original position if check fails */ - if(!g_utf8_validate (p, -1, NULL)) + if (!g_utf8_validate (p, -1, NULL)) break; /* will return old value of new_pos */ new_pos = g_utf8_pointer_to_offset (text->text, p); /* if is_cursor_position is set, cursor can appear in front of character. i.e. this is a grapheme boundary AND make some sanity checks */ - if((new_pos >=0) && (new_pos < n_attrs) && (log_attrs[new_pos].is_cursor_position)) + if ((new_pos >=0) && (new_pos < n_attrs) && (log_attrs[new_pos].is_cursor_position)) break; - else if((new_pos < 0) || (new_pos >= n_attrs)) + else if ((new_pos < 0) || (new_pos >= n_attrs)) { new_pos = text->selection_end; break; } } - if(log_attrs) + if (log_attrs) g_free(log_attrs); return new_pos; |