/[pspp]/psppire/src/data_sheet.c
ViewVC logotype

Diff of /psppire/src/data_sheet.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by jmd, Tue Oct 25 12:45:29 2005 UTC revision 1.5 by jmd, Wed Oct 26 08:55:09 2005 UTC
# Line 73  update_variable(GObject *obj, gint colum Line 73  update_variable(GObject *obj, gint colum
73    
74    GtkSheet *sheet = GTK_SHEET(data);    GtkSheet *sheet = GTK_SHEET(data);
75    
76    struct variable *var = g_ptr_array_index(dict->array, column);    struct variable *var = pspp_dict_get_var(dict, column);
77    
78    gtk_sheet_column_button_add_label (sheet, column, var->name);    gtk_sheet_column_button_add_label (sheet, column, var->name);
79    
80    psppire_data_sheet_col_set_enable(sheet, column, column, TRUE);    psppire_data_sheet_col_set_enable(sheet, column, column, TRUE);
# Line 92  repopulate_columns(GtkSheet *sheet, PSPP Line 93  repopulate_columns(GtkSheet *sheet, PSPP
93    
94    for ( col = from ; col <= to ; ++col )    for ( col = from ; col <= to ; ++col )
95      {      {
96        struct variable *var = g_ptr_array_index(dict->array, col);              if ( col < pspp_dict_get_var_cnt(dict))
         
       if ( col < dict->array->len)  
97          {          {
98              struct variable *var = pspp_dict_get_var(dict, col);      
99          
100            gtk_sheet_column_button_add_label (sheet, col, var->name);            gtk_sheet_column_button_add_label (sheet, col, var->name);
101            psppire_data_sheet_col_set_enable(sheet, col, col, TRUE);            psppire_data_sheet_col_set_enable(sheet, col, col, TRUE);
102          }          }
103        else        else
104          {          {
105              GtkSheetRange this_column;
106              this_column.col0 = this_column.coli = col;
107              this_column.row0 = 0;
108              this_column.rowi = gtk_sheet_get_rows_count(sheet) - 1 ;
109    
110    
111            gtk_sheet_column_button_add_label (sheet, col, _("var"));            gtk_sheet_column_button_add_label (sheet, col, _("var"));
112    
113              /* Clear the columns variables no longer valid,
114                 and disable them
115               */
116              gtk_sheet_range_clear (sheet, &this_column);
117            psppire_data_sheet_col_set_enable(sheet, col, col, FALSE);            psppire_data_sheet_col_set_enable(sheet, col, col, FALSE);
118          }          }
119      }      }

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26