diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-06-05 04:53:10 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-06-09 01:14:48 +0800 |
commit | f014ab82c81078d60cb1df8c986305c2cc9948c2 (patch) | |
tree | c3bde4e5da923c9ee082fcb994b10c2ce2f61dc2 /widgets | |
parent | 7428fc93d58921bab9968a999172b843af2a2244 (diff) | |
download | gsoc2013-evolution-f014ab82c81078d60cb1df8c986305c2cc9948c2.tar.gz gsoc2013-evolution-f014ab82c81078d60cb1df8c986305c2cc9948c2.tar.zst gsoc2013-evolution-f014ab82c81078d60cb1df8c986305c2cc9948c2.zip |
Coding style and whitespace cleanups.
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/menus/gal-define-views-model.c | 6 | ||||
-rw-r--r-- | widgets/misc/e-attachment-button.c | 25 | ||||
-rw-r--r-- | widgets/misc/e-calendar-item.c | 11 | ||||
-rw-r--r-- | widgets/misc/e-calendar.c | 9 | ||||
-rw-r--r-- | widgets/misc/e-canvas.c | 3 | ||||
-rw-r--r-- | widgets/misc/e-dateedit.c | 4 | ||||
-rw-r--r-- | widgets/misc/e-import-assistant.c | 3 | ||||
-rw-r--r-- | widgets/misc/e-map.c | 8 | ||||
-rw-r--r-- | widgets/misc/e-searching-tokenizer.c | 10 | ||||
-rw-r--r-- | widgets/misc/e-selection-model-simple.c | 36 | ||||
-rw-r--r-- | widgets/table/e-cell-number.c | 6 | ||||
-rw-r--r-- | widgets/table/e-cell-toggle.c | 7 | ||||
-rw-r--r-- | widgets/table/e-table-config.c | 18 | ||||
-rw-r--r-- | widgets/table/e-table-field-chooser-item.c | 12 | ||||
-rw-r--r-- | widgets/table/e-table-group-leaf.c | 83 | ||||
-rw-r--r-- | widgets/table/e-table-header-item.c | 23 | ||||
-rw-r--r-- | widgets/table/e-table-without.c | 3 | ||||
-rw-r--r-- | widgets/table/e-tree-memory.c | 7 | ||||
-rw-r--r-- | widgets/table/e-tree.c | 13 | ||||
-rw-r--r-- | widgets/table/gal-a11y-e-cell-vbox.c | 3 | ||||
-rw-r--r-- | widgets/table/gal-a11y-e-cell.c | 4 | ||||
-rw-r--r-- | widgets/text/e-text-model.c | 21 | ||||
-rw-r--r-- | widgets/text/e-text.c | 99 |
23 files changed, 249 insertions, 165 deletions
diff --git a/widgets/menus/gal-define-views-model.c b/widgets/menus/gal-define-views-model.c index b72a262c7f..14031caf2b 100644 --- a/widgets/menus/gal-define-views-model.c +++ b/widgets/menus/gal-define-views-model.c @@ -142,8 +142,12 @@ gdvm_set_value_at (ETableModel *etc, gint col, gint row, gconstpointer val) { GalDefineViewsModel *views = GAL_DEFINE_VIEWS_MODEL (etc); if (views->editable) { + GalView *view; + + view = gal_view_collection_get_view (views->collection, row); + e_table_model_pre_change (etc); - gal_view_set_title (gal_view_collection_get_view (views->collection, row), val); + gal_view_set_title (view, val); e_table_model_cell_changed (etc, col, row); } } diff --git a/widgets/misc/e-attachment-button.c b/widgets/misc/e-attachment-button.c index 88c965e787..efc184b090 100644 --- a/widgets/misc/e-attachment-button.c +++ b/widgets/misc/e-attachment-button.c @@ -271,7 +271,8 @@ attachment_button_expand_drag_data_get_cb (EAttachmentButton *button, if (button->priv->attachment) { gchar *mime_type; - mime_type = e_attachment_get_mime_type (button->priv->attachment); + mime_type = e_attachment_get_mime_type ( + button->priv->attachment); if (mime_type) { gboolean processed = FALSE; @@ -284,7 +285,9 @@ attachment_button_expand_drag_data_get_cb (EAttachmentButton *button, if (g_strcmp0 (atom_name, mime_type) == 0) { CamelMimePart *mime_part; - mime_part = e_attachment_get_mime_part (button->priv->attachment); + mime_part = e_attachment_get_mime_part ( + button->priv->attachment); + if (CAMEL_IS_MIME_PART (mime_part)) { CamelDataWrapper *wrapper; CamelStream *stream; @@ -292,12 +295,18 @@ attachment_button_expand_drag_data_get_cb (EAttachmentButton *button, buffer = g_byte_array_new (); stream = camel_stream_mem_new (); - camel_stream_mem_set_byte_array (CAMEL_STREAM_MEM (stream), buffer); - wrapper = camel_medium_get_content (CAMEL_MEDIUM (mime_part)); - camel_data_wrapper_decode_to_stream_sync (wrapper, stream, NULL, NULL); + camel_stream_mem_set_byte_array ( + CAMEL_STREAM_MEM (stream), + buffer); + wrapper = camel_medium_get_content ( + CAMEL_MEDIUM (mime_part)); + camel_data_wrapper_decode_to_stream_sync ( + wrapper, stream, NULL, NULL); g_object_unref (stream); - gtk_selection_data_set (selection, atom, 8, buffer->data, buffer->len); + gtk_selection_data_set ( + selection, atom, 8, + buffer->data, buffer->len); processed = TRUE; g_byte_array_free (buffer, TRUE); @@ -780,7 +789,9 @@ e_attachment_button_set_attachment (EAttachmentButton *button, attach_entry[0].target = simple_type; - gtk_target_list_add_table (list, attach_entry, G_N_ELEMENTS (attach_entry)); + gtk_target_list_add_table ( + list, attach_entry, + G_N_ELEMENTS (attach_entry)); g_free (simple_type); } diff --git a/widgets/misc/e-calendar-item.c b/widgets/misc/e-calendar-item.c index ad7b95bfd4..fd626c674c 100644 --- a/widgets/misc/e-calendar-item.c +++ b/widgets/misc/e-calendar-item.c @@ -1619,7 +1619,9 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem, } /* Draw the 1- or 2-digit day number. */ - day_x += calitem->cell_width - (calitem->cell_width - min_cell_width) / 2; + day_x += calitem->cell_width - + (calitem->cell_width - + min_cell_width) / 2; day_x -= E_CALENDAR_ITEM_MIN_CELL_XPAD / 2; day_y += (calitem->cell_height - min_cell_height + 1) / 2; day_y += E_CALENDAR_ITEM_MIN_CELL_YPAD / 2; @@ -1628,7 +1630,9 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem, if (day_num >= 10) { digit = day_num / 10; day_x -= calitem->digit_widths[digit]; - num_chars += sprintf (&buffer[num_chars], get_digit_fomat (), digit); + num_chars += sprintf ( + &buffer[num_chars], + get_digit_fomat (), digit); } digit = day_num % 10; @@ -2117,7 +2121,8 @@ e_calendar_item_button_press (ECalendarItem *calitem, tmp_start_moff = calitem->selection_start_month_offset; tmp_start_day = calitem->selection_start_day; - e_calendar_item_round_down_selection (calitem, &tmp_start_moff, &tmp_start_day); + e_calendar_item_round_down_selection ( + calitem, &tmp_start_moff, &tmp_start_day); e_calendar_item_round_down_selection (calitem, &month_offset, &day); month_offset += calitem->selection_start_month_offset - tmp_start_moff; diff --git a/widgets/misc/e-calendar.c b/widgets/misc/e-calendar.c index b0e8cbe12f..2c0c6ab9c0 100644 --- a/widgets/misc/e-calendar.c +++ b/widgets/misc/e-calendar.c @@ -137,10 +137,11 @@ e_calendar_init (ECalendar *cal) /* Create the small font. */ - small_font_desc = - pango_font_description_copy (gtk_widget_get_style (GTK_WIDGET (cal))->font_desc); - pango_font_description_set_size (small_font_desc, - E_CALENDAR_SMALL_FONT_PTSIZE * PANGO_SCALE); + small_font_desc = pango_font_description_copy ( + gtk_widget_get_style (GTK_WIDGET (cal))->font_desc); + pango_font_description_set_size ( + small_font_desc, + E_CALENDAR_SMALL_FONT_PTSIZE * PANGO_SCALE); canvas_group = GNOME_CANVAS_GROUP (GNOME_CANVAS (cal)->root); diff --git a/widgets/misc/e-canvas.c b/widgets/misc/e-canvas.c index c5d953b396..b27b7182d7 100644 --- a/widgets/misc/e-canvas.c +++ b/widgets/misc/e-canvas.c @@ -222,7 +222,8 @@ pick_current_item (GnomeCanvas *canvas, GdkEvent *event) * synthesize an enter event. */ if (event != &canvas->pick_event) { - if ((event->type == GDK_MOTION_NOTIFY) || (event->type == GDK_BUTTON_RELEASE)) { + if ((event->type == GDK_MOTION_NOTIFY) || + (event->type == GDK_BUTTON_RELEASE)) { /* these fields have the same offsets in both types of events */ canvas->pick_event.crossing.type = GDK_ENTER_NOTIFY; diff --git a/widgets/misc/e-dateedit.c b/widgets/misc/e-dateedit.c index 7fb0f8cd79..acc3c08fe5 100644 --- a/widgets/misc/e-dateedit.c +++ b/widgets/misc/e-dateedit.c @@ -1918,8 +1918,8 @@ e_date_edit_update_date_entry (EDateEdit *dedit) gtk_entry_set_text (GTK_ENTRY (priv->date_entry), C_("date", "None")); } else { /* This is a strftime() format for a short date. - %x the preferred date representation for the current locale without the time, - but has forced to use 4 digit year */ + * %x the preferred date representation for the current locale + * without the time, but is forced to use 4 digit year. */ gchar *format = e_time_get_d_fmt_with_4digit_year (); time_t tt; diff --git a/widgets/misc/e-import-assistant.c b/widgets/misc/e-import-assistant.c index 3069692f52..69cf847ae5 100644 --- a/widgets/misc/e-import-assistant.c +++ b/widgets/misc/e-import-assistant.c @@ -614,7 +614,8 @@ import_simple_done (EImport *ei, gpointer user_data) /* process next file URI */ g_free (priv->simple_page.target->uri_src); - priv->simple_page.target->uri_src = g_ptr_array_remove_index (priv->fileuris, 0); + priv->simple_page.target->uri_src = + g_ptr_array_remove_index (priv->fileuris, 0); e_import_import ( priv->import, priv->import_target, diff --git a/widgets/misc/e-map.c b/widgets/misc/e-map.c index ef1d805130..dd02486a43 100644 --- a/widgets/misc/e-map.c +++ b/widgets/misc/e-map.c @@ -945,7 +945,9 @@ e_map_set_zoom (EMap *map, EMapZoomState zoom) } void -e_map_zoom_to_location (EMap *map, gdouble longitude, gdouble latitude) +e_map_zoom_to_location (EMap *map, + gdouble longitude, + gdouble latitude) { gdouble prevlong, prevlat; gdouble prevzoom; @@ -959,7 +961,9 @@ e_map_zoom_to_location (EMap *map, gdouble longitude, gdouble latitude) e_map_set_zoom (map, E_MAP_ZOOMED_IN); center_at (map, longitude, latitude); - e_map_tween_new_from (map, E_MAP_TWEEN_DURATION_MSECS, prevlong, prevlat, prevzoom); + e_map_tween_new_from ( + map, E_MAP_TWEEN_DURATION_MSECS, + prevlong, prevlat, prevzoom); } void diff --git a/widgets/misc/e-searching-tokenizer.c b/widgets/misc/e-searching-tokenizer.c index 6d34b6d8f0..3da81e44bd 100644 --- a/widgets/misc/e-searching-tokenizer.c +++ b/widgets/misc/e-searching-tokenizer.c @@ -272,9 +272,10 @@ build_trie (gint nocase, gint len, guchar **words) /* Step 2: Build failure graph */ - /* This searches for the longest substring which is a prefix of another string and - builds a graph of failure links so you can find multiple substrings concurrently, - using aho-corasick's algorithm */ + /* This searches for the longest substring which is a prefix of + * another string and builds a graph of failure links so you can + * find multiple substrings concurrently, using aho-corasick's + * algorithm. */ for (i=0;i<state_depth_size;i++) { q = state_depth[i]; @@ -726,7 +727,8 @@ searcher_next_token (struct _searcher *s) if (q->matches == NULL) { if (s->submatchp == 0) { - /* nothing pending, always put something in so we can try merge */ + /* nothing pending, always put + * something in so we can try merge */ push_subpending (s, offstart, offend); } else if (!merge_subpending (s, offstart, offend)) { /* can't merge, output what we have, and start againt */ diff --git a/widgets/misc/e-selection-model-simple.c b/widgets/misc/e-selection-model-simple.c index 1bdd99c3eb..e7bd0c2f16 100644 --- a/widgets/misc/e-selection-model-simple.c +++ b/widgets/misc/e-selection-model-simple.c @@ -44,12 +44,11 @@ e_selection_model_simple_init (ESelectionModelSimple *selection) } static void -e_selection_model_simple_class_init (ESelectionModelSimpleClass *klass) +e_selection_model_simple_class_init (ESelectionModelSimpleClass *class) { ESelectionModelArrayClass *esma_class; - esma_class = E_SELECTION_MODEL_ARRAY_CLASS (klass); - + esma_class = E_SELECTION_MODEL_ARRAY_CLASS (class); esma_class->get_row_count = esms_get_row_count; } @@ -68,7 +67,7 @@ e_selection_model_simple_new (void) void e_selection_model_simple_set_row_count (ESelectionModelSimple *esms, - gint row_count) + gint row_count) { if (esms->row_count != row_count) { ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY (esms); @@ -78,6 +77,7 @@ e_selection_model_simple_set_row_count (ESelectionModelSimple *esms, esma->selected_row = -1; esma->selected_range_end = -1; } + esms->row_count = row_count; } @@ -89,27 +89,31 @@ esms_get_row_count (ESelectionModelArray *esma) return esms->row_count; } -void e_selection_model_simple_insert_rows (ESelectionModelSimple *esms, - gint row, - gint count) +void +e_selection_model_simple_insert_rows (ESelectionModelSimple *esms, + gint row, + gint count) { esms->row_count += count; - e_selection_model_array_insert_rows (E_SELECTION_MODEL_ARRAY (esms), row, count); + e_selection_model_array_insert_rows ( + E_SELECTION_MODEL_ARRAY (esms), row, count); } void -e_selection_model_simple_delete_rows (ESelectionModelSimple *esms, - gint row, - gint count) +e_selection_model_simple_delete_rows (ESelectionModelSimple *esms, + gint row, + gint count) { esms->row_count -= count; - e_selection_model_array_delete_rows (E_SELECTION_MODEL_ARRAY (esms), row, count); + e_selection_model_array_delete_rows ( + E_SELECTION_MODEL_ARRAY (esms), row, count); } void -e_selection_model_simple_move_row (ESelectionModelSimple *esms, - gint old_row, - gint new_row) +e_selection_model_simple_move_row (ESelectionModelSimple *esms, + gint old_row, + gint new_row) { - e_selection_model_array_move_row (E_SELECTION_MODEL_ARRAY (esms), old_row, new_row); + e_selection_model_array_move_row ( + E_SELECTION_MODEL_ARRAY (esms), old_row, new_row); } diff --git a/widgets/table/e-cell-number.c b/widgets/table/e-cell-number.c index 7e9395ba6c..7944bbea51 100644 --- a/widgets/table/e-cell-number.c +++ b/widgets/table/e-cell-number.c @@ -37,7 +37,11 @@ G_DEFINE_TYPE (ECellNumber, e_cell_number, E_TYPE_CELL_TEXT) static gchar * ecn_get_text (ECellText *cell, ETableModel *model, gint col, gint row) { - return e_format_number (GPOINTER_TO_INT (e_table_model_value_at (model, col, row))); + gpointer value; + + value = e_table_model_value_at (model, col, row); + + return e_format_number (GPOINTER_TO_INT (value)); } static void diff --git a/widgets/table/e-cell-toggle.c b/widgets/table/e-cell-toggle.c index 06b26c53d4..bec9f5d005 100644 --- a/widgets/table/e-cell-toggle.c +++ b/widgets/table/e-cell-toggle.c @@ -246,10 +246,13 @@ cell_toggle_event (ECellView *ecell_view, return FALSE; /* Fall through */ case GDK_BUTTON_PRESS: - if (!e_table_model_is_cell_editable (ecell_view->e_table_model, model_col, row)) + if (!e_table_model_is_cell_editable ( + ecell_view->e_table_model, model_col, row)) return FALSE; - etog_set_value (toggle_view, model_col, view_col, row, value + 1); + etog_set_value ( + toggle_view, model_col, view_col, row, value + 1); + return TRUE; default: diff --git a/widgets/table/e-table-config.c b/widgets/table/e-table-config.c index 9b85cd3b85..4bfb80d1e9 100644 --- a/widgets/table/e-table-config.c +++ b/widgets/table/e-table-config.c @@ -1398,19 +1398,19 @@ e_table_config_construct (ETableConfig *config, * Returns: The config object. */ ETableConfig * -e_table_config_new (const gchar *header, - ETableSpecification *spec, - ETableState *state, - GtkWindow *parent_window) +e_table_config_new (const gchar *header, + ETableSpecification *spec, + ETableState *state, + GtkWindow *parent_window) { - ETableConfig *config = g_object_new (E_TYPE_TABLE_CONFIG, NULL); + ETableConfig *config; GtkDialog *dialog; GtkWidget *widget; - if (e_table_config_construct (config, header, spec, state, parent_window) == NULL) { - g_object_unref (config); - return NULL; - } + config = g_object_new (E_TYPE_TABLE_CONFIG, NULL); + + e_table_config_construct ( + config, header, spec, state, parent_window); dialog = GTK_DIALOG (config->dialog_toplevel); diff --git a/widgets/table/e-table-field-chooser-item.c b/widgets/table/e-table-field-chooser-item.c index 451b0388b0..e2dc6f1721 100644 --- a/widgets/table/e-table-field-chooser-item.c +++ b/widgets/table/e-table-field-chooser-item.c @@ -129,7 +129,9 @@ etfci_rebuild_combined (ETableFieldChooserItem *etfci) ETableCol *ecol = e_table_header_get_column (etfci->header, i); if (ecol->disabled) continue; - g_hash_table_insert (hash, GINT_TO_POINTER (ecol->col_idx), GINT_TO_POINTER (1)); + g_hash_table_insert ( + hash, GINT_TO_POINTER (ecol->col_idx), + GINT_TO_POINTER (1)); } count = e_table_header_count (etfci->full_header); @@ -357,13 +359,17 @@ etfci_set_property (GObject *object, case PROP_FULL_HEADER: etfci_drop_full_header (etfci); if (g_value_get_object (value)) - etfci_add_full_header (etfci, E_TABLE_HEADER (g_value_get_object (value))); + etfci_add_full_header ( + etfci, E_TABLE_HEADER ( + g_value_get_object (value))); break; case PROP_HEADER: etfci_drop_table_header (etfci); if (g_value_get_object (value)) - etfci_add_table_header (etfci, E_TABLE_HEADER (g_value_get_object (value))); + etfci_add_table_header ( + etfci, E_TABLE_HEADER ( + g_value_get_object (value))); break; case PROP_DND_CODE: diff --git a/widgets/table/e-table-group-leaf.c b/widgets/table/e-table-group-leaf.c index 46f30a9cf4..bf4f1553aa 100644 --- a/widgets/table/e-table-group-leaf.c +++ b/widgets/table/e-table-group-leaf.c @@ -151,10 +151,10 @@ e_table_group_leaf_construct (GnomeCanvasGroup *parent, */ ETableGroup * e_table_group_leaf_new (GnomeCanvasGroup *parent, - ETableHeader *full_header, - ETableHeader *header, - ETableModel *model, - ETableSortInfo *sort_info) + ETableHeader *full_header, + ETableHeader *header, + ETableModel *model, + ETableSortInfo *sort_info) { ETableGroupLeaf *etgl; @@ -162,32 +162,44 @@ e_table_group_leaf_new (GnomeCanvasGroup *parent, etgl = g_object_new (E_TYPE_TABLE_GROUP_LEAF, NULL); - e_table_group_leaf_construct (parent, etgl, full_header, - header, model, sort_info); + e_table_group_leaf_construct ( + parent, etgl, full_header, + header, model, sort_info); + return E_TABLE_GROUP (etgl); } static void -etgl_cursor_change (GObject *object, gint row, ETableGroupLeaf *etgl) +etgl_cursor_change (GObject *object, + gint row, + ETableGroupLeaf *etgl) { if (row < E_TABLE_SUBSET (etgl->ets)->n_map) - e_table_group_cursor_change (E_TABLE_GROUP (etgl), - E_TABLE_SUBSET (etgl->ets)->map_table[row]); + e_table_group_cursor_change ( + E_TABLE_GROUP (etgl), + E_TABLE_SUBSET (etgl->ets)->map_table[row]); } static void -etgl_cursor_activated (GObject *object, gint view_row, ETableGroupLeaf *etgl) +etgl_cursor_activated (GObject *object, + gint view_row, + ETableGroupLeaf *etgl) { if (view_row < E_TABLE_SUBSET (etgl->ets)->n_map) - e_table_group_cursor_activated (E_TABLE_GROUP (etgl), - E_TABLE_SUBSET (etgl->ets)->map_table[view_row]); + e_table_group_cursor_activated ( + E_TABLE_GROUP (etgl), + E_TABLE_SUBSET (etgl->ets)->map_table[view_row]); } static void -etgl_double_click (GObject *object, gint model_row, gint model_col, GdkEvent *event, - ETableGroupLeaf *etgl) +etgl_double_click (GObject *object, + gint model_row, + gint model_col, + GdkEvent *event, + ETableGroupLeaf *etgl) { - e_table_group_double_click (E_TABLE_GROUP (etgl), model_row, model_col, event); + e_table_group_double_click ( + E_TABLE_GROUP (etgl), model_row, model_col, event); } static gboolean @@ -207,21 +219,28 @@ etgl_key_press (GObject *object, } static gboolean -etgl_start_drag (GObject *object, gint model_row, gint model_col, GdkEvent *event, - ETableGroupLeaf *etgl) +etgl_start_drag (GObject *object, + gint model_row, + gint model_col, + GdkEvent *event, + ETableGroupLeaf *etgl) { - return e_table_group_start_drag (E_TABLE_GROUP (etgl), model_row, model_col, event); + return e_table_group_start_drag ( + E_TABLE_GROUP (etgl), model_row, model_col, event); } static gboolean -etgl_right_click (GObject *object, gint view_row, gint model_col, GdkEvent *event, - ETableGroupLeaf *etgl) +etgl_right_click (GObject *object, + gint view_row, + gint model_col, + GdkEvent *event, + ETableGroupLeaf *etgl) { if (view_row < E_TABLE_SUBSET (etgl->ets)->n_map) - return e_table_group_right_click (E_TABLE_GROUP (etgl), - E_TABLE_SUBSET (etgl->ets)->map_table[view_row], - model_col, - event); + return e_table_group_right_click ( + E_TABLE_GROUP (etgl), + E_TABLE_SUBSET (etgl->ets)->map_table[view_row], + model_col, event); else return FALSE; } @@ -234,10 +253,10 @@ etgl_click (GObject *object, ETableGroupLeaf *etgl) { if (row < E_TABLE_SUBSET (etgl->ets)->n_map) - return e_table_group_click (E_TABLE_GROUP (etgl), - E_TABLE_SUBSET (etgl->ets)->map_table[row], - col, - event); + return e_table_group_click ( + E_TABLE_GROUP (etgl), + E_TABLE_SUBSET (etgl->ets)->map_table[row], + col, event); else return FALSE; } @@ -247,12 +266,8 @@ etgl_reflow (GnomeCanvasItem *item, gint flags) { ETableGroupLeaf *leaf = E_TABLE_GROUP_LEAF (item); - g_object_get (leaf->item, - "height", &leaf->height, - NULL); - g_object_get (leaf->item, - "width", &leaf->width, - NULL); + g_object_get (leaf->item, "height", &leaf->height, NULL); + g_object_get (leaf->item, "width", &leaf->width, NULL); e_canvas_item_request_parent_reflow (item); } diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c index d8a7d0d7a0..16633f967c 100644 --- a/widgets/table/e-table-header-item.c +++ b/widgets/table/e-table-header-item.c @@ -1625,13 +1625,13 @@ ethi_header_context_menu (ETableHeaderItem *ethi, GdkEventButton *event) info->ethi = ethi; info->col = ethi_find_col_by_x (ethi, event->x); - popup = e_popup_menu_create_with_domain (ethi_context_menu, - 1 + - 0 + - ((ethi->table || ethi->tree) ? 0 : 4) + - ((e_table_header_count (ethi->eth) > 1) ? 0 : 8), - ((e_table_sort_info_get_can_group (ethi->sort_info)) ? 0 : 16) + - 128, info, GETTEXT_PACKAGE); + popup = e_popup_menu_create_with_domain ( + ethi_context_menu, + 1 + + ((ethi->table || ethi->tree) ? 0 : 4) + + ((e_table_header_count (ethi->eth) > 1) ? 0 : 8), + ((e_table_sort_info_get_can_group (ethi->sort_info)) ? 0 : 16) + + 128, info, GETTEXT_PACKAGE); menu_item = gtk_menu_item_new_with_mnemonic (_("_Sort By")); gtk_widget_show (menu_item); @@ -1761,9 +1761,9 @@ ethi_change_sort_state (ETableHeaderItem *ethi, ETableCol *col) gint j; for (j = i + 1; j < length; j++) - e_table_sort_info_sorting_set_nth (ethi->sort_info, - j - 1, - e_table_sort_info_sorting_get_nth (ethi->sort_info, j)); + e_table_sort_info_sorting_set_nth ( + ethi->sort_info, j - 1, + e_table_sort_info_sorting_get_nth (ethi->sort_info, j)); e_table_sort_info_sorting_truncate (ethi->sort_info, length - 1); length--; @@ -1968,7 +1968,8 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) (e->key.keyval == GDK_KEY_KP_Left)) { ETableCol *ecol; - if ((ethi->selected_col <= 0) || (ethi->selected_col >= ethi->eth->col_count)) + if ((ethi->selected_col <= 0) || + (ethi->selected_col >= ethi->eth->col_count)) ethi->selected_col = ethi->eth->col_count - 1; else ethi->selected_col--; diff --git a/widgets/table/e-table-without.c b/widgets/table/e-table-without.c index ea2554b7bc..59d254c862 100644 --- a/widgets/table/e-table-without.c +++ b/widgets/table/e-table-without.c @@ -193,7 +193,8 @@ etw_proxy_model_rows_deleted (ETableSubset *etss, gboolean shift = FALSE; for (i = 0; i < etss->n_map; i++) { - if (etss->map_table[i] >= model_row && etss->map_table[i] < model_row + count) { + if (etss->map_table[i] >= model_row && + etss->map_table[i] < model_row + count) { remove_row (etw, i); i--; } else if (etss->map_table[i] >= model_row + count) { diff --git a/widgets/table/e-tree-memory.c b/widgets/table/e-tree-memory.c index eec9333e65..4b9a977f05 100644 --- a/widgets/table/e-tree-memory.c +++ b/widgets/table/e-tree-memory.c @@ -514,11 +514,14 @@ e_tree_memory_node_insert (ETreeMemory *tree_model, if (parent_path != NULL) { e_tree_memory_path_insert (parent_path, position, new_path); if (!tree_model->priv->frozen) - e_tree_model_node_inserted (E_TREE_MODEL (tree_model), parent_path, new_path); + e_tree_model_node_inserted ( + E_TREE_MODEL (tree_model), + parent_path, new_path); } else { priv->root = new_path; if (!tree_model->priv->frozen) - e_tree_model_node_changed (E_TREE_MODEL (tree_model), new_path); + e_tree_model_node_changed ( + E_TREE_MODEL (tree_model), new_path); } return new_path; diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c index fe9f3d7474..25fdcc7e48 100644 --- a/widgets/table/e-tree.c +++ b/widgets/table/e-tree.c @@ -1257,7 +1257,8 @@ e_tree_set_state_object (ETree *e_tree, ETableState *state) NULL); if (e_tree->priv->etta) - e_tree_table_adapter_set_sort_info (e_tree->priv->etta, e_tree->priv->sort_info); + e_tree_table_adapter_set_sort_info ( + e_tree->priv->etta, e_tree->priv->sort_info); e_tree_state_change (e_tree); } @@ -2065,11 +2066,17 @@ e_tree_get_next_row (ETree *e_tree, return e_sorter_sorted_to_model (E_SORTER (e_tree->priv->sorter), i); } else return -1; - } else - if (model_row < e_table_model_row_count (E_TABLE_MODEL (e_tree->priv->etta)) - 1) + } else { + gint row_count; + + row_count = e_table_model_row_count ( + E_TABLE_MODEL (e_tree->priv->etta)); + + if (model_row < row_count - 1) return model_row + 1; else return -1; + } } gint diff --git a/widgets/table/gal-a11y-e-cell-vbox.c b/widgets/table/gal-a11y-e-cell-vbox.c index bbe278537a..e663bb1f1f 100644 --- a/widgets/table/gal-a11y-e-cell-vbox.c +++ b/widgets/table/gal-a11y-e-cell-vbox.c @@ -220,7 +220,8 @@ AtkObject *gal_a11y_e_cell_vbox_new (ETableItem *item, a11y = g_object_new (gal_a11y_e_cell_vbox_get_type (), NULL); - gal_a11y_e_cell_construct (a11y, item, cell_view, parent, model_col, view_col, row); + gal_a11y_e_cell_construct ( + a11y, item, cell_view, parent, model_col, view_col, row); gaec = GAL_A11Y_E_CELL (a11y); gaev = GAL_A11Y_E_CELL_VBOX (a11y); diff --git a/widgets/table/gal-a11y-e-cell.c b/widgets/table/gal-a11y-e-cell.c index 0ba51dcb4d..d5853270a4 100644 --- a/widgets/table/gal-a11y-e-cell.c +++ b/widgets/table/gal-a11y-e-cell.c @@ -350,7 +350,9 @@ gal_a11y_e_cell_remove_action_by_name (GalA11yECell *cell, g_return_val_if_fail (GAL_A11Y_IS_E_CELL (cell), FALSE); for (list_node = cell->action_list; list_node && !action_found; list_node = list_node->next) { - if (!g_ascii_strcasecmp (((ActionInfo *)(list_node->data))->name, action_name)) { + if (!g_ascii_strcasecmp ( + ((ActionInfo *)(list_node->data))->name, + action_name)) { action_found = TRUE; break; } diff --git a/widgets/text/e-text-model.c b/widgets/text/e-text-model.c index 10f32b1592..f079346b72 100644 --- a/widgets/text/e-text-model.c +++ b/widgets/text/e-text-model.c @@ -155,7 +155,6 @@ e_text_model_dispose (GObject *object) { ETextModel *model; - g_return_if_fail (object != NULL); g_return_if_fail (E_IS_TEXT_MODEL (object)); model = E_TEXT_MODEL (object); @@ -300,7 +299,6 @@ e_text_model_real_delete (ETextModel *model, gint position, gint length) void e_text_model_changed (ETextModel *model) { - g_return_if_fail (model != NULL); g_return_if_fail (E_IS_TEXT_MODEL (model)); /* @@ -326,7 +324,6 @@ e_text_model_cancel_completion (ETextModel *model) void e_text_model_reposition (ETextModel *model, ETextModelReposFn fn, gpointer repos_data) { - g_return_if_fail (model != NULL); g_return_if_fail (E_IS_TEXT_MODEL (model)); g_return_if_fail (fn != NULL); @@ -338,7 +335,6 @@ e_text_model_reposition (ETextModel *model, ETextModelReposFn fn, gpointer repos gint e_text_model_validate_position (ETextModel *model, gint pos) { - g_return_val_if_fail (model != NULL, 0); g_return_val_if_fail (E_IS_TEXT_MODEL (model), 0); if (E_TEXT_MODEL_GET_CLASS (model)->validate_pos) @@ -350,7 +346,6 @@ e_text_model_validate_position (ETextModel *model, gint pos) const gchar * e_text_model_get_text (ETextModel *model) { - g_return_val_if_fail (model != NULL, NULL); g_return_val_if_fail (E_IS_TEXT_MODEL (model), NULL); if (E_TEXT_MODEL_GET_CLASS (model)->get_text) @@ -362,7 +357,6 @@ e_text_model_get_text (ETextModel *model) gint e_text_model_get_text_length (ETextModel *model) { - g_return_val_if_fail (model != NULL, 0); g_return_val_if_fail (E_IS_TEXT_MODEL (model), 0); if (E_TEXT_MODEL_GET_CLASS (model)->get_text_len (model)) { @@ -388,7 +382,6 @@ e_text_model_get_text_length (ETextModel *model) void e_text_model_set_text (ETextModel *model, const gchar *text) { - g_return_if_fail (model != NULL); g_return_if_fail (E_IS_TEXT_MODEL (model)); if (E_TEXT_MODEL_GET_CLASS (model)->set_text) @@ -398,7 +391,6 @@ e_text_model_set_text (ETextModel *model, const gchar *text) void e_text_model_insert (ETextModel *model, gint position, const gchar *text) { - g_return_if_fail (model != NULL); g_return_if_fail (E_IS_TEXT_MODEL (model)); if (text == NULL) @@ -414,7 +406,6 @@ e_text_model_insert_length (ETextModel *model, const gchar *text, gint length) { - g_return_if_fail (model != NULL); g_return_if_fail (E_IS_TEXT_MODEL (model)); g_return_if_fail (length >= 0); @@ -428,7 +419,6 @@ e_text_model_insert_length (ETextModel *model, void e_text_model_prepend (ETextModel *model, const gchar *text) { - g_return_if_fail (model != NULL); g_return_if_fail (E_IS_TEXT_MODEL (model)); if (text == NULL) @@ -440,7 +430,6 @@ e_text_model_prepend (ETextModel *model, const gchar *text) void e_text_model_append (ETextModel *model, const gchar *text) { - g_return_if_fail (model != NULL); g_return_if_fail (E_IS_TEXT_MODEL (model)); if (text == NULL) @@ -454,7 +443,6 @@ e_text_model_delete (ETextModel *model, gint position, gint length) { gint txt_len; - g_return_if_fail (model != NULL); g_return_if_fail (E_IS_TEXT_MODEL (model)); g_return_if_fail (length >= 0); @@ -472,7 +460,6 @@ e_text_model_delete (ETextModel *model, gint position, gint length) gint e_text_model_object_count (ETextModel *model) { - g_return_val_if_fail (model != NULL, 0); g_return_val_if_fail (E_IS_TEXT_MODEL (model), 0); if (E_TEXT_MODEL_GET_CLASS (model)->obj_count) @@ -484,7 +471,6 @@ e_text_model_object_count (ETextModel *model) const gchar * e_text_model_get_nth_object (ETextModel *model, gint n, gint *len) { - g_return_val_if_fail (model != NULL, NULL); g_return_val_if_fail (E_IS_TEXT_MODEL (model), NULL); if (n < 0 || n >= e_text_model_object_count (model)) @@ -502,7 +488,6 @@ e_text_model_strdup_nth_object (ETextModel *model, gint n) const gchar *obj; gint len = 0; - g_return_val_if_fail (model != NULL, NULL); g_return_val_if_fail (E_IS_TEXT_MODEL (model), NULL); obj = e_text_model_get_nth_object (model, n, &len); @@ -523,7 +508,6 @@ e_text_model_get_nth_object_bounds (ETextModel *model, gint n, gint *start, gint const gchar *txt = NULL, *obj = NULL; gint len = 0; - g_return_if_fail (model != NULL); g_return_if_fail (E_IS_TEXT_MODEL (model)); txt = e_text_model_get_text (model); @@ -540,7 +524,6 @@ e_text_model_get_nth_object_bounds (ETextModel *model, gint n, gint *start, gint gint e_text_model_get_object_at_offset (ETextModel *model, gint offset) { - g_return_val_if_fail (model != NULL, -1); g_return_val_if_fail (E_IS_TEXT_MODEL (model), -1); if (offset < 0 || offset >= e_text_model_get_text_length (model)) @@ -572,11 +555,11 @@ e_text_model_get_object_at_offset (ETextModel *model, gint offset) gint e_text_model_get_object_at_pointer (ETextModel *model, const gchar *s) { - g_return_val_if_fail (model != NULL, -1); g_return_val_if_fail (E_IS_TEXT_MODEL (model), -1); g_return_val_if_fail (s != NULL, -1); - return e_text_model_get_object_at_offset (model, s - e_text_model_get_text (model)); + return e_text_model_get_object_at_offset ( + model, s - e_text_model_get_text (model)); } void diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c index 175eea65d7..fefc0a3317 100644 --- a/widgets/text/e-text.c +++ b/widgets/text/e-text.c @@ -1483,16 +1483,21 @@ e_text_draw (GnomeCanvasItem *item, cairo_t *cr, else state = GTK_STATE_ACTIVE; - indices[0] = MIN (text->selection_start, text->selection_end); - indices[1] = MAX (text->selection_start, text->selection_end); + indices[0] = MIN ( + text->selection_start, + text->selection_end); + indices[1] = MAX ( + text->selection_start, + text->selection_end); /* convert these into byte indices */ - indices[0] = g_utf8_offset_to_pointer (text->text, indices[0]) - text->text; - indices[1] = g_utf8_offset_to_pointer (text->text, indices[1]) - text->text; + indices[0] = g_utf8_offset_to_pointer ( + text->text, indices[0]) - text->text; + indices[1] = g_utf8_offset_to_pointer ( + text->text, indices[1]) - text->text; - clip_region = gdk_pango_layout_get_clip_region (text->layout, - xpos, ypos, - indices, 1); + clip_region = gdk_pango_layout_get_clip_region ( + text->layout, xpos, ypos, indices, 1); gdk_cairo_region (cr, clip_region); cairo_clip (cr); cairo_region_destroy (clip_region); @@ -1506,7 +1511,10 @@ e_text_draw (GnomeCanvasItem *item, cairo_t *cr, } else { if (text->show_cursor) { PangoRectangle strong_pos, weak_pos; - gchar *offs = g_utf8_offset_to_pointer (text->text, text->selection_start); + gchar *offs; + + offs = g_utf8_offset_to_pointer ( + text->text, text->selection_start); pango_layout_get_cursor_pos ( text->layout, offs - text->text + @@ -1867,7 +1875,10 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) /* Simulate a GdkEventButton here, so that we can * call e_text_do_popup directly */ - GdkEventButton *button = (GdkEventButton *) gdk_event_new (GDK_BUTTON_PRESS); + GdkEventButton *button; + + button = (GdkEventButton *) + gdk_event_new (GDK_BUTTON_PRESS); button->time = event->key.time; button->button = 0; e_text_do_popup (text, button, 0); @@ -1883,7 +1894,9 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) gint ret; if (text->im_context && - gtk_im_context_filter_keypress (text->im_context, (GdkEventKey*) event)) { + gtk_im_context_filter_keypress ( + text->im_context, + (GdkEventKey*) event)) { text->need_im_reset = TRUE; return 1; } @@ -1935,10 +1948,12 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) e_tep_event.button.time = button.time; e_tep_event.button.state = button.state; e_tep_event.button.button = button.button; - e_tep_event.button.position = get_position_from_xy (text, button.x, button.y); + e_tep_event.button.position = + get_position_from_xy ( + text, button.x, button.y); _get_tep (text); - return_val = e_text_event_processor_handle_event (text->tep, - &e_tep_event); + return_val = e_text_event_processor_handle_event ( + text->tep, &e_tep_event); e_tep_event.type = GDK_BUTTON_RELEASE; } #else @@ -1954,8 +1969,11 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) /* We follow convention and emit popup events on right-clicks. */ if (event->type == GDK_BUTTON_PRESS && event->button.button == 3) { if (text->handle_popup) { - e_text_do_popup (text, &(event->button), - get_position_from_xy (text, event->button.x, event->button.y)); + e_text_do_popup ( + text, &(event->button), + get_position_from_xy ( + text, event->button.x, + event->button.y)); return 1; } else { @@ -1968,13 +1986,13 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) if (event->type == GDK_BUTTON_PRESS) { if (text->dbl_timeout == 0 && text->tpl_timeout == 0) { - text->dbl_timeout = g_timeout_add (200, - _click, - &(text->dbl_timeout)); + text->dbl_timeout = g_timeout_add ( + 200, _click, &(text->dbl_timeout)); } else { if (text->tpl_timeout == 0) { e_tep_event.type = GDK_2BUTTON_PRESS; - text->tpl_timeout = g_timeout_add (200, _click, &(text->tpl_timeout)); + text->tpl_timeout = g_timeout_add ( + 200, _click, &(text->tpl_timeout)); } else { e_tep_event.type = GDK_3BUTTON_PRESS; } @@ -1986,10 +2004,12 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) e_tep_event.button.time = button.time; e_tep_event.button.state = button.state; e_tep_event.button.button = button.button; - e_tep_event.button.position = get_position_from_xy (text, button.x, button.y); + e_tep_event.button.position = + get_position_from_xy ( + text, button.x, button.y); _get_tep (text); - return_val = e_text_event_processor_handle_event (text->tep, - &e_tep_event); + return_val = e_text_event_processor_handle_event ( + text->tep, &e_tep_event); if (event->button.button == 1) { if (event->type == GDK_BUTTON_PRESS) text->button_down = TRUE; @@ -2006,10 +2026,12 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) GdkEventMotion motion = event->motion; e_tep_event.motion.time = motion.time; e_tep_event.motion.state = motion.state; - e_tep_event.motion.position = get_position_from_xy (text, motion.x, motion.y); + e_tep_event.motion.position = + get_position_from_xy ( + text, motion.x, motion.y); _get_tep (text); - return_val = e_text_event_processor_handle_event (text->tep, - &e_tep_event); + return_val = e_text_event_processor_handle_event ( + text->tep, &e_tep_event); text->lastx = motion.x; text->lasty = motion.y; text->last_state = motion.state; @@ -2028,7 +2050,8 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) text->pointer_in = FALSE; if (text->editing || text->draw_borders) { if (!text->default_cursor_shown) { - gdk_window_set_cursor (window, text->default_cursor); + gdk_window_set_cursor ( + window, text->default_cursor); text->default_cursor_shown = TRUE; } } @@ -2329,18 +2352,17 @@ e_text_do_popup (EText *text, GdkEventButton *button, gint position) { PopupClosure *closure = g_new (PopupClosure, 1); - closure->text = text; - g_object_ref (closure->text); + closure->text = g_object_ref (text); closure->button = (GdkEventButton *) gdk_event_copy ((GdkEvent *) button); closure->position = position; gtk_clipboard_request_contents ( - - gtk_widget_get_clipboard (GTK_WIDGET (GNOME_CANVAS_ITEM (text)->canvas), - GDK_SELECTION_CLIPBOARD), - gdk_atom_intern ("TARGETS", FALSE), - popup_targets_received, - closure); + gtk_widget_get_clipboard ( + GTK_WIDGET (GNOME_CANVAS_ITEM (text)->canvas), + GDK_SELECTION_CLIPBOARD), + gdk_atom_intern ("TARGETS", FALSE), + popup_targets_received, + closure); } static void @@ -2430,7 +2452,8 @@ _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... */ + /* length checks to make sure we are not wandering + * off into nonexistant memory... */ if ((text->selection_end >= length) && (TRUE == direction)) /* forward */ return length; /* checking for -ve value wont hurt! */ @@ -2452,7 +2475,8 @@ _get_updated_position (EText *text, gboolean direction) new_pos = text->selection_end; while (1) { - /* check before moving forward/backwards if we have more chars to move or not */ + /* check before moving forward/backwards + * if we have more chars to move or not */ if (TRUE == direction) p = g_utf8_next_char (p); else @@ -2677,7 +2701,8 @@ _get_position (EText *text, ETextEventProcessorCommand *command) to activate that object. (Normally, double click == select word, which is why this is here.) */ - obj_num = e_text_model_get_object_at_offset (text->model, text->selection_start); + obj_num = e_text_model_get_object_at_offset ( + text->model, text->selection_start); if (obj_num != -1) { e_text_model_activate_nth_object (text->model, obj_num); new_pos = text->selection_start; |