clipboard store data with or without value labels depending on
the setting in the data view. clipboard cut was always storing
the raw data.
With this patch copy and cut both store raw data or labels
depending on the view setting.
Closes: https://savannah.gnu.org/bugs/?58757
case PROP_VALUE_LABELS:
{
gboolean l = g_value_get_boolean (value);
case PROP_VALUE_LABELS:
{
gboolean l = g_value_get_boolean (value);
+ de->use_value_labels = l;
g_object_set (de->data_sheet, "forward-conversion",
l ?
psppire_data_store_value_to_string_with_labels :
g_object_set (de->data_sheet, "forward-conversion",
l ?
psppire_data_store_value_to_string_with_labels :
g_value_set_pointer (value, de->dict);
break;
case PROP_VALUE_LABELS:
g_value_set_pointer (value, de->dict);
break;
case PROP_VALUE_LABELS:
+ g_value_set_boolean (value, de->use_value_labels);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
gtk_box_pack_start (GTK_BOX (hbox), de->datum_entry, TRUE, TRUE, 0);
de->split = FALSE;
gtk_box_pack_start (GTK_BOX (hbox), de->datum_entry, TRUE, TRUE, 0);
de->split = FALSE;
+ de->use_value_labels = FALSE;
de->data_sheet = psppire_data_sheet_new ();
GtkWidget *data_button = ssw_sheet_get_button (SSW_SHEET (de->data_sheet));
de->data_sheet = psppire_data_sheet_new ();
GtkWidget *data_button = ssw_sheet_get_button (SSW_SHEET (de->data_sheet));
GtkWidget *datum_entry; /* PsppireValueEntry for editing current cell. */
gboolean split; /* True if the sheets are in split view. */
GtkWidget *datum_entry; /* PsppireValueEntry for editing current cell. */
gboolean split; /* True if the sheets are in split view. */
+ gboolean use_value_labels; /* True if labels instead of data are shown. */
};
struct _PsppireDataEditorClass
};
struct _PsppireDataEditorClass
for (x = sel.start_x ; x <= sel.end_x; ++x)
{
const struct variable * var = psppire_dict_get_variable (dict, x);
for (x = sel.start_x ; x <= sel.end_x; ++x)
{
const struct variable * var = psppire_dict_get_variable (dict, x);
+ gboolean use_value_label = FALSE;
+ g_object_get (dw->data_editor, "value-labels", &use_value_label, NULL);
gchar *s = psppire_data_store_get_string (dw->data_editor->data_store,
gchar *s = psppire_data_store_get_string (dw->data_editor->data_store,
+ y, var, use_value_label);
g_string_append (str, s);
if (x < sel.end_x)
g_string_append (str, "\t");
g_string_append (str, s);
if (x < sel.end_x)
g_string_append (str, "\t");