-static void
-render_line (PsppSheetViewColumn *tree_column,
- GtkCellRenderer *cell,
- GtkTreeModel *tree_model,
- GtkTreeIter *iter,
- gpointer data)
-{
- gint row = empty_list_store_iter_to_row (iter);
- struct string *lines;
-
- lines = g_object_get_data (G_OBJECT (tree_model), "lines");
- g_return_if_fail (lines != NULL);
-
- g_object_set (cell, "text", ds_cstr (&lines[row]), NULL);
-}
-
-#endif
-
-/* Sets the widgets to match IA's first_line substructure. */
-static void
-set_first_line (PsppireImportAssistant *ia)
-{
- GtkTreePath *path = gtk_tree_path_new_from_indices (ia->skip_lines, -1);
-
-#if SHEET_MERGE
- set_model_on_treeview (ia, ia->tree_view, 0);
- pspp_sheet_view_set_cursor (PSPP_SHEET_VIEW (ia->tree_view),
- path, NULL, false);
-#endif
- gtk_tree_path_free (path);
-
- gtk_toggle_button_set_active (
- GTK_TOGGLE_BUTTON (ia->variable_names_cb),
- ia->variable_names);
- gtk_widget_set_sensitive (ia->variable_names_cb,
- ia->skip_lines > 0);
-}
-
-#if SHEET_MERGE
-
-/* Creates and returns a tree view that contains each of the
- lines in IA's file as a row. */
-static GtkWidget *
-create_lines_tree_view (GtkContainer *parent, PsppireImportAssistant *ia)
-{
- size_t max_line_length;
- gint content_width, header_width;
- size_t i;
- const gchar *title = _("Text");
- GtkWidget *tree_view = make_tree_view (ia);
- PsppSheetViewColumn *column =
- pspp_sheet_view_column_new_with_attributes (title,
- ia->fixed_renderer, (void *) NULL);
-
- pspp_sheet_view_column_set_cell_data_func (column, ia->fixed_renderer,
- render_line, NULL, NULL);
- pspp_sheet_view_column_set_resizable (column, TRUE);
- pspp_sheet_view_column_set_expand (column, TRUE);
-
- max_line_length = 0;
- for (i = 0; i < ia->line_cnt; i++)
- {
- size_t w = ds_length (&ia->lines[i]);
- max_line_length = MAX (max_line_length, w);
- }
-
- content_width = get_monospace_width (tree_view, ia->fixed_renderer,
- max_line_length);
- header_width = get_string_width (tree_view, ia->prop_renderer, title);
- pspp_sheet_view_column_set_fixed_width (column, MAX (content_width,
- header_width));
- pspp_sheet_view_append_column (PSPP_SHEET_VIEW (tree_view), column);
-
- GtkWidget *oldtv = gtk_bin_get_child (GTK_BIN (parent));
- if (oldtv)
- gtk_container_remove (parent, oldtv);
-
- gtk_container_add (parent, tree_view);
- gtk_widget_show (tree_view);
-
- return tree_view;
-}
-
-