Commit 920bdb89 authored by Morten Welinder's avatar Morten Welinder

Compilation: prefer glib functions over goffice equivalents

parent 3ac68609
......@@ -171,10 +171,10 @@ libspreadsheet_reqs="
libxml-2.0 >= 2.4.12
"
gnumeric_reqs="$libspreadsheet_reqs
glib-2.0 >= 2.38.0
gobject-2.0 >= 2.38.0
gmodule-2.0 >= 2.38.0
gthread-2.0 >= 2.38.0
glib-2.0 >= 2.40.0
gobject-2.0 >= 2.40.0
gmodule-2.0 >= 2.40.0
gthread-2.0 >= 2.40.0
pango >= 1.24.0
pangocairo >= 1.24.0
"
......
......@@ -3384,9 +3384,9 @@ static OOCellStyle *
odf_oo_cell_style_copy (OOCellStyle *oostyle)
{
OOCellStyle *new = odf_oo_cell_style_new (oostyle->style);
new->styles = go_slist_map (oostyle->styles, (GOMapFunc)odf_oo_cell_style_ref);
new->conditions = go_slist_map (oostyle->conditions, (GOMapFunc)g_strdup);
new->bases = go_slist_map (oostyle->bases, (GOMapFunc)g_strdup);
new->styles = g_slist_copy_deep (oostyle->styles, (GCopyFunc)odf_oo_cell_style_ref, NULL);
new->conditions = g_slist_copy_deep (oostyle->conditions, (GCopyFunc)g_strdup, NULL);
new->bases = g_slist_copy_deep (oostyle->bases, (GCopyFunc)g_strdup, NULL);
return new;
}
......
......@@ -2926,7 +2926,9 @@ static GSList *
get_new_objects (Sheet *sheet, GSList *old)
{
GSList *objs =
g_slist_sort (go_slist_map (sheet->sheet_objects, g_object_ref),
g_slist_sort (g_slist_copy_deep (sheet->sheet_objects,
(GCopyFunc)g_object_ref,
NULL),
by_addr);
GSList *p = objs, *last = NULL;
......@@ -3008,8 +3010,9 @@ cmd_paste_copy_impl (GnmCommand *cmd, WorkbookControl *wbc,
// We cannot use the random set of objects at the target
// location. http://bugzilla.gnome.org/show_bug.cgi?id=308300
g_slist_free_full (contents->objects, g_object_unref);
contents->objects = go_slist_map (me->orig_contents_objects,
(GOMapFunc)sheet_object_dup);
contents->objects = g_slist_copy_deep
(me->orig_contents_objects,
(GCopyFunc)sheet_object_dup, NULL);
} else {
GSList *l;
for (l = contents->objects; l; l = l->next) {
......@@ -3104,7 +3107,8 @@ cmd_paste_copy (WorkbookControl *wbc,
me->only_objects = (cr->cols < 1 || cr->rows < 1);
me->pasted_objects = NULL;
me->orig_contents_objects =
go_slist_map (cr->objects, (GOMapFunc)sheet_object_dup);
g_slist_copy_deep (cr->objects,
(GCopyFunc)sheet_object_dup, NULL);
me->single_merge_to_single_merge = FALSE;
/* If the input is only objects ignore all this range stuff */
......
......@@ -314,8 +314,9 @@ gnm_ft_clone (GnmFT const *ft)
clone->category = ft->category;
clone->members = go_slist_map (ft->members,
(GOMapFunc)gnm_ft_member_clone);
clone->members =
g_slist_copy_deep (ft->members,
(GCopyFunc)gnm_ft_member_clone, NULL);
clone->number = ft->number;
clone->border = ft->border;
......
......@@ -274,7 +274,7 @@ gnm_soc_populate_menu (SheetObject *so, GPtrArray *actions)
GNM_SO_CLASS (parent_klass)->populate_menu (so, actions);
for (i = 0; i < G_N_ELEMENTS (soc_actions); i++)
go_ptr_array_insert (actions, (gpointer) (soc_actions + i), 1 + i);
g_ptr_array_insert (actions, 1 + i, (gpointer)(soc_actions + i));
}
static void
......
......@@ -407,8 +407,7 @@ gnm_sog_populate_menu (SheetObject *so, GPtrArray *actions)
GNM_SO_CLASS (parent_klass)->populate_menu (so, actions);
for (i = 0; i < G_N_ELEMENTS (sog_actions); i++)
go_ptr_array_insert (actions, (gpointer) (sog_actions + i), 1 + i);
g_ptr_array_insert (actions, 1 + i, (gpointer) (sog_actions + i));
}
static void
......
......@@ -345,7 +345,7 @@ gnm_soi_populate_menu (SheetObject *so, GPtrArray *actions)
static SheetObjectAction const soi_action =
{ "document-save-as", N_("_Save As Image"), NULL, 0, soi_cb_save_as };
gnm_soi_parent_class->populate_menu (so, actions);
go_ptr_array_insert (actions, (gpointer) &soi_action, 1);
g_ptr_array_insert (actions, 1, (gpointer) &soi_action);
}
static void
......
......@@ -259,8 +259,10 @@ static void
compile_terminators (StfParseOptions_t *parseoptions)
{
GSList *l;
GO_SLIST_SORT (parseoptions->terminator, (GCompareFunc)long_string_first);
parseoptions->terminator =
g_slist_sort (parseoptions->terminator,
(GCompareFunc)long_string_first);
parseoptions->compiled_terminator.min = 255;
parseoptions->compiled_terminator.max = 0;
for (l = parseoptions->terminator; l; l = l->next) {
......@@ -339,7 +341,8 @@ stf_parse_options_csv_set_separators (StfParseOptions_t *parseoptions,
parseoptions->sep.chr = g_strdup (character);
g_slist_free_full (parseoptions->sep.str, g_free);
parseoptions->sep.str = go_slist_map (seps, (GOMapFunc)g_strdup);
parseoptions->sep.str =
g_slist_copy_deep ((GSList *)seps, (GCopyFunc)g_strdup, NULL);
}
void
......
......@@ -172,8 +172,8 @@ gnm_scenario_dup (GnmScenario *src, Sheet *new_sheet)
dst = gnm_scenario_new (src->name, new_sheet);
gnm_scenario_set_comment (dst, src->comment);
dst->items = go_slist_map (src->items,
(GOMapFunc)gnm_scenario_item_dup);
dst->items = g_slist_copy_deep
(src->items, (GCopyFunc)gnm_scenario_item_dup, NULL);
return dst;
}
......
......@@ -1004,7 +1004,7 @@ workbook_sheet_attach_at_pos (Workbook *wb, Sheet *new_sheet, int pos)
pre_sheet_index_change (wb);
g_object_ref (new_sheet);
go_ptr_array_insert (wb->sheets, (gpointer)new_sheet, pos);
g_ptr_array_insert (wb->sheets, pos, (gpointer)new_sheet);
workbook_sheet_index_update (wb, pos);
g_hash_table_insert (wb->sheet_hash_private,
new_sheet->name_case_insensitive,
......@@ -1178,7 +1178,7 @@ workbook_sheet_move (Sheet *sheet, int direction)
int max_pos = MAX (old_pos, new_pos);
g_ptr_array_remove_index (wb->sheets, old_pos);
go_ptr_array_insert (wb->sheets, sheet, new_pos);
g_ptr_array_insert (wb->sheets, new_pos, sheet);
for (; max_pos >= min_pos ; max_pos--) {
Sheet *sheet = g_ptr_array_index (wb->sheets, max_pos);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment