- selected_rows = pspp_sheet_selection_get_range_set (selection);
- row = range_set_scan (selected_rows, 0);
- range_set_destroy (selected_rows);
-
- ref_cell_text = g_strdup_printf ("%d : %s", row + 1, var_get_name (var));
-
- show_value_labels = psppire_data_sheet_get_value_labels (data_sheet);
-
- psppire_value_entry_set_variable (value_entry, var);
- psppire_value_entry_set_show_value_label (value_entry,
- show_value_labels);
-
- width = var_get_width (var);
- value_init (&value, width);
- datasheet_get_value (de->data_store->datasheet,
- row, var_get_case_index (var), &value);
- psppire_value_entry_set_value (value_entry, &value, width);
- value_destroy (&value, width);
-
- gtk_widget_set_sensitive (de->datum_entry, TRUE);
- }
- else
- {
- if (n_cases == 0 || n_vars == 0)
- {
- ref_cell_text = NULL;
- }
- else
- {
- struct string s;
-
- /* The glib string library does not understand the ' printf modifier
- on all platforms, but the "struct string" library does (because
- Gnulib fixes that problem), so use the latter. */
- ds_init_empty (&s);
- ds_put_format (&s, ngettext ("%'d case", "%'d cases", n_cases),
- n_cases);
- ds_put_byte (&s, ' ');
- ds_put_unichar (&s, 0xd7); /* U+00D7 MULTIPLICATION SIGN */
- ds_put_byte (&s, ' ');
- ds_put_format (&s, ngettext ("%'d variable", "%'d variables",
- n_vars),
- n_vars);
- ref_cell_text = ds_steal_cstr (&s);
- }
-
- psppire_value_entry_set_variable (PSPPIRE_VALUE_ENTRY (de->datum_entry),
- NULL);
- gtk_entry_set_text (
- GTK_ENTRY (gtk_bin_get_child (GTK_BIN (de->datum_entry))), "");
- gtk_widget_set_sensitive (de->datum_entry, FALSE);