break;
}
}
+
+/* Set the datum at COL, ROW, to that contained in VALUE.
+ */
+static void
+store_set_datum (GtkTreeModel *model, gint col, gint row,
+ const GValue *value)
+{
+ PsppireDataStore *store = PSPPIRE_DATA_STORE (model);
+ GVariant *v = g_value_get_variant (value);
+ union value uv;
+ value_variant_get (&uv, v);
+ const struct variable *var = psppire_dict_get_variable (store->dict, col);
+ psppire_data_store_set_value (store, row, var, &uv);
+ value_destroy_from_variant (&uv, v);
+}
+
+void
+psppire_data_editor_paste (PsppireDataEditor *de)
+{
+ JmdSheet *sheet = JMD_SHEET (de->data_sheet);
+ GtkClipboard *clip =
+ gtk_clipboard_get_for_display (gtk_widget_get_display (GTK_WIDGET (sheet)),
+ GDK_SELECTION_CLIPBOARD);
+
+ jmd_sheet_paste (sheet, clip, store_set_datum);
+}
enum {PSPPIRE_DATA_EDITOR_DATA_VIEW = 0, PSPPIRE_DATA_EDITOR_VARIABLE_VIEW};
-
-
+void psppire_data_editor_paste (PsppireDataEditor *de);
G_END_DECLS
}
}
-
-
static void
on_copy (PsppireDataWindow *dw)
{
}
}
-
-static void
-trf (GtkClipboard *clip,
- GdkAtom *atoms,
- gint n_atoms,
- gpointer data)
-{
- int i;
- for (i = 0; i < n_atoms; ++i)
- {
- g_print ("%s\n", gdk_atom_name (atoms[i]));
- }
-}
-
static void
on_paste (PsppireDataWindow *dw)
{
int p = gtk_notebook_get_current_page (GTK_NOTEBOOK (dw->data_editor));
if (p == PSPPIRE_DATA_EDITOR_DATA_VIEW)
{
- GtkClipboard *clip =
- gtk_clipboard_get_for_display (gtk_widget_get_display (GTK_WIDGET (dw)),
- GDK_SELECTION_CLIPBOARD);
-
- gtk_clipboard_request_targets (clip, trf, dw);
+ psppire_data_editor_paste (dw->data_editor);
}
}
-
static void
on_clear_cases (PsppireDataWindow *dw)
{
}
}
-
-
static void
insert_variable (PsppireDataWindow *dw)
{
}
}
-
-
static void
insert_case_at_row (PsppireDataWindow *dw)
{
psppire_data_editor_insert_new_case_at_posn (de, range->start_y);
}
-
static void
goto_case (PsppireDataWindow *dw)
{
}
}
-
static GtkWidget *
create_file_menu (PsppireDataWindow *dw)
{