X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fui%2Fgui%2Fdata-sheet.c;h=a9d980ded2e74a584dd9d34d0f5ed9601f44d772;hb=a6df7a4863f51dd4121a067f947335fba197617b;hp=1edeb330f8d101abae48aebd58a22ece2f89e433;hpb=dcf9b154cbcaa35c3d8459a201b77eec8bcb30bd;p=pspp-builds.git diff --git a/src/ui/gui/data-sheet.c b/src/ui/gui/data-sheet.c index 1edeb330..a9d980de 100644 --- a/src/ui/gui/data-sheet.c +++ b/src/ui/gui/data-sheet.c @@ -24,18 +24,18 @@ #include -#include "gtksheet.h" +#include -#include "gsheet-uniform-row.h" +#include #include "psppire-dict.h" #include "psppire-variable.h" #include "psppire-data-store.h" #include "helper.h" -#include "value-labels.h" -#include "case.h" -#include "data-in.h" +#include +#include +#include #include "menu-actions.h" #include "data-sheet.h" @@ -70,9 +70,10 @@ static gboolean click2column(GtkWidget *w, gint col, gpointer data) { gint current_row, current_column; - select_sheet(PAGE_VAR_SHEET); GtkWidget *var_sheet = get_widget_assert(xml, "variable_sheet"); + select_sheet(PAGE_VAR_SHEET); + gtk_sheet_get_active_cell(GTK_SHEET(var_sheet), ¤t_row, ¤t_column); @@ -84,28 +85,37 @@ click2column(GtkWidget *w, gint col, gpointer data) /* Update the data_ref_entry with the reference of the active cell */ static gint -update_data_ref_entry(GtkSheet *sheet, gint row, gint col) +update_data_ref_entry(const GtkSheet *sheet, gint row, gint col) { + /* The entry where the reference to the current cell is displayed */ GtkEntry *cell_ref_entry; PsppireDataStore *data_store = PSPPIRE_DATA_STORE(gtk_sheet_get_model(sheet)); + if (data_store) + { + const struct PsppireVariable *pv = + psppire_dict_get_variable(data_store->dict, col); + gchar *text ; + gchar *s ; - if ( !xml) - return FALSE; - - const struct PsppireVariable *pv = - psppire_dict_get_variable(data_store->dict, col); + if ( !xml) + return FALSE; - gchar *text = g_strdup_printf("%d: %s", row, - pv ? psppire_variable_get_name(pv) : ""); + text = g_strdup_printf("%d: %s", row, + pv ? psppire_variable_get_name(pv) : ""); - cell_ref_entry = GTK_ENTRY(get_widget_assert(xml, "cell_ref_entry")); + cell_ref_entry = GTK_ENTRY(get_widget_assert(xml, "cell_ref_entry")); + + s = pspp_locale_to_utf8(text, -1, 0); + + g_free(text); - gtk_entry_set_text(cell_ref_entry, text); + gtk_entry_set_text(cell_ref_entry, s); - g_free(text); + g_free(s); + } return FALSE; } @@ -119,7 +129,6 @@ psppire_data_sheet_create (gchar *widget_name, gchar *string1, gchar *string2, gint int1, gint int2) { GtkWidget *sheet; - gint i; const gint rows = 10046;