From: John Darrington Date: Tue, 4 Apr 2006 12:43:21 +0000 (+0000) Subject: Fixed a multitude of C89 compatibility warnings. X-Git-Tag: v0.6.0~1014 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=573068f2bdcd3f8796e9646668fed910a90f890b;p=pspp-builds.git Fixed a multitude of C89 compatibility warnings. --- diff --git a/lib/gtksheet/gsheet-column-iface.c b/lib/gtksheet/gsheet-column-iface.c index f1b91551..a4cc9f36 100644 --- a/lib/gtksheet/gsheet-column-iface.c +++ b/lib/gtksheet/gsheet-column-iface.c @@ -163,11 +163,11 @@ inline const GtkSheetButton * g_sheet_column_get_button(const GSheetColumn *column, gint col, const GtkSheet *sheet) { - g_return_val_if_fail (G_IS_SHEET_COLUMN (column), FALSE); - + static GtkSheetButton button ; GSheetColumnIface *iface = G_SHEET_COLUMN_GET_IFACE (column); - static GtkSheetButton button ; + g_return_val_if_fail (G_IS_SHEET_COLUMN (column), FALSE); + memcpy(&button, &default_button, sizeof (button)); if ( iface->get_button_label) @@ -251,13 +251,13 @@ g_sheet_column_get_column_count(const GSheetColumn *geo, const GtkSheet *sheet) inline gint g_sheet_column_start_pixel(const GSheetColumn *geo, gint col, const GtkSheet *sheet) { + gint i; + gint start_pixel = 0; + g_return_val_if_fail (G_IS_SHEET_COLUMN (geo), -1); g_return_val_if_fail (col < g_sheet_column_get_column_count(geo, sheet),-1); - gint i; - gint start_pixel = 0; - for ( i = 0 ; i < col ; ++i ) { if ( g_sheet_column_get_visibility(geo, i, sheet)) diff --git a/lib/gtksheet/gsheet-hetero-column.c b/lib/gtksheet/gsheet-hetero-column.c index a4781e9e..575fdc8a 100644 --- a/lib/gtksheet/gsheet-hetero-column.c +++ b/lib/gtksheet/gsheet-hetero-column.c @@ -84,6 +84,7 @@ static GtkSheetButton default_button; GObject * g_sheet_hetero_column_new (gint default_width, gint n_columns) { + gint i; GSheetHeteroColumn *hg; GObject *retval; @@ -94,7 +95,6 @@ g_sheet_hetero_column_new (gint default_width, gint n_columns) hg->default_width = default_width; hg->col = g_new0(struct GSheetHeteroColumnUnit, n_columns); - gint i; for (i = 0 ; i < hg->n_columns; ++i ) { hg->col[i].button = default_button; diff --git a/lib/gtksheet/gsheet-row-iface.c b/lib/gtksheet/gsheet-row-iface.c index 37d246b3..01a96afe 100644 --- a/lib/gtksheet/gsheet-row-iface.c +++ b/lib/gtksheet/gsheet-row-iface.c @@ -158,11 +158,12 @@ const GtkSheetButton * g_sheet_row_get_button(const GSheetRow *row_geo, gint row, const GtkSheet *sheet) { - g_return_val_if_fail (G_IS_SHEET_ROW (row_geo), FALSE); + static GtkSheetButton button ; GSheetRowIface *iface = G_SHEET_ROW_GET_IFACE (row_geo); - static GtkSheetButton button ; + g_return_val_if_fail (G_IS_SHEET_ROW (row_geo), FALSE); + memcpy(&button, &default_button, sizeof (button)); if ( iface->get_button_label) @@ -198,14 +199,14 @@ g_sheet_row_get_row_count(const GSheetRow *geo, const GtkSheet *sheet) gint g_sheet_row_start_pixel(const GSheetRow *geo, gint row, const GtkSheet *sheet) { + gint i; + gint start_pixel = 0; + g_return_val_if_fail (G_IS_SHEET_ROW (geo), -1); g_return_val_if_fail (row >= 0, -1); g_return_val_if_fail (row < g_sheet_row_get_row_count(geo, sheet),-1); - gint i; - gint start_pixel = 0; - if ( G_SHEET_ROW_GET_IFACE(geo)->top_ypixel) return (G_SHEET_ROW_GET_IFACE(geo)->top_ypixel)(geo, row, sheet); diff --git a/lib/gtksheet/gsheet-uniform-column.c b/lib/gtksheet/gsheet-uniform-column.c index be7a37f9..0c1573b5 100644 --- a/lib/gtksheet/gsheet-uniform-column.c +++ b/lib/gtksheet/gsheet-uniform-column.c @@ -124,8 +124,6 @@ g_sheet_uniform_column_get_visibility(const GSheetColumn *geom, gint u) static const gchar * g_sheet_uniform_column_get_button_label(const GSheetColumn *geom, gint u) { - GSheetUniformColumn *ug = G_SHEET_UNIFORM_COLUMN(geom); - static gchar *label; g_free(label); diff --git a/lib/gtksheet/gsheetmodel.c b/lib/gtksheet/gsheetmodel.c index 704b86e2..3f066578 100644 --- a/lib/gtksheet/gsheetmodel.c +++ b/lib/gtksheet/gsheetmodel.c @@ -122,7 +122,7 @@ g_sheet_model_base_init (gpointer g_class) * Retrieves the datum at location ROW, COLUMN in the form of a string. * Returns: The string representation of the datum, or NULL on error. **/ -inline const gchar *const +inline const gchar * g_sheet_model_get_string (const GSheetModel *sheet_model, gint row, gint column) { diff --git a/lib/gtksheet/gsheetmodel.h b/lib/gtksheet/gsheetmodel.h index 2865e783..50746462 100644 --- a/lib/gtksheet/gsheetmodel.h +++ b/lib/gtksheet/gsheetmodel.h @@ -84,7 +84,7 @@ struct _GSheetModelIface /* Virtual Table */ - const gchar *const (* get_string) (const GSheetModel *sheet_model, + const gchar * (* get_string) (const GSheetModel *sheet_model, gint row, gint column); gboolean (* set_string) (GSheetModel *sheet_model, @@ -118,7 +118,7 @@ struct _GSheetModelIface GType g_sheet_model_get_type (void) G_GNUC_CONST; -inline const gchar *const g_sheet_model_get_string (const GSheetModel *sheet_model, +inline const gchar * g_sheet_model_get_string (const GSheetModel *sheet_model, gint row, gint column); inline gboolean g_sheet_model_set_string (GSheetModel *sheet_model, diff --git a/lib/gtksheet/gtksheet.c b/lib/gtksheet/gtksheet.c index 7f5acedf..fbaa73c2 100644 --- a/lib/gtksheet/gtksheet.c +++ b/lib/gtksheet/gtksheet.c @@ -3498,52 +3498,58 @@ gtk_sheet_set_cell(GtkSheet *sheet, gint row, gint col, GtkJustification justification, const gchar *text) { - GtkSheetRange range; - gint text_width; - GtkSheetCellAttr attributes; + GSheetModel *model ; + gboolean changed ; + const gchar *old_text ; - g_return_if_fail (sheet != NULL); - g_return_if_fail (GTK_IS_SHEET (sheet)); - if (col >= xxx_column_count(sheet) || row >= yyy_row_count(sheet)) return; - if (col < 0 || row < 0) return; + GtkSheetRange range; + gint text_width; + GtkSheetCellAttr attributes; - gtk_sheet_get_attributes(sheet, row, col, &attributes); + g_return_if_fail (sheet != NULL); + g_return_if_fail (GTK_IS_SHEET (sheet)); + if (col >= xxx_column_count(sheet) || row >= yyy_row_count(sheet)) return; + if (col < 0 || row < 0) return; - attributes.justification = justification; + gtk_sheet_get_attributes(sheet, row, col, &attributes); - GSheetModel *model = gtk_sheet_get_model(sheet); + attributes.justification = justification; - const gchar *old_text = g_sheet_model_get_string(model, row, col); + model = gtk_sheet_get_model(sheet); - gboolean changed = FALSE; + old_text = g_sheet_model_get_string(model, row, col); - if (0 != safe_strcmp(old_text, text)) - changed = g_sheet_model_set_string(model, text, row, col); + changed = FALSE; - if(changed && attributes.is_visible){ - const gchar *s = gtk_sheet_cell_get_text(sheet, row, col); - text_width = 0; - if(s && strlen(s) > 0) { - text_width = STRING_WIDTH(GTK_WIDGET(sheet), attributes.font_desc, text); - } + if (0 != safe_strcmp(old_text, text)) + changed = g_sheet_model_set_string(model, text, row, col); - range.row0 = row; - range.rowi = row; - range.col0 = sheet->view.col0; - range.coli = sheet->view.coli; + if(changed && attributes.is_visible) + { + const gchar *s = gtk_sheet_cell_get_text(sheet, row, col); + text_width = 0; + if(s && strlen(s) > 0) { + text_width = STRING_WIDTH(GTK_WIDGET(sheet), + attributes.font_desc, text); + } + + range.row0 = row; + range.rowi = row; + range.col0 = sheet->view.col0; + range.coli = sheet->view.coli; - if(gtk_sheet_autoresize(sheet) && - text_width > xxx_column_width(sheet, col) - 2*CELLOFFSET-attributes.border.width){ + if(gtk_sheet_autoresize(sheet) && + text_width > xxx_column_width(sheet, col) - 2*CELLOFFSET-attributes.border.width){ gtk_sheet_set_column_width(sheet, col, text_width+2*CELLOFFSET+attributes.border.width); GTK_SHEET_SET_FLAGS(sheet, GTK_SHEET_REDRAW_PENDING); - } - else - if(!GTK_SHEET_IS_FROZEN(sheet)) - gtk_sheet_range_draw(sheet, &range); - } + } + else + if(!GTK_SHEET_IS_FROZEN(sheet)) + gtk_sheet_range_draw(sheet, &range); + } - if ( changed ) - gtk_signal_emit(GTK_OBJECT(sheet),sheet_signals[CHANGED], row, col); + if ( changed ) + gtk_signal_emit(GTK_OBJECT(sheet),sheet_signals[CHANGED], row, col); } @@ -3595,12 +3601,10 @@ gtk_sheet_cell_delete (GtkSheet *sheet, gint row, gint column) static void gtk_sheet_real_cell_clear (GtkSheet *sheet, gint row, gint column, gboolean delete) { - const gchar *old_text; - - old_text = gtk_sheet_cell_get_text(sheet, row, column); - GSheetModel *model = gtk_sheet_get_model(sheet); + const gchar *old_text = gtk_sheet_cell_get_text(sheet, row, column); + if (old_text && strlen(old_text) > 0 ) { g_sheet_model_datum_clear(model, row, column); @@ -6665,7 +6669,6 @@ vadjustment_value_changed (GtkAdjustment * adjustment, { GtkSheet *sheet; gint diff, value, old_value; - gint i; gint row, new_row; gint y=0; @@ -6689,7 +6692,7 @@ vadjustment_value_changed (GtkAdjustment * adjustment, y = g_sheet_row_start_pixel(sheet->row_geometry, new_row, sheet); if (adjustment->value > sheet->old_vadjustment && sheet->old_vadjustment > 0. && - yyy_row_height(sheet, i) > sheet->vadjustment->step_increment){ + yyy_row_height(sheet, row) > sheet->vadjustment->step_increment){ /* This avoids embarrassing twitching */ if(row == new_row && row != yyy_row_count(sheet) - 1 && adjustment->value - sheet->old_vadjustment >= @@ -7111,6 +7114,11 @@ gtk_sheet_set_row_height (GtkSheet * sheet, gboolean gtk_sheet_get_attributes(GtkSheet *sheet, gint row, gint col, GtkSheetCellAttr *attributes) { + const GdkColor *fg, *bg; + const GtkJustification *j ; + const PangoFontDescription *font_desc ; + const GtkSheetCellBorder *border ; + g_return_val_if_fail (sheet != NULL, FALSE); g_return_val_if_fail (GTK_IS_SHEET (sheet), FALSE); @@ -7124,26 +7132,23 @@ gtk_sheet_get_attributes(GtkSheet *sheet, gint row, gint col, GtkSheetCellAttr * attributes->is_editable = g_sheet_model_is_editable(sheet->model, row, col); attributes->is_visible = g_sheet_model_is_visible(sheet->model, row, col); - const GdkColor *fg = g_sheet_model_get_foreground(sheet->model, row, col); + fg = g_sheet_model_get_foreground(sheet->model, row, col); if ( fg ) attributes->foreground = *fg; - const GdkColor *bg = g_sheet_model_get_background(sheet->model, row, col); + bg = g_sheet_model_get_background(sheet->model, row, col); if ( bg ) attributes->background = *bg; - const GtkJustification *j = g_sheet_model_get_justification(sheet->model, - row, col); + j = g_sheet_model_get_justification(sheet->model, row, col); if (j) attributes->justification = *j; - const PangoFontDescription *font_desc = - g_sheet_model_get_font_desc(sheet->model, row, col); + font_desc = g_sheet_model_get_font_desc(sheet->model, row, col); if ( font_desc ) attributes->font_desc = font_desc; - const GtkSheetCellBorder *border = - g_sheet_model_get_cell_border(sheet->model, row, col); + border = g_sheet_model_get_cell_border(sheet->model, row, col); - if ( border ) attributes->border = *border; + if ( border ) attributes->border = *border; return TRUE; } @@ -7344,7 +7349,7 @@ gtk_sheet_button_attach (GtkSheet *sheet, GtkWidget *widget, gint row, gint col) { - GtkSheetButton *button; + GtkSheetButton *button = 0; GtkSheetChild *child; GtkRequisition button_requisition; diff --git a/po/en_GB.po b/po/en_GB.po index 21f88765..2828fe76 100644 --- a/po/en_GB.po +++ b/po/en_GB.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PSPP 0.3.1\n" "Report-Msgid-Bugs-To: pspp-dev@gnu.org\n" -"POT-Creation-Date: 2006-04-04 09:56+0800\n" +"POT-Creation-Date: 2006-04-04 20:32+0800\n" "PO-Revision-Date: 2004-01-23 13:04+0800\n" "Last-Translator: John Darrington \n" "Language-Team: John Darrington \n" @@ -311,21 +311,21 @@ msgstr "" msgid "Can't re-open %s as a %s for %s." msgstr "" -#: src/data/filename.c:249 +#: src/data/filename.c:253 #, c-format msgid "Searching for `%s'..." msgstr "" -#: src/data/filename.c:257 src/data/filename.c:289 +#: src/data/filename.c:261 src/data/filename.c:293 msgid "Search unsuccessful!" msgstr "" -#: src/data/filename.c:282 +#: src/data/filename.c:286 #, c-format msgid "Found `%s'." msgstr "" -#: src/data/filename.c:699 +#: src/data/filename.c:703 #, c-format msgid "Not opening pipe file `%s' because SAFER option set." msgstr "" @@ -388,13 +388,13 @@ msgstr "" #: src/data/format.c:197 src/data/por-file-reader.c:481 #: src/data/sys-file-reader.c:994 src/data/sys-file-reader.c:1003 -#: src/ui/gui/psppire-var-store.c:430 +#: src/ui/gui/psppire-var-store.c:435 msgid "String" msgstr "" #: src/data/format.c:197 src/data/por-file-reader.c:481 #: src/data/sys-file-reader.c:994 src/data/sys-file-reader.c:1003 -#: src/ui/gui/psppire-var-store.c:423 +#: src/ui/gui/psppire-var-store.c:428 msgid "Numeric" msgstr "" @@ -926,45 +926,45 @@ msgstr "" msgid "number" msgstr "" -#: src/data/variable.c:151 +#: src/data/variable.c:152 #, c-format msgid "" "Character `%c' (in %s), may not appear as the first character in a variable " "name." msgstr "" -#: src/data/variable.c:163 +#: src/data/variable.c:164 #, c-format msgid "Character `%c' (in %s) may not appear in a variable name." msgstr "" -#: src/data/variable.c:192 +#: src/data/variable.c:193 msgid "Variable name cannot be empty string." msgstr "" -#: src/data/variable.c:198 +#: src/data/variable.c:199 #, c-format msgid "Variable name %s exceeds %d-character limit." msgstr "" -#: src/data/variable.c:206 +#: src/data/variable.c:207 #, c-format msgid "`%s' may not be used as a variable name because it is a reserved word." msgstr "" -#: src/data/variable.c:301 +#: src/data/variable.c:302 msgid "Variable suffix too large." msgstr "" -#: src/data/variable.c:342 +#: src/data/variable.c:343 msgid "ordinary" msgstr "" -#: src/data/variable.c:344 +#: src/data/variable.c:345 msgid "system" msgstr "" -#: src/data/variable.c:346 +#: src/data/variable.c:347 msgid "scratch" msgstr "" @@ -1102,96 +1102,96 @@ msgid "" "commands." msgstr "" -#: src/language/data-io/data-list.c:143 +#: src/language/data-io/data-list.c:145 msgid "DATA LIST must use the same file as the enclosing FILE TYPE." msgstr "" -#: src/language/data-io/data-list.c:162 +#: src/language/data-io/data-list.c:164 msgid "The END subcommand may only be specified once." msgstr "" -#: src/language/data-io/data-list.c:197 +#: src/language/data-io/data-list.c:199 msgid "Only one of FIXED, FREE, or LIST may be specified." msgstr "" -#: src/language/data-io/data-list.c:347 src/language/data-io/print.c:297 +#: src/language/data-io/data-list.c:349 src/language/data-io/print.c:297 #, c-format msgid "" "The record number specified, %ld, is before the previous record, %d. Data " "fields must be listed in order of increasing record number." msgstr "" -#: src/language/data-io/data-list.c:376 src/language/data-io/data-list.c:1725 +#: src/language/data-io/data-list.c:378 src/language/data-io/data-list.c:1727 msgid "" "SPSS-like or FORTRAN-like format specification expected after variable names." msgstr "" -#: src/language/data-io/data-list.c:387 +#: src/language/data-io/data-list.c:389 msgid "At least one variable must be specified." msgstr "" -#: src/language/data-io/data-list.c:392 src/language/data-io/print.c:329 +#: src/language/data-io/data-list.c:394 src/language/data-io/print.c:329 msgid "" "Variables are specified on records that should not exist according to " "RECORDS subcommand." msgstr "" -#: src/language/data-io/data-list.c:425 src/language/data-io/data-list.c:439 +#: src/language/data-io/data-list.c:427 src/language/data-io/data-list.c:441 #: src/language/data-io/print.c:521 src/language/data-io/print.c:534 msgid "Column positions for fields must be positive." msgstr "" -#: src/language/data-io/data-list.c:444 +#: src/language/data-io/data-list.c:446 msgid "The ending column for a field must be greater than the starting column." msgstr "" -#: src/language/data-io/data-list.c:458 +#: src/language/data-io/data-list.c:460 #, c-format msgid "The %d columns %d-%d can't be evenly divided into %d fields." msgstr "" -#: src/language/data-io/data-list.c:478 src/language/data-io/print.c:562 +#: src/language/data-io/data-list.c:480 src/language/data-io/print.c:562 msgid "A format specifier on this line has extra characters on the end." msgstr "" -#: src/language/data-io/data-list.c:493 src/language/data-io/print.c:578 +#: src/language/data-io/data-list.c:495 src/language/data-io/print.c:578 msgid "The value for number of decimal places must be at least 1." msgstr "" -#: src/language/data-io/data-list.c:507 src/language/data-io/print.c:591 +#: src/language/data-io/data-list.c:509 src/language/data-io/print.c:591 #, c-format msgid "Input format %s doesn't accept decimal places." msgstr "" -#: src/language/data-io/data-list.c:554 src/language/data-io/data-list.c:650 -#: src/language/data-io/data-list.c:858 +#: src/language/data-io/data-list.c:556 src/language/data-io/data-list.c:652 +#: src/language/data-io/data-list.c:860 #, c-format msgid "%s is a duplicate variable name." msgstr "" -#: src/language/data-io/data-list.c:559 +#: src/language/data-io/data-list.c:561 #, c-format msgid "There is already a variable %s of a different type." msgstr "" -#: src/language/data-io/data-list.c:566 +#: src/language/data-io/data-list.c:568 #, c-format msgid "There is already a string variable %s of a different width." msgstr "" -#: src/language/data-io/data-list.c:641 +#: src/language/data-io/data-list.c:643 msgid "" "The number of format specifications exceeds the given number of variable " "names." msgstr "" -#: src/language/data-io/data-list.c:754 src/language/data-io/print.c:767 +#: src/language/data-io/data-list.c:756 src/language/data-io/print.c:767 msgid "" "There aren't enough format specifications to match the number of variable " "names given." msgstr "" -#: src/language/data-io/data-list.c:781 src/language/data-io/data-list.c:899 +#: src/language/data-io/data-list.c:783 src/language/data-io/data-list.c:901 #: src/language/data-io/print.c:798 #: src/language/dictionary/sys-file-info.c:139 #: src/language/dictionary/sys-file-info.c:373 @@ -1199,182 +1199,182 @@ msgstr "" msgid "Variable" msgstr "" -#: src/language/data-io/data-list.c:782 src/language/data-io/print.c:799 +#: src/language/data-io/data-list.c:784 src/language/data-io/print.c:799 msgid "Record" msgstr "" -#: src/language/data-io/data-list.c:783 src/language/data-io/print.c:800 +#: src/language/data-io/data-list.c:785 src/language/data-io/print.c:800 #: src/ui/gui/var-sheet.c:74 msgid "Columns" msgstr "" -#: src/language/data-io/data-list.c:784 src/language/data-io/data-list.c:900 +#: src/language/data-io/data-list.c:786 src/language/data-io/data-list.c:902 #: src/language/data-io/print.c:801 msgid "Format" msgstr "" -#: src/language/data-io/data-list.c:799 +#: src/language/data-io/data-list.c:801 #, c-format msgid "Reading %d record from %s." msgid_plural "Reading %d records from %s." msgstr[0] "" msgstr[1] "" -#: src/language/data-io/data-list.c:915 +#: src/language/data-io/data-list.c:917 #, c-format msgid "Reading free-form data from %s." msgstr "" -#: src/language/data-io/data-list.c:966 +#: src/language/data-io/data-list.c:968 #, c-format msgid "Quoted string missing terminating `%c'." msgstr "" -#: src/language/data-io/data-list.c:1081 +#: src/language/data-io/data-list.c:1083 #, c-format msgid "Partial case of %d of %d records discarded." msgstr "" -#: src/language/data-io/data-list.c:1134 +#: src/language/data-io/data-list.c:1136 #, c-format msgid "Partial case discarded. The first variable missing was %s." msgstr "" -#: src/language/data-io/data-list.c:1177 +#: src/language/data-io/data-list.c:1179 #, c-format msgid "" "Missing value(s) for all variables from %s onward. These will be filled " "with the system-missing value or blanks, as appropriate." msgstr "" -#: src/language/data-io/data-list.c:1388 +#: src/language/data-io/data-list.c:1390 msgid "" "REPEATING DATA must use the same file as its corresponding DATA LIST or FILE " "TYPE." msgstr "" -#: src/language/data-io/data-list.c:1398 src/language/data-io/data-list.c:1432 -#: src/language/data-io/data-list.c:1445 src/language/data-io/data-list.c:1458 -#: src/language/data-io/data-list.c:1492 +#: src/language/data-io/data-list.c:1400 src/language/data-io/data-list.c:1434 +#: src/language/data-io/data-list.c:1447 src/language/data-io/data-list.c:1460 +#: src/language/data-io/data-list.c:1494 #, c-format msgid "%s subcommand given multiple times." msgstr "" -#: src/language/data-io/data-list.c:1421 +#: src/language/data-io/data-list.c:1423 #, c-format msgid "STARTS beginning column (%d) exceeds STARTS ending column (%d)." msgstr "" -#: src/language/data-io/data-list.c:1478 +#: src/language/data-io/data-list.c:1480 #, c-format msgid "CONTINUED beginning column (%d) exceeds CONTINUED ending column (%d)." msgstr "" -#: src/language/data-io/data-list.c:1501 +#: src/language/data-io/data-list.c:1503 #, c-format msgid "ID beginning column (%ld) must be positive." msgstr "" -#: src/language/data-io/data-list.c:1516 +#: src/language/data-io/data-list.c:1518 #, c-format msgid "ID ending column (%ld) must be positive." msgstr "" -#: src/language/data-io/data-list.c:1522 +#: src/language/data-io/data-list.c:1524 #, c-format msgid "ID ending column (%ld) cannot be less than ID beginning column (%d)." msgstr "" -#: src/language/data-io/data-list.c:1562 +#: src/language/data-io/data-list.c:1564 msgid "Missing required specification STARTS." msgstr "" -#: src/language/data-io/data-list.c:1564 +#: src/language/data-io/data-list.c:1566 msgid "Missing required specification OCCURS." msgstr "" -#: src/language/data-io/data-list.c:1571 +#: src/language/data-io/data-list.c:1573 msgid "ID specified without CONTINUED." msgstr "" -#: src/language/data-io/data-list.c:1582 +#: src/language/data-io/data-list.c:1584 #, c-format msgid "" "STARTS beginning column (%d) exceeds default STARTS ending column taken from " "file's record width (%d)." msgstr "" -#: src/language/data-io/data-list.c:1595 +#: src/language/data-io/data-list.c:1597 #, c-format msgid "" "CONTINUED beginning column (%d) exceeds default CONTINUED ending column " "taken from file's record width (%d)." msgstr "" -#: src/language/data-io/data-list.c:1674 +#: src/language/data-io/data-list.c:1676 msgid "String variable not allowed here." msgstr "" -#: src/language/data-io/data-list.c:1684 +#: src/language/data-io/data-list.c:1686 #, c-format msgid "%s (%d) must be at least 1." msgstr "" -#: src/language/data-io/data-list.c:1690 +#: src/language/data-io/data-list.c:1692 #, c-format msgid "Variable or integer expected for %s." msgstr "" -#: src/language/data-io/data-list.c:1815 +#: src/language/data-io/data-list.c:1817 #, c-format msgid "Encountered mismatched record ID \"%s\" expecting \"%s\"." msgstr "" -#: src/language/data-io/data-list.c:1847 +#: src/language/data-io/data-list.c:1849 #, c-format msgid "" "Variable %s starting in column %d extends beyond physical record length of %" "d." msgstr "" -#: src/language/data-io/data-list.c:1914 +#: src/language/data-io/data-list.c:1916 #, c-format msgid "Invalid value %d for OCCURS." msgstr "" -#: src/language/data-io/data-list.c:1920 +#: src/language/data-io/data-list.c:1922 #, c-format msgid "Beginning column for STARTS (%d) must be at least 1." msgstr "" -#: src/language/data-io/data-list.c:1928 +#: src/language/data-io/data-list.c:1930 #, c-format msgid "Ending column for STARTS (%d) is less than beginning column (%d)." msgstr "" -#: src/language/data-io/data-list.c:1936 +#: src/language/data-io/data-list.c:1938 #, c-format msgid "Invalid value %d for LENGTH." msgstr "" -#: src/language/data-io/data-list.c:1943 +#: src/language/data-io/data-list.c:1945 #, c-format msgid "Beginning column for CONTINUED (%d) must be at least 1." msgstr "" -#: src/language/data-io/data-list.c:1951 +#: src/language/data-io/data-list.c:1953 #, c-format msgid "Ending column for CONTINUED (%d) is less than beginning column (%d)." msgstr "" -#: src/language/data-io/data-list.c:1983 +#: src/language/data-io/data-list.c:1985 #, c-format msgid "" "Number of repetitions specified on OCCURS (%d) exceed number of repetitions " "available in space on STARTS (%d), and CONTINUED not specified." msgstr "" -#: src/language/data-io/data-list.c:2001 +#: src/language/data-io/data-list.c:2003 #, c-format msgid "Unexpected end of file with %d repetitions remaining out of %d." msgstr "" @@ -2900,13 +2900,13 @@ msgstr "" #: src/language/stats/crosstabs.q:817 src/language/stats/crosstabs.q:1020 #: src/language/stats/crosstabs.q:1740 src/language/stats/examine.q:859 -#: src/language/stats/frequencies.q:1221 src/language/stats/oneway.q:312 -#: src/language/stats/oneway.q:475 src/language/stats/regression.q:294 +#: src/language/stats/frequencies.q:1221 src/language/stats/oneway.q:314 +#: src/language/stats/oneway.q:478 src/language/stats/regression.q:294 msgid "Total" msgstr "" #: src/language/stats/crosstabs.q:827 src/language/stats/examine.q:935 -#: src/language/stats/frequencies.q:1516 src/language/stats/oneway.q:398 +#: src/language/stats/frequencies.q:1516 src/language/stats/oneway.q:400 #: src/language/stats/t-test.q:682 src/language/stats/t-test.q:705 #: src/language/stats/t-test.q:830 src/language/stats/t-test.q:1365 msgid "N" @@ -2960,8 +2960,8 @@ msgstr "" msgid "Statistic" msgstr "" -#: src/language/stats/crosstabs.q:1112 src/language/stats/oneway.q:285 -#: src/language/stats/oneway.q:687 src/language/stats/regression.q:287 +#: src/language/stats/crosstabs.q:1112 src/language/stats/oneway.q:287 +#: src/language/stats/oneway.q:690 src/language/stats/regression.q:287 #: src/language/stats/t-test.q:980 src/language/stats/t-test.q:1172 #: src/language/stats/t-test.q:1264 msgid "df" @@ -3157,7 +3157,7 @@ msgid "%s Dependent" msgstr "" #: src/language/stats/descriptives.c:103 src/language/stats/examine.q:1474 -#: src/language/stats/frequencies.q:120 src/language/stats/oneway.q:399 +#: src/language/stats/frequencies.q:120 src/language/stats/oneway.q:401 #: src/language/stats/t-test.q:683 src/language/stats/t-test.q:706 #: src/language/stats/t-test.q:829 src/language/stats/t-test.q:1166 msgid "Mean" @@ -3200,12 +3200,12 @@ msgid "Range" msgstr "" #: src/language/stats/descriptives.c:112 src/language/stats/examine.q:1579 -#: src/language/stats/frequencies.q:131 src/language/stats/oneway.q:411 +#: src/language/stats/frequencies.q:131 src/language/stats/oneway.q:413 msgid "Minimum" msgstr "" #: src/language/stats/descriptives.c:113 src/language/stats/examine.q:1590 -#: src/language/stats/frequencies.q:132 src/language/stats/oneway.q:412 +#: src/language/stats/frequencies.q:132 src/language/stats/oneway.q:414 msgid "Maximum" msgstr "" @@ -3282,25 +3282,25 @@ msgstr "" msgid "Lowest" msgstr "" -#: src/language/stats/examine.q:1370 src/language/stats/oneway.q:401 -#: src/language/stats/oneway.q:685 src/language/stats/regression.q:191 +#: src/language/stats/examine.q:1370 src/language/stats/oneway.q:403 +#: src/language/stats/oneway.q:688 src/language/stats/regression.q:191 msgid "Std. Error" msgstr "" -#: src/language/stats/examine.q:1372 src/language/stats/oneway.q:415 +#: src/language/stats/examine.q:1372 src/language/stats/oneway.q:417 msgid "Descriptives" msgstr "" -#: src/language/stats/examine.q:1492 src/language/stats/oneway.q:406 +#: src/language/stats/examine.q:1492 src/language/stats/oneway.q:408 #, c-format msgid "%g%% Confidence Interval for Mean" msgstr "" -#: src/language/stats/examine.q:1498 src/language/stats/oneway.q:408 +#: src/language/stats/examine.q:1498 src/language/stats/oneway.q:410 msgid "Lower Bound" msgstr "" -#: src/language/stats/examine.q:1509 src/language/stats/oneway.q:409 +#: src/language/stats/examine.q:1509 src/language/stats/oneway.q:411 msgid "Upper Bound" msgstr "" @@ -3313,7 +3313,7 @@ msgstr "" msgid "Median" msgstr "" -#: src/language/stats/examine.q:1566 src/language/stats/oneway.q:400 +#: src/language/stats/examine.q:1566 src/language/stats/oneway.q:402 #: src/language/stats/t-test.q:684 src/language/stats/t-test.q:707 #: src/language/stats/t-test.q:831 src/language/stats/t-test.q:1167 msgid "Std. Deviation" @@ -3517,107 +3517,107 @@ msgstr "" msgid "TABLES subcommand may not appear more than once." msgstr "" -#: src/language/stats/oneway.q:175 +#: src/language/stats/oneway.q:177 msgid "Number of contrast coefficients must equal the number of groups" msgstr "" -#: src/language/stats/oneway.q:184 +#: src/language/stats/oneway.q:186 #, c-format msgid "Coefficients for contrast %d do not total zero" msgstr "" -#: src/language/stats/oneway.q:249 +#: src/language/stats/oneway.q:251 #, c-format msgid "`%s' is not a variable name" msgstr "" -#: src/language/stats/oneway.q:284 src/language/stats/regression.q:286 +#: src/language/stats/oneway.q:286 src/language/stats/regression.q:286 msgid "Sum of Squares" msgstr "" -#: src/language/stats/oneway.q:286 src/language/stats/regression.q:288 +#: src/language/stats/oneway.q:288 src/language/stats/regression.q:288 msgid "Mean Square" msgstr "" -#: src/language/stats/oneway.q:287 src/language/stats/regression.q:289 +#: src/language/stats/oneway.q:289 src/language/stats/regression.q:289 #: src/language/stats/t-test.q:977 msgid "F" msgstr "" -#: src/language/stats/oneway.q:288 src/language/stats/oneway.q:541 +#: src/language/stats/oneway.q:290 src/language/stats/oneway.q:544 #: src/language/stats/regression.q:194 src/language/stats/regression.q:290 msgid "Significance" msgstr "" -#: src/language/stats/oneway.q:310 +#: src/language/stats/oneway.q:312 msgid "Between Groups" msgstr "" -#: src/language/stats/oneway.q:311 +#: src/language/stats/oneway.q:313 msgid "Within Groups" msgstr "" -#: src/language/stats/oneway.q:358 src/language/stats/regression.q:316 +#: src/language/stats/oneway.q:360 src/language/stats/regression.q:316 msgid "ANOVA" msgstr "" -#: src/language/stats/oneway.q:538 +#: src/language/stats/oneway.q:541 msgid "Levene Statistic" msgstr "" -#: src/language/stats/oneway.q:539 +#: src/language/stats/oneway.q:542 msgid "df1" msgstr "" -#: src/language/stats/oneway.q:540 +#: src/language/stats/oneway.q:543 msgid "df2" msgstr "" -#: src/language/stats/oneway.q:544 +#: src/language/stats/oneway.q:547 msgid "Test of Homogeneity of Variances" msgstr "" -#: src/language/stats/oneway.q:614 +#: src/language/stats/oneway.q:617 msgid "Contrast Coefficients" msgstr "" -#: src/language/stats/oneway.q:616 src/language/stats/oneway.q:683 +#: src/language/stats/oneway.q:619 src/language/stats/oneway.q:686 msgid "Contrast" msgstr "" -#: src/language/stats/oneway.q:681 +#: src/language/stats/oneway.q:684 msgid "Contrast Tests" msgstr "" -#: src/language/stats/oneway.q:684 +#: src/language/stats/oneway.q:687 msgid "Value of Contrast" msgstr "" -#: src/language/stats/oneway.q:686 src/language/stats/regression.q:193 +#: src/language/stats/oneway.q:689 src/language/stats/regression.q:193 #: src/language/stats/t-test.q:979 src/language/stats/t-test.q:1171 #: src/language/stats/t-test.q:1263 msgid "t" msgstr "" -#: src/language/stats/oneway.q:688 src/language/stats/t-test.q:981 +#: src/language/stats/oneway.q:691 src/language/stats/t-test.q:981 #: src/language/stats/t-test.q:1173 src/language/stats/t-test.q:1265 msgid "Sig. (2-tailed)" msgstr "" -#: src/language/stats/oneway.q:732 +#: src/language/stats/oneway.q:735 msgid "Assume equal variances" msgstr "" -#: src/language/stats/oneway.q:736 +#: src/language/stats/oneway.q:739 msgid "Does not assume equal" msgstr "" -#: src/language/stats/rank.q:242 +#: src/language/stats/rank.q:244 #, c-format msgid "Variable %s already exists." msgstr "" -#: src/language/stats/rank.q:247 +#: src/language/stats/rank.q:249 msgid "Too many variables in INTO clause." msgstr "" @@ -3821,7 +3821,7 @@ msgstr "" msgid "%s & %s" msgstr "" -#: src/language/tests/moments-test.c:46 +#: src/language/tests/moments-test.c:49 msgid "expecting weight value" msgstr "" @@ -4525,87 +4525,87 @@ msgstr "" msgid "PSPP Data Editor" msgstr "" -#: src/ui/gui/menu-actions.c:105 +#: src/ui/gui/menu-actions.c:108 msgid "Open" msgstr "" -#: src/ui/gui/menu-actions.c:114 +#: src/ui/gui/menu-actions.c:116 msgid "System Files (*.sav)" msgstr "" -#: src/ui/gui/menu-actions.c:120 +#: src/ui/gui/menu-actions.c:122 msgid "Portable Files (*.por) " msgstr "" -#: src/ui/gui/menu-actions.c:126 +#: src/ui/gui/menu-actions.c:128 msgid "All Files" msgstr "" -#: src/ui/gui/menu-actions.c:223 +#: src/ui/gui/menu-actions.c:232 msgid "Save Data As" msgstr "" -#: src/ui/gui/menu-actions.c:459 +#: src/ui/gui/menu-actions.c:474 msgid "Font Selection" msgstr "" -#: src/ui/gui/message-dialog.c:75 +#: src/ui/gui/message-dialog.c:78 msgid "Script Error" msgstr "" -#: src/ui/gui/message-dialog.c:80 +#: src/ui/gui/message-dialog.c:83 msgid "Installation Error" msgstr "" -#: src/ui/gui/message-dialog.c:85 +#: src/ui/gui/message-dialog.c:88 msgid "Data File Error" msgstr "" -#: src/ui/gui/message-dialog.c:92 +#: src/ui/gui/message-dialog.c:95 msgid "PSPP Error" msgstr "" -#: src/ui/gui/message-dialog.c:153 +#: src/ui/gui/message-dialog.c:155 msgid "Terminating NOW due to fatal error" msgstr "" -#: src/ui/gui/missing-val-dialog.c:112 src/ui/gui/missing-val-dialog.c:157 +#: src/ui/gui/missing-val-dialog.c:113 src/ui/gui/missing-val-dialog.c:158 msgid "Incorrect value for variable type" msgstr "" -#: src/ui/gui/missing-val-dialog.c:132 src/ui/gui/missing-val-dialog.c:139 +#: src/ui/gui/missing-val-dialog.c:134 src/ui/gui/missing-val-dialog.c:141 msgid "Incorrect range specification" msgstr "" -#: src/ui/gui/psppire-data-store.c:638 +#: src/ui/gui/psppire-data-store.c:653 msgid "var" msgstr "" -#: src/ui/gui/psppire-var-store.c:419 +#: src/ui/gui/psppire-var-store.c:424 msgid "None" msgstr "" -#: src/ui/gui/psppire-var-store.c:424 +#: src/ui/gui/psppire-var-store.c:429 msgid "Comma" msgstr "" -#: src/ui/gui/psppire-var-store.c:425 +#: src/ui/gui/psppire-var-store.c:430 msgid "Dot" msgstr "" -#: src/ui/gui/psppire-var-store.c:426 +#: src/ui/gui/psppire-var-store.c:431 msgid "Scientific" msgstr "" -#: src/ui/gui/psppire-var-store.c:427 +#: src/ui/gui/psppire-var-store.c:432 msgid "Date" msgstr "" -#: src/ui/gui/psppire-var-store.c:428 +#: src/ui/gui/psppire-var-store.c:433 msgid "Dollar" msgstr "" -#: src/ui/gui/psppire-var-store.c:429 +#: src/ui/gui/psppire-var-store.c:434 msgid "Custom" msgstr "" diff --git a/po/pspp.pot b/po/pspp.pot index c5dbf2c9..ccd74ae1 100644 --- a/po/pspp.pot +++ b/po/pspp.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: pspp-dev@gnu.org\n" -"POT-Creation-Date: 2006-04-04 09:56+0800\n" +"POT-Creation-Date: 2006-04-04 20:32+0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -312,21 +312,21 @@ msgstr "" msgid "Can't re-open %s as a %s for %s." msgstr "" -#: src/data/filename.c:249 +#: src/data/filename.c:253 #, c-format msgid "Searching for `%s'..." msgstr "" -#: src/data/filename.c:257 src/data/filename.c:289 +#: src/data/filename.c:261 src/data/filename.c:293 msgid "Search unsuccessful!" msgstr "" -#: src/data/filename.c:282 +#: src/data/filename.c:286 #, c-format msgid "Found `%s'." msgstr "" -#: src/data/filename.c:699 +#: src/data/filename.c:703 #, c-format msgid "Not opening pipe file `%s' because SAFER option set." msgstr "" @@ -389,13 +389,13 @@ msgstr "" #: src/data/format.c:197 src/data/por-file-reader.c:481 #: src/data/sys-file-reader.c:994 src/data/sys-file-reader.c:1003 -#: src/ui/gui/psppire-var-store.c:430 +#: src/ui/gui/psppire-var-store.c:435 msgid "String" msgstr "" #: src/data/format.c:197 src/data/por-file-reader.c:481 #: src/data/sys-file-reader.c:994 src/data/sys-file-reader.c:1003 -#: src/ui/gui/psppire-var-store.c:423 +#: src/ui/gui/psppire-var-store.c:428 msgid "Numeric" msgstr "" @@ -927,45 +927,45 @@ msgstr "" msgid "number" msgstr "" -#: src/data/variable.c:151 +#: src/data/variable.c:152 #, c-format msgid "" "Character `%c' (in %s), may not appear as the first character in a variable " "name." msgstr "" -#: src/data/variable.c:163 +#: src/data/variable.c:164 #, c-format msgid "Character `%c' (in %s) may not appear in a variable name." msgstr "" -#: src/data/variable.c:192 +#: src/data/variable.c:193 msgid "Variable name cannot be empty string." msgstr "" -#: src/data/variable.c:198 +#: src/data/variable.c:199 #, c-format msgid "Variable name %s exceeds %d-character limit." msgstr "" -#: src/data/variable.c:206 +#: src/data/variable.c:207 #, c-format msgid "`%s' may not be used as a variable name because it is a reserved word." msgstr "" -#: src/data/variable.c:301 +#: src/data/variable.c:302 msgid "Variable suffix too large." msgstr "" -#: src/data/variable.c:342 +#: src/data/variable.c:343 msgid "ordinary" msgstr "" -#: src/data/variable.c:344 +#: src/data/variable.c:345 msgid "system" msgstr "" -#: src/data/variable.c:346 +#: src/data/variable.c:347 msgid "scratch" msgstr "" @@ -1103,96 +1103,96 @@ msgid "" "commands." msgstr "" -#: src/language/data-io/data-list.c:143 +#: src/language/data-io/data-list.c:145 msgid "DATA LIST must use the same file as the enclosing FILE TYPE." msgstr "" -#: src/language/data-io/data-list.c:162 +#: src/language/data-io/data-list.c:164 msgid "The END subcommand may only be specified once." msgstr "" -#: src/language/data-io/data-list.c:197 +#: src/language/data-io/data-list.c:199 msgid "Only one of FIXED, FREE, or LIST may be specified." msgstr "" -#: src/language/data-io/data-list.c:347 src/language/data-io/print.c:297 +#: src/language/data-io/data-list.c:349 src/language/data-io/print.c:297 #, c-format msgid "" "The record number specified, %ld, is before the previous record, %d. Data " "fields must be listed in order of increasing record number." msgstr "" -#: src/language/data-io/data-list.c:376 src/language/data-io/data-list.c:1725 +#: src/language/data-io/data-list.c:378 src/language/data-io/data-list.c:1727 msgid "" "SPSS-like or FORTRAN-like format specification expected after variable names." msgstr "" -#: src/language/data-io/data-list.c:387 +#: src/language/data-io/data-list.c:389 msgid "At least one variable must be specified." msgstr "" -#: src/language/data-io/data-list.c:392 src/language/data-io/print.c:329 +#: src/language/data-io/data-list.c:394 src/language/data-io/print.c:329 msgid "" "Variables are specified on records that should not exist according to " "RECORDS subcommand." msgstr "" -#: src/language/data-io/data-list.c:425 src/language/data-io/data-list.c:439 +#: src/language/data-io/data-list.c:427 src/language/data-io/data-list.c:441 #: src/language/data-io/print.c:521 src/language/data-io/print.c:534 msgid "Column positions for fields must be positive." msgstr "" -#: src/language/data-io/data-list.c:444 +#: src/language/data-io/data-list.c:446 msgid "The ending column for a field must be greater than the starting column." msgstr "" -#: src/language/data-io/data-list.c:458 +#: src/language/data-io/data-list.c:460 #, c-format msgid "The %d columns %d-%d can't be evenly divided into %d fields." msgstr "" -#: src/language/data-io/data-list.c:478 src/language/data-io/print.c:562 +#: src/language/data-io/data-list.c:480 src/language/data-io/print.c:562 msgid "A format specifier on this line has extra characters on the end." msgstr "" -#: src/language/data-io/data-list.c:493 src/language/data-io/print.c:578 +#: src/language/data-io/data-list.c:495 src/language/data-io/print.c:578 msgid "The value for number of decimal places must be at least 1." msgstr "" -#: src/language/data-io/data-list.c:507 src/language/data-io/print.c:591 +#: src/language/data-io/data-list.c:509 src/language/data-io/print.c:591 #, c-format msgid "Input format %s doesn't accept decimal places." msgstr "" -#: src/language/data-io/data-list.c:554 src/language/data-io/data-list.c:650 -#: src/language/data-io/data-list.c:858 +#: src/language/data-io/data-list.c:556 src/language/data-io/data-list.c:652 +#: src/language/data-io/data-list.c:860 #, c-format msgid "%s is a duplicate variable name." msgstr "" -#: src/language/data-io/data-list.c:559 +#: src/language/data-io/data-list.c:561 #, c-format msgid "There is already a variable %s of a different type." msgstr "" -#: src/language/data-io/data-list.c:566 +#: src/language/data-io/data-list.c:568 #, c-format msgid "There is already a string variable %s of a different width." msgstr "" -#: src/language/data-io/data-list.c:641 +#: src/language/data-io/data-list.c:643 msgid "" "The number of format specifications exceeds the given number of variable " "names." msgstr "" -#: src/language/data-io/data-list.c:754 src/language/data-io/print.c:767 +#: src/language/data-io/data-list.c:756 src/language/data-io/print.c:767 msgid "" "There aren't enough format specifications to match the number of variable " "names given." msgstr "" -#: src/language/data-io/data-list.c:781 src/language/data-io/data-list.c:899 +#: src/language/data-io/data-list.c:783 src/language/data-io/data-list.c:901 #: src/language/data-io/print.c:798 #: src/language/dictionary/sys-file-info.c:139 #: src/language/dictionary/sys-file-info.c:373 @@ -1200,182 +1200,182 @@ msgstr "" msgid "Variable" msgstr "" -#: src/language/data-io/data-list.c:782 src/language/data-io/print.c:799 +#: src/language/data-io/data-list.c:784 src/language/data-io/print.c:799 msgid "Record" msgstr "" -#: src/language/data-io/data-list.c:783 src/language/data-io/print.c:800 +#: src/language/data-io/data-list.c:785 src/language/data-io/print.c:800 #: src/ui/gui/var-sheet.c:74 msgid "Columns" msgstr "" -#: src/language/data-io/data-list.c:784 src/language/data-io/data-list.c:900 +#: src/language/data-io/data-list.c:786 src/language/data-io/data-list.c:902 #: src/language/data-io/print.c:801 msgid "Format" msgstr "" -#: src/language/data-io/data-list.c:799 +#: src/language/data-io/data-list.c:801 #, c-format msgid "Reading %d record from %s." msgid_plural "Reading %d records from %s." msgstr[0] "" msgstr[1] "" -#: src/language/data-io/data-list.c:915 +#: src/language/data-io/data-list.c:917 #, c-format msgid "Reading free-form data from %s." msgstr "" -#: src/language/data-io/data-list.c:966 +#: src/language/data-io/data-list.c:968 #, c-format msgid "Quoted string missing terminating `%c'." msgstr "" -#: src/language/data-io/data-list.c:1081 +#: src/language/data-io/data-list.c:1083 #, c-format msgid "Partial case of %d of %d records discarded." msgstr "" -#: src/language/data-io/data-list.c:1134 +#: src/language/data-io/data-list.c:1136 #, c-format msgid "Partial case discarded. The first variable missing was %s." msgstr "" -#: src/language/data-io/data-list.c:1177 +#: src/language/data-io/data-list.c:1179 #, c-format msgid "" "Missing value(s) for all variables from %s onward. These will be filled " "with the system-missing value or blanks, as appropriate." msgstr "" -#: src/language/data-io/data-list.c:1388 +#: src/language/data-io/data-list.c:1390 msgid "" "REPEATING DATA must use the same file as its corresponding DATA LIST or FILE " "TYPE." msgstr "" -#: src/language/data-io/data-list.c:1398 src/language/data-io/data-list.c:1432 -#: src/language/data-io/data-list.c:1445 src/language/data-io/data-list.c:1458 -#: src/language/data-io/data-list.c:1492 +#: src/language/data-io/data-list.c:1400 src/language/data-io/data-list.c:1434 +#: src/language/data-io/data-list.c:1447 src/language/data-io/data-list.c:1460 +#: src/language/data-io/data-list.c:1494 #, c-format msgid "%s subcommand given multiple times." msgstr "" -#: src/language/data-io/data-list.c:1421 +#: src/language/data-io/data-list.c:1423 #, c-format msgid "STARTS beginning column (%d) exceeds STARTS ending column (%d)." msgstr "" -#: src/language/data-io/data-list.c:1478 +#: src/language/data-io/data-list.c:1480 #, c-format msgid "CONTINUED beginning column (%d) exceeds CONTINUED ending column (%d)." msgstr "" -#: src/language/data-io/data-list.c:1501 +#: src/language/data-io/data-list.c:1503 #, c-format msgid "ID beginning column (%ld) must be positive." msgstr "" -#: src/language/data-io/data-list.c:1516 +#: src/language/data-io/data-list.c:1518 #, c-format msgid "ID ending column (%ld) must be positive." msgstr "" -#: src/language/data-io/data-list.c:1522 +#: src/language/data-io/data-list.c:1524 #, c-format msgid "ID ending column (%ld) cannot be less than ID beginning column (%d)." msgstr "" -#: src/language/data-io/data-list.c:1562 +#: src/language/data-io/data-list.c:1564 msgid "Missing required specification STARTS." msgstr "" -#: src/language/data-io/data-list.c:1564 +#: src/language/data-io/data-list.c:1566 msgid "Missing required specification OCCURS." msgstr "" -#: src/language/data-io/data-list.c:1571 +#: src/language/data-io/data-list.c:1573 msgid "ID specified without CONTINUED." msgstr "" -#: src/language/data-io/data-list.c:1582 +#: src/language/data-io/data-list.c:1584 #, c-format msgid "" "STARTS beginning column (%d) exceeds default STARTS ending column taken from " "file's record width (%d)." msgstr "" -#: src/language/data-io/data-list.c:1595 +#: src/language/data-io/data-list.c:1597 #, c-format msgid "" "CONTINUED beginning column (%d) exceeds default CONTINUED ending column " "taken from file's record width (%d)." msgstr "" -#: src/language/data-io/data-list.c:1674 +#: src/language/data-io/data-list.c:1676 msgid "String variable not allowed here." msgstr "" -#: src/language/data-io/data-list.c:1684 +#: src/language/data-io/data-list.c:1686 #, c-format msgid "%s (%d) must be at least 1." msgstr "" -#: src/language/data-io/data-list.c:1690 +#: src/language/data-io/data-list.c:1692 #, c-format msgid "Variable or integer expected for %s." msgstr "" -#: src/language/data-io/data-list.c:1815 +#: src/language/data-io/data-list.c:1817 #, c-format msgid "Encountered mismatched record ID \"%s\" expecting \"%s\"." msgstr "" -#: src/language/data-io/data-list.c:1847 +#: src/language/data-io/data-list.c:1849 #, c-format msgid "" "Variable %s starting in column %d extends beyond physical record length of %" "d." msgstr "" -#: src/language/data-io/data-list.c:1914 +#: src/language/data-io/data-list.c:1916 #, c-format msgid "Invalid value %d for OCCURS." msgstr "" -#: src/language/data-io/data-list.c:1920 +#: src/language/data-io/data-list.c:1922 #, c-format msgid "Beginning column for STARTS (%d) must be at least 1." msgstr "" -#: src/language/data-io/data-list.c:1928 +#: src/language/data-io/data-list.c:1930 #, c-format msgid "Ending column for STARTS (%d) is less than beginning column (%d)." msgstr "" -#: src/language/data-io/data-list.c:1936 +#: src/language/data-io/data-list.c:1938 #, c-format msgid "Invalid value %d for LENGTH." msgstr "" -#: src/language/data-io/data-list.c:1943 +#: src/language/data-io/data-list.c:1945 #, c-format msgid "Beginning column for CONTINUED (%d) must be at least 1." msgstr "" -#: src/language/data-io/data-list.c:1951 +#: src/language/data-io/data-list.c:1953 #, c-format msgid "Ending column for CONTINUED (%d) is less than beginning column (%d)." msgstr "" -#: src/language/data-io/data-list.c:1983 +#: src/language/data-io/data-list.c:1985 #, c-format msgid "" "Number of repetitions specified on OCCURS (%d) exceed number of repetitions " "available in space on STARTS (%d), and CONTINUED not specified." msgstr "" -#: src/language/data-io/data-list.c:2001 +#: src/language/data-io/data-list.c:2003 #, c-format msgid "Unexpected end of file with %d repetitions remaining out of %d." msgstr "" @@ -2901,13 +2901,13 @@ msgstr "" #: src/language/stats/crosstabs.q:817 src/language/stats/crosstabs.q:1020 #: src/language/stats/crosstabs.q:1740 src/language/stats/examine.q:859 -#: src/language/stats/frequencies.q:1221 src/language/stats/oneway.q:312 -#: src/language/stats/oneway.q:475 src/language/stats/regression.q:294 +#: src/language/stats/frequencies.q:1221 src/language/stats/oneway.q:314 +#: src/language/stats/oneway.q:478 src/language/stats/regression.q:294 msgid "Total" msgstr "" #: src/language/stats/crosstabs.q:827 src/language/stats/examine.q:935 -#: src/language/stats/frequencies.q:1516 src/language/stats/oneway.q:398 +#: src/language/stats/frequencies.q:1516 src/language/stats/oneway.q:400 #: src/language/stats/t-test.q:682 src/language/stats/t-test.q:705 #: src/language/stats/t-test.q:830 src/language/stats/t-test.q:1365 msgid "N" @@ -2961,8 +2961,8 @@ msgstr "" msgid "Statistic" msgstr "" -#: src/language/stats/crosstabs.q:1112 src/language/stats/oneway.q:285 -#: src/language/stats/oneway.q:687 src/language/stats/regression.q:287 +#: src/language/stats/crosstabs.q:1112 src/language/stats/oneway.q:287 +#: src/language/stats/oneway.q:690 src/language/stats/regression.q:287 #: src/language/stats/t-test.q:980 src/language/stats/t-test.q:1172 #: src/language/stats/t-test.q:1264 msgid "df" @@ -3158,7 +3158,7 @@ msgid "%s Dependent" msgstr "" #: src/language/stats/descriptives.c:103 src/language/stats/examine.q:1474 -#: src/language/stats/frequencies.q:120 src/language/stats/oneway.q:399 +#: src/language/stats/frequencies.q:120 src/language/stats/oneway.q:401 #: src/language/stats/t-test.q:683 src/language/stats/t-test.q:706 #: src/language/stats/t-test.q:829 src/language/stats/t-test.q:1166 msgid "Mean" @@ -3201,12 +3201,12 @@ msgid "Range" msgstr "" #: src/language/stats/descriptives.c:112 src/language/stats/examine.q:1579 -#: src/language/stats/frequencies.q:131 src/language/stats/oneway.q:411 +#: src/language/stats/frequencies.q:131 src/language/stats/oneway.q:413 msgid "Minimum" msgstr "" #: src/language/stats/descriptives.c:113 src/language/stats/examine.q:1590 -#: src/language/stats/frequencies.q:132 src/language/stats/oneway.q:412 +#: src/language/stats/frequencies.q:132 src/language/stats/oneway.q:414 msgid "Maximum" msgstr "" @@ -3283,25 +3283,25 @@ msgstr "" msgid "Lowest" msgstr "" -#: src/language/stats/examine.q:1370 src/language/stats/oneway.q:401 -#: src/language/stats/oneway.q:685 src/language/stats/regression.q:191 +#: src/language/stats/examine.q:1370 src/language/stats/oneway.q:403 +#: src/language/stats/oneway.q:688 src/language/stats/regression.q:191 msgid "Std. Error" msgstr "" -#: src/language/stats/examine.q:1372 src/language/stats/oneway.q:415 +#: src/language/stats/examine.q:1372 src/language/stats/oneway.q:417 msgid "Descriptives" msgstr "" -#: src/language/stats/examine.q:1492 src/language/stats/oneway.q:406 +#: src/language/stats/examine.q:1492 src/language/stats/oneway.q:408 #, c-format msgid "%g%% Confidence Interval for Mean" msgstr "" -#: src/language/stats/examine.q:1498 src/language/stats/oneway.q:408 +#: src/language/stats/examine.q:1498 src/language/stats/oneway.q:410 msgid "Lower Bound" msgstr "" -#: src/language/stats/examine.q:1509 src/language/stats/oneway.q:409 +#: src/language/stats/examine.q:1509 src/language/stats/oneway.q:411 msgid "Upper Bound" msgstr "" @@ -3314,7 +3314,7 @@ msgstr "" msgid "Median" msgstr "" -#: src/language/stats/examine.q:1566 src/language/stats/oneway.q:400 +#: src/language/stats/examine.q:1566 src/language/stats/oneway.q:402 #: src/language/stats/t-test.q:684 src/language/stats/t-test.q:707 #: src/language/stats/t-test.q:831 src/language/stats/t-test.q:1167 msgid "Std. Deviation" @@ -3518,107 +3518,107 @@ msgstr "" msgid "TABLES subcommand may not appear more than once." msgstr "" -#: src/language/stats/oneway.q:175 +#: src/language/stats/oneway.q:177 msgid "Number of contrast coefficients must equal the number of groups" msgstr "" -#: src/language/stats/oneway.q:184 +#: src/language/stats/oneway.q:186 #, c-format msgid "Coefficients for contrast %d do not total zero" msgstr "" -#: src/language/stats/oneway.q:249 +#: src/language/stats/oneway.q:251 #, c-format msgid "`%s' is not a variable name" msgstr "" -#: src/language/stats/oneway.q:284 src/language/stats/regression.q:286 +#: src/language/stats/oneway.q:286 src/language/stats/regression.q:286 msgid "Sum of Squares" msgstr "" -#: src/language/stats/oneway.q:286 src/language/stats/regression.q:288 +#: src/language/stats/oneway.q:288 src/language/stats/regression.q:288 msgid "Mean Square" msgstr "" -#: src/language/stats/oneway.q:287 src/language/stats/regression.q:289 +#: src/language/stats/oneway.q:289 src/language/stats/regression.q:289 #: src/language/stats/t-test.q:977 msgid "F" msgstr "" -#: src/language/stats/oneway.q:288 src/language/stats/oneway.q:541 +#: src/language/stats/oneway.q:290 src/language/stats/oneway.q:544 #: src/language/stats/regression.q:194 src/language/stats/regression.q:290 msgid "Significance" msgstr "" -#: src/language/stats/oneway.q:310 +#: src/language/stats/oneway.q:312 msgid "Between Groups" msgstr "" -#: src/language/stats/oneway.q:311 +#: src/language/stats/oneway.q:313 msgid "Within Groups" msgstr "" -#: src/language/stats/oneway.q:358 src/language/stats/regression.q:316 +#: src/language/stats/oneway.q:360 src/language/stats/regression.q:316 msgid "ANOVA" msgstr "" -#: src/language/stats/oneway.q:538 +#: src/language/stats/oneway.q:541 msgid "Levene Statistic" msgstr "" -#: src/language/stats/oneway.q:539 +#: src/language/stats/oneway.q:542 msgid "df1" msgstr "" -#: src/language/stats/oneway.q:540 +#: src/language/stats/oneway.q:543 msgid "df2" msgstr "" -#: src/language/stats/oneway.q:544 +#: src/language/stats/oneway.q:547 msgid "Test of Homogeneity of Variances" msgstr "" -#: src/language/stats/oneway.q:614 +#: src/language/stats/oneway.q:617 msgid "Contrast Coefficients" msgstr "" -#: src/language/stats/oneway.q:616 src/language/stats/oneway.q:683 +#: src/language/stats/oneway.q:619 src/language/stats/oneway.q:686 msgid "Contrast" msgstr "" -#: src/language/stats/oneway.q:681 +#: src/language/stats/oneway.q:684 msgid "Contrast Tests" msgstr "" -#: src/language/stats/oneway.q:684 +#: src/language/stats/oneway.q:687 msgid "Value of Contrast" msgstr "" -#: src/language/stats/oneway.q:686 src/language/stats/regression.q:193 +#: src/language/stats/oneway.q:689 src/language/stats/regression.q:193 #: src/language/stats/t-test.q:979 src/language/stats/t-test.q:1171 #: src/language/stats/t-test.q:1263 msgid "t" msgstr "" -#: src/language/stats/oneway.q:688 src/language/stats/t-test.q:981 +#: src/language/stats/oneway.q:691 src/language/stats/t-test.q:981 #: src/language/stats/t-test.q:1173 src/language/stats/t-test.q:1265 msgid "Sig. (2-tailed)" msgstr "" -#: src/language/stats/oneway.q:732 +#: src/language/stats/oneway.q:735 msgid "Assume equal variances" msgstr "" -#: src/language/stats/oneway.q:736 +#: src/language/stats/oneway.q:739 msgid "Does not assume equal" msgstr "" -#: src/language/stats/rank.q:242 +#: src/language/stats/rank.q:244 #, c-format msgid "Variable %s already exists." msgstr "" -#: src/language/stats/rank.q:247 +#: src/language/stats/rank.q:249 msgid "Too many variables in INTO clause." msgstr "" @@ -3822,7 +3822,7 @@ msgstr "" msgid "%s & %s" msgstr "" -#: src/language/tests/moments-test.c:46 +#: src/language/tests/moments-test.c:49 msgid "expecting weight value" msgstr "" @@ -4526,87 +4526,87 @@ msgstr "" msgid "PSPP Data Editor" msgstr "" -#: src/ui/gui/menu-actions.c:105 +#: src/ui/gui/menu-actions.c:108 msgid "Open" msgstr "" -#: src/ui/gui/menu-actions.c:114 +#: src/ui/gui/menu-actions.c:116 msgid "System Files (*.sav)" msgstr "" -#: src/ui/gui/menu-actions.c:120 +#: src/ui/gui/menu-actions.c:122 msgid "Portable Files (*.por) " msgstr "" -#: src/ui/gui/menu-actions.c:126 +#: src/ui/gui/menu-actions.c:128 msgid "All Files" msgstr "" -#: src/ui/gui/menu-actions.c:223 +#: src/ui/gui/menu-actions.c:232 msgid "Save Data As" msgstr "" -#: src/ui/gui/menu-actions.c:459 +#: src/ui/gui/menu-actions.c:474 msgid "Font Selection" msgstr "" -#: src/ui/gui/message-dialog.c:75 +#: src/ui/gui/message-dialog.c:78 msgid "Script Error" msgstr "" -#: src/ui/gui/message-dialog.c:80 +#: src/ui/gui/message-dialog.c:83 msgid "Installation Error" msgstr "" -#: src/ui/gui/message-dialog.c:85 +#: src/ui/gui/message-dialog.c:88 msgid "Data File Error" msgstr "" -#: src/ui/gui/message-dialog.c:92 +#: src/ui/gui/message-dialog.c:95 msgid "PSPP Error" msgstr "" -#: src/ui/gui/message-dialog.c:153 +#: src/ui/gui/message-dialog.c:155 msgid "Terminating NOW due to fatal error" msgstr "" -#: src/ui/gui/missing-val-dialog.c:112 src/ui/gui/missing-val-dialog.c:157 +#: src/ui/gui/missing-val-dialog.c:113 src/ui/gui/missing-val-dialog.c:158 msgid "Incorrect value for variable type" msgstr "" -#: src/ui/gui/missing-val-dialog.c:132 src/ui/gui/missing-val-dialog.c:139 +#: src/ui/gui/missing-val-dialog.c:134 src/ui/gui/missing-val-dialog.c:141 msgid "Incorrect range specification" msgstr "" -#: src/ui/gui/psppire-data-store.c:638 +#: src/ui/gui/psppire-data-store.c:653 msgid "var" msgstr "" -#: src/ui/gui/psppire-var-store.c:419 +#: src/ui/gui/psppire-var-store.c:424 msgid "None" msgstr "" -#: src/ui/gui/psppire-var-store.c:424 +#: src/ui/gui/psppire-var-store.c:429 msgid "Comma" msgstr "" -#: src/ui/gui/psppire-var-store.c:425 +#: src/ui/gui/psppire-var-store.c:430 msgid "Dot" msgstr "" -#: src/ui/gui/psppire-var-store.c:426 +#: src/ui/gui/psppire-var-store.c:431 msgid "Scientific" msgstr "" -#: src/ui/gui/psppire-var-store.c:427 +#: src/ui/gui/psppire-var-store.c:432 msgid "Date" msgstr "" -#: src/ui/gui/psppire-var-store.c:428 +#: src/ui/gui/psppire-var-store.c:433 msgid "Dollar" msgstr "" -#: src/ui/gui/psppire-var-store.c:429 +#: src/ui/gui/psppire-var-store.c:434 msgid "Custom" msgstr "" diff --git a/src/data/variable.c b/src/data/variable.c index 3c170c84..6c141483 100644 --- a/src/data/variable.c +++ b/src/data/variable.c @@ -131,6 +131,7 @@ hash_value(const union value *v, int width) bool var_is_valid_name (const char *name, bool issue_error) { + bool plausible; size_t length, i; assert (name != NULL); @@ -139,7 +140,7 @@ var_is_valid_name (const char *name, bool issue_error) CHARACTERS */ length = strlen (name); - bool plausible = var_is_plausible_name(name, issue_error); + plausible = var_is_plausible_name(name, issue_error); if ( ! plausible ) return false; diff --git a/src/language/data-io/data-list.c b/src/language/data-io/data-list.c index e3324cf2..db67a367 100644 --- a/src/language/data-io/data-list.c +++ b/src/language/data-io/data-list.c @@ -43,6 +43,8 @@ #include #include +#include "data-list.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/stats/oneway.q b/src/language/stats/oneway.q index 9837d4ce..2ef2d486 100644 --- a/src/language/stats/oneway.q +++ b/src/language/stats/oneway.q @@ -45,6 +45,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA #include #include +#include "sort-criteria.h" + #include "gettext.h" #define _(msgid) gettext (msgid) @@ -428,7 +430,8 @@ show_descriptives(void) const char *s = var_to_string(vars[v]); - struct group_statistics *const *gs_array = hsh_sort(gp->group_hash); + struct group_statistics *const *gs_array = + (struct group_statistics *const *) hsh_sort(gp->group_hash); int count = 0; tab_text (t, 0, row, TAB_LEFT | TAT_TITLE, s); diff --git a/src/language/stats/rank.q b/src/language/stats/rank.q index dc0b9ddd..92667f1c 100644 --- a/src/language/stats/rank.q +++ b/src/language/stats/rank.q @@ -25,6 +25,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA #include #include +#include "sort-criteria.h" + #include "gettext.h" #define _(msgid) gettext (msgid) diff --git a/src/language/tests/moments-test.c b/src/language/tests/moments-test.c index 4b685231..c3412e04 100644 --- a/src/language/tests/moments-test.c +++ b/src/language/tests/moments-test.c @@ -23,6 +23,9 @@ #include #include #include +#include "xalloc.h" +#include +#include #define _(msgid) gettext (msgid) diff --git a/src/math/linreg/linreg.c b/src/math/linreg/linreg.c index 08d620b8..e3d02345 100644 --- a/src/math/linreg/linreg.c +++ b/src/math/linreg/linreg.c @@ -305,6 +305,7 @@ pspp_linreg (const gsl_vector * Y, const gsl_matrix * X, } else { + gsl_multifit_linear_workspace *wk ; /* Use QR decomposition via GSL. */ @@ -321,8 +322,8 @@ pspp_linreg (const gsl_vector * Y, const gsl_matrix * X, gsl_matrix_set (design, j, i + 1, tmp); } } - gsl_multifit_linear_workspace *wk = - gsl_multifit_linear_alloc (design->size1, design->size2); + + wk = gsl_multifit_linear_alloc (design->size1, design->size2); rc = gsl_multifit_linear (design, Y, param_estimates, cache->cov, &(cache->sse), wk); for (i = 0; i < cache->n_coeffs; i++) diff --git a/src/output/charts/cartesian.c b/src/output/charts/cartesian.c index a8057ba4..e4f8e69b 100644 --- a/src/output/charts/cartesian.c +++ b/src/output/charts/cartesian.c @@ -45,93 +45,6 @@ static const struct dataset dataset[DATASETS] = }; - - -static void -write_legend(struct chart *chart, const char *heading, int n); - - - -/* Write the abscissa label */ -void -chart_write_xlabel(struct chart *ch, const char *label) -{ - if ( ! ch ) - return ; - - pl_savestate_r(ch->lp); - - pl_move_r(ch->lp,ch->data_left, ch->abscissa_top); - pl_alabel_r(ch->lp,0,'t',label); - - pl_restorestate_r(ch->lp); - -} - - - -/* Write the ordinate label */ -void -chart_write_ylabel(struct chart *ch, const char *label) -{ - if ( ! ch ) - return ; - - pl_savestate_r(ch->lp); - - pl_move_r(ch->lp, ch->data_bottom, ch->ordinate_right); - pl_textangle_r(ch->lp, 90); - pl_alabel_r(ch->lp, 0, 0, label); - - pl_restorestate_r(ch->lp); -} - - - -static void -write_legend(struct chart *chart, const char *heading, - int n) -{ - int ds; - - if ( ! chart ) - return ; - - - pl_savestate_r(chart->lp); - - pl_filltype_r(chart->lp,1); - - pl_move_r(chart->lp, chart->legend_left, - chart->data_bottom + chart->font_size * n * 1.5); - - pl_alabel_r(chart->lp,0,'b',heading); - - for (ds = 0 ; ds < n ; ++ds ) - { - pl_fmove_r(chart->lp, - chart->legend_left, - chart->data_bottom + chart->font_size * ds * 1.5); - - pl_savestate_r(chart->lp); - pl_fillcolorname_r(chart->lp,data_colour[ds]); - pl_fboxrel_r (chart->lp, - 0,0, - chart->font_size, chart->font_size); - pl_restorestate_r(chart->lp); - - pl_fmove_r(chart->lp, - chart->legend_left + chart->font_size * 1.5, - chart->data_bottom + chart->font_size * ds * 1.5); - - pl_alabel_r(chart->lp,'l','b',dataset[ds].label); - } - - - pl_restorestate_r(chart->lp); -} - - /* Plot a data point */ void chart_datum(struct chart *ch, int dataset UNUSED, double x, double y) diff --git a/src/output/charts/cartesian.h b/src/output/charts/cartesian.h index 9f68ba14..6a23390c 100644 --- a/src/output/charts/cartesian.h +++ b/src/output/charts/cartesian.h @@ -30,12 +30,6 @@ enum CHART_DIM }; -/* Write the abscissa label */ -void chart_write_xlabel(struct chart *ch, const char *label); - - -/* Write the ordinate label */ -void chart_write_ylabel(struct chart *ch, const char *label); /* Plot a data point */ void chart_datum(struct chart *ch, int dataset UNUSED, double x, double y); diff --git a/src/output/charts/plot-chart.c b/src/output/charts/plot-chart.c index 6b910452..497251f0 100644 --- a/src/output/charts/plot-chart.c +++ b/src/output/charts/plot-chart.c @@ -28,7 +28,6 @@ #include #include -#include #include #include @@ -177,3 +176,38 @@ chart_write_yscale(struct chart *ch, double smin, double smax, int ticks) (y - ch->y_min) * ch->ordinate_scale, "%g", y); } } + + +/* Write the abscissa label */ +void +chart_write_xlabel(struct chart *ch, const char *label) +{ + if ( ! ch ) + return ; + + pl_savestate_r(ch->lp); + + pl_move_r(ch->lp,ch->data_left, ch->abscissa_top); + pl_alabel_r(ch->lp,0,'t',label); + + pl_restorestate_r(ch->lp); + +} + + + +/* Write the ordinate label */ +void +chart_write_ylabel(struct chart *ch, const char *label) +{ + if ( ! ch ) + return ; + + pl_savestate_r(ch->lp); + + pl_move_r(ch->lp, ch->data_bottom, ch->ordinate_right); + pl_textangle_r(ch->lp, 90); + pl_alabel_r(ch->lp, 0, 0, label); + + pl_restorestate_r(ch->lp); +} diff --git a/src/output/charts/plot-chart.h b/src/output/charts/plot-chart.h index e8bb7d42..c7a1b2df 100644 --- a/src/output/charts/plot-chart.h +++ b/src/output/charts/plot-chart.h @@ -68,5 +68,9 @@ void chart_write_xscale(struct chart *ch, double min, double max, int ticks); /* Set the scale for the ordinate */ void chart_write_yscale(struct chart *ch, double smin, double smax, int ticks); +void chart_write_xlabel(struct chart *ch, const char *label) ; + +/* Write the ordinate label */ +void chart_write_ylabel(struct chart *ch, const char *label); #endif diff --git a/src/ui/gui/customentry.c b/src/ui/gui/customentry.c index 9afe978c..62829370 100644 --- a/src/ui/gui/customentry.c +++ b/src/ui/gui/customentry.c @@ -253,11 +253,11 @@ static gint psppire_custom_entry_expose (GtkWidget *widget, GdkEventExpose *event) { + PsppireCustomEntry *ce = PSPPIRE_CUSTOM_ENTRY(widget); + g_return_val_if_fail (PSPPIRE_IS_CUSTOM_ENTRY (widget), FALSE); g_return_val_if_fail (event != NULL, FALSE); - PsppireCustomEntry *ce = PSPPIRE_CUSTOM_ENTRY(widget); - if (GTK_WIDGET_DRAWABLE (widget)) { GtkShadowType shadow_type; diff --git a/src/ui/gui/data-sheet.c b/src/ui/gui/data-sheet.c index bff1af97..d32e6e37 100644 --- a/src/ui/gui/data-sheet.c +++ b/src/ui/gui/data-sheet.c @@ -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); @@ -86,26 +87,30 @@ click2column(GtkWidget *w, gint col, gpointer data) static gint update_data_ref_entry(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 ; - 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")); - gtk_entry_set_text(cell_ref_entry, text); + gtk_entry_set_text(cell_ref_entry, text); - g_free(text); + g_free(text); + } return FALSE; } @@ -119,7 +124,6 @@ psppire_data_sheet_create (gchar *widget_name, gchar *string1, gchar *string2, gint int1, gint int2) { GtkWidget *sheet; - gint i; const gint rows = 10046; diff --git a/src/ui/gui/helper.c b/src/ui/gui/helper.c index b3d83da2..549242e6 100644 --- a/src/ui/gui/helper.c +++ b/src/ui/gui/helper.c @@ -35,16 +35,18 @@ text_to_value(const gchar *text, union value *v, if ( format.type != FMT_A) { if ( ! text ) return FALSE; - - const gchar *s = text; - while(*s) - { - if ( !isspace(*s)) - break; - s++; - } + + { + const gchar *s = text; + while(*s) + { + if ( !isspace(*s)) + break; + s++; + } - if ( !*s) return FALSE; + if ( !*s) return FALSE; + } } di.s = text; @@ -62,9 +64,11 @@ text_to_value(const gchar *text, union value *v, GtkWidget * get_widget_assert(GladeXML *xml, const gchar *name) { + GtkWidget *w; g_assert(xml); g_assert(name); - GtkWidget * w = glade_xml_get_widget(xml, name); + + w = glade_xml_get_widget(xml, name); if ( !w ) g_warning("Widget \"%s\" could not be found\n",name); diff --git a/src/ui/gui/menu-actions.c b/src/ui/gui/menu-actions.c index d10cd515..02718370 100644 --- a/src/ui/gui/menu-actions.c +++ b/src/ui/gui/menu-actions.c @@ -99,8 +99,11 @@ void on_open1_activate (GtkMenuItem *menuitem, gpointer user_data) { + bool finished = FALSE; + GtkWidget *dialog; GtkWidget *data_editor = get_widget_assert(xml, "data_editor"); + GtkFileFilter *filter ; dialog = gtk_file_chooser_dialog_new (_("Open"), GTK_WINDOW(data_editor), @@ -108,7 +111,6 @@ on_open1_activate (GtkMenuItem *menuitem, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); - GtkFileFilter *filter ; filter = gtk_file_filter_new(); gtk_file_filter_set_name(filter, _("System Files (*.sav)")); @@ -128,18 +130,24 @@ on_open1_activate (GtkMenuItem *menuitem, gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), filter); - bool finished = FALSE; do { if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) { - GtkWidget *data_sheet = get_widget_assert(xml, "data_sheet"); - g_assert(data_sheet); + PsppireVarStore *var_store ; + PsppireDataStore *data_store ; + struct dictionary *new_dict; + struct sfm_read_info ri; + struct sfm_reader *reader ; + GtkWidget *data_sheet = get_widget_assert(xml, "data_sheet"); GtkWidget *var_sheet = get_widget_assert(xml, "variable_sheet"); + gchar *filename; + + g_assert(data_sheet); g_assert(var_sheet); - char *filename = gtk_file_chooser_get_filename + filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); if ( psppire_handle ) @@ -155,9 +163,6 @@ on_open1_activate (GtkMenuItem *menuitem, continue; } - struct dictionary *new_dict; - struct sfm_read_info ri; - struct sfm_reader *reader ; reader = sfm_open_reader (psppire_handle, &new_dict, &ri); @@ -166,13 +171,13 @@ on_open1_activate (GtkMenuItem *menuitem, the_dictionary = psppire_dict_new_from_dict(new_dict); - PsppireVarStore *var_store = + var_store = PSPPIRE_VAR_STORE(gtk_sheet_get_model(GTK_SHEET(var_sheet))); psppire_var_store_set_dictionary(var_store, the_dictionary); - PsppireDataStore *data_store = + data_store = PSPPIRE_DATA_STORE(gtk_sheet_get_model(GTK_SHEET(data_sheet))); @@ -186,17 +191,21 @@ on_open1_activate (GtkMenuItem *menuitem, g_free (filename); - const int ni = dict_get_next_value_idx(the_dictionary->dict); - if ( ni == 0 ) - goto done; + { + const int ni = dict_get_next_value_idx(the_dictionary->dict); + gint case_num; + if ( ni == 0 ) + goto done; - gint case_num; - for(case_num=0;;case_num++) - { - if (!psppire_case_array_add_case(the_cases, - populate_case_from_reader, reader)) - break; - } + + for(case_num=0;;case_num++) + { + if (!psppire_case_array_add_case(the_cases, + populate_case_from_reader, + reader)) + break; + } + } sfm_close_reader(reader); finished = TRUE; @@ -250,11 +259,14 @@ void on_save1_activate (GtkMenuItem *menuitem, gpointer user_data) { + GtkSheet *data_sheet ; + PsppireDataStore *data_store ; + if ( ! psppire_handle ) recreate_save_handle(&psppire_handle); - GtkSheet *data_sheet = GTK_SHEET(get_widget_assert(xml, "data_sheet")); - PsppireDataStore *data_store = PSPPIRE_DATA_STORE(gtk_sheet_get_model(data_sheet)); + data_sheet = GTK_SHEET(get_widget_assert(xml, "data_sheet")); + data_store = PSPPIRE_DATA_STORE(gtk_sheet_get_model(data_sheet)); if ( psppire_handle ) psppire_data_store_create_system_file(data_store, @@ -266,12 +278,15 @@ void on_save_as1_activate (GtkMenuItem *menuitem, gpointer user_data) { + GtkSheet *data_sheet ; + PsppireDataStore *data_store ; + recreate_save_handle(&psppire_handle); if ( ! psppire_handle ) return ; - GtkSheet *data_sheet = GTK_SHEET(get_widget_assert(xml, "data_sheet")); - PsppireDataStore *data_store = PSPPIRE_DATA_STORE(gtk_sheet_get_model(data_sheet)); + data_sheet = GTK_SHEET(get_widget_assert(xml, "data_sheet")); + data_store = PSPPIRE_DATA_STORE(gtk_sheet_get_model(data_sheet)); if ( psppire_handle ) psppire_data_store_create_system_file(data_store, diff --git a/src/ui/gui/message-dialog.c b/src/ui/gui/message-dialog.c index 6e93f7e6..c9ca4a1c 100644 --- a/src/ui/gui/message-dialog.c +++ b/src/ui/gui/message-dialog.c @@ -44,6 +44,9 @@ vmsg(int klass, const char *fmt, va_list args) gchar *msg = 0; gchar *text = g_strdup_vprintf (fmt, args); + GtkWindow *parent ; + GtkWidget *dialog ; + gint message_type; switch (klass) @@ -93,14 +96,13 @@ vmsg(int klass, const char *fmt, va_list args) break; }; - GtkWindow *parent = GTK_WINDOW(get_widget_assert(xml, "data_editor")); - - GtkWidget *dialog = gtk_message_dialog_new(parent, - GTK_DIALOG_MODAL, - message_type, - GTK_BUTTONS_CLOSE, - msg); + parent = GTK_WINDOW(get_widget_assert(xml, "data_editor")); + dialog = gtk_message_dialog_new(parent, + GTK_DIALOG_MODAL, + message_type, + GTK_BUTTONS_CLOSE, + msg); gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog), text); diff --git a/src/ui/gui/missing-val-dialog.c b/src/ui/gui/missing-val-dialog.c index ec136cd0..f81411eb 100644 --- a/src/ui/gui/missing-val-dialog.c +++ b/src/ui/gui/missing-val-dialog.c @@ -39,6 +39,7 @@ static void err_dialog(const gchar *msg, GtkWindow *window) { + GtkWidget *hbox ; GtkWidget *label = gtk_label_new (msg); GtkWidget *dialog = @@ -60,7 +61,7 @@ err_dialog(const gchar *msg, GtkWindow *window) G_CALLBACK (gtk_widget_destroy), dialog); - GtkWidget *hbox = gtk_hbox_new(FALSE, 10); + hbox = gtk_hbox_new(FALSE, 10); gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->vbox), hbox); @@ -117,6 +118,7 @@ missing_val_dialog_accept(GtkWidget *w, gpointer data) if (gtk_toggle_button_get_active(dialog->button_range)) { + gchar *discrete_text ; union value low_val ; union value high_val; @@ -141,10 +143,9 @@ missing_val_dialog_accept(GtkWidget *w, gpointer data) return; } - gchar *discrete_text = + discrete_text = g_strdup(gtk_entry_get_text(GTK_ENTRY(dialog->discrete))); - mv_set_type(&dialog->mvl, MV_NONE); mv_add_num_range(&dialog->mvl, low_val.f, high_val.f); @@ -254,13 +255,15 @@ missing_val_dialog_create(GladeXML *xml) void missing_val_dialog_show(struct missing_val_dialog *dialog) { + const struct fmt_spec *write_spec ; + gint i; g_return_if_fail(dialog); g_return_if_fail(dialog->pv); mv_copy (&dialog->mvl, psppire_variable_get_missing(dialog->pv)); - const struct fmt_spec *write_spec = psppire_variable_get_write_spec(dialog->pv); + write_spec = psppire_variable_get_write_spec(dialog->pv); /* Blank all entry boxes and make them insensitive */ gtk_entry_set_text(GTK_ENTRY(dialog->low), ""); @@ -318,10 +321,11 @@ missing_val_dialog_show(struct missing_val_dialog *dialog) { if ( i < n) { + gchar *text ; union value value; mv_peek_value(&dialog->mvl, &value, i); - gchar *text = value_to_text(value, *write_spec); + text = value_to_text(value, *write_spec); gtk_entry_set_text(GTK_ENTRY(dialog->mv[i]), text); g_free(text); } diff --git a/src/ui/gui/psppire-case-array.c b/src/ui/gui/psppire-case-array.c index e6ab7f7f..edff51fa 100644 --- a/src/ui/gui/psppire-case-array.c +++ b/src/ui/gui/psppire-case-array.c @@ -218,12 +218,13 @@ psppire_case_array_iterate_case(PsppireCaseArray *ca, void psppire_case_array_insert_case(PsppireCaseArray *ca, gint posn) { + gint i; + g_return_if_fail(posn >= 0); g_return_if_fail(posn <= ca->size); g_assert(ca->size + 1 <= ca->capacity); - gint i; for(i = ca->size; i > posn ; --i) case_move(&ca->cases[i], &ca->cases[i - 1]); @@ -237,11 +238,12 @@ psppire_case_array_insert_case(PsppireCaseArray *ca, gint posn) void psppire_case_array_delete_cases(PsppireCaseArray *ca, gint first, gint n_cases) { + gint i; + g_return_if_fail(n_cases > 0); g_return_if_fail(first >= 0); g_return_if_fail(first + n_cases < ca->size); - gint i; /* FIXME: Is this right ?? */ for ( i = first; i < first + n_cases ; ++i ) @@ -290,13 +292,17 @@ psppire_case_array_set_value(PsppireCaseArray *ca, gint c, gint idx, value_fill_func_t ff, gpointer data) { + struct ccase *cc ; + union value *val ; + gboolean changed ; + g_return_if_fail(c < ca->size); - struct ccase *cc = &ca->cases[c]; + cc = &ca->cases[c]; - union value *val = case_data_rw(cc, idx); + val = case_data_rw(cc, idx); - gboolean changed = ff(val, data); + changed = ff(val, data); case_unshare(cc); diff --git a/src/ui/gui/psppire-data-store.c b/src/ui/gui/psppire-data-store.c index 63e6f9c1..e8537bcc 100644 --- a/src/ui/gui/psppire-data-store.c +++ b/src/ui/gui/psppire-data-store.c @@ -169,9 +169,11 @@ gboolean always_true() static void delete_cases_callback(GtkWidget *w, gint first, gint n_cases, gpointer data) { + PsppireDataStore *store ; + g_return_if_fail (data); - PsppireDataStore *store = PSPPIRE_DATA_STORE(data); + store = PSPPIRE_DATA_STORE(data); g_assert(first >= 0); @@ -182,9 +184,10 @@ delete_cases_callback(GtkWidget *w, gint first, gint n_cases, gpointer data) static void insert_case_callback(GtkWidget *w, gint casenum, gpointer data) { + PsppireDataStore *store ; g_return_if_fail (data); - PsppireDataStore *store = PSPPIRE_DATA_STORE(data); + store = PSPPIRE_DATA_STORE(data); g_sheet_model_range_changed (G_SHEET_MODEL(store), casenum, -1, @@ -196,11 +199,11 @@ insert_case_callback(GtkWidget *w, gint casenum, gpointer data) static void changed_case_callback(GtkWidget *w, gint casenum, gpointer data) { + PsppireDataStore *store ; g_return_if_fail (data); - PsppireDataStore *store = PSPPIRE_DATA_STORE(data); + store = PSPPIRE_DATA_STORE(data); - g_sheet_model_range_changed (G_SHEET_MODEL(store), casenum, -1, casenum, -1); @@ -211,9 +214,11 @@ changed_case_callback(GtkWidget *w, gint casenum, gpointer data) static void delete_variables_callback(GtkWidget *w, gint var_num, gint n_vars, gpointer data) { + PsppireDataStore *store ; + g_return_if_fail (data); - PsppireDataStore *store = PSPPIRE_DATA_STORE(data); + store = PSPPIRE_DATA_STORE(data); g_sheet_column_columns_deleted(G_SHEET_COLUMN(store), var_num, n_vars); @@ -223,9 +228,11 @@ delete_variables_callback(GtkWidget *w, gint var_num, gint n_vars, gpointer data static void insert_variable_callback(GtkWidget *w, gint var_num, gpointer data) { + PsppireDataStore *store; + g_return_if_fail (data); - PsppireDataStore *store = PSPPIRE_DATA_STORE(data); + store = PSPPIRE_DATA_STORE(data); /* g_sheet_model_range_changed (G_SHEET_MODEL(store), @@ -322,6 +329,9 @@ psppire_data_store_finalize (GObject *object) static const gchar *const psppire_data_store_get_string(GSheetModel *model, gint row, gint column) { + const struct fmt_spec *fp ; + const struct PsppireVariable *pv ; + const union value *v ; static gchar s[255]; PsppireDataStore *store = PSPPIRE_DATA_STORE(model); @@ -334,14 +344,11 @@ psppire_data_store_get_string(GSheetModel *model, gint row, gint column) if ( row >= psppire_case_array_get_n_cases(store->cases)) return NULL; - const struct PsppireVariable *pv = psppire_dict_get_variable(store->dict, column); - + pv = psppire_dict_get_variable(store->dict, column); - const union value *v = - psppire_case_array_get_value(store->cases, row, + v = psppire_case_array_get_value(store->cases, row, psppire_variable_get_index(pv)); - if ( store->show_labels) { const struct val_labs * vl = psppire_variable_get_value_labels(pv); @@ -353,7 +360,7 @@ psppire_data_store_get_string(GSheetModel *model, gint row, gint column) } } - const struct fmt_spec *fp = psppire_variable_get_write_spec(pv); + fp = psppire_variable_get_write_spec(pv); if ( psppire_variable_get_type(pv) == NUMERIC ) { @@ -370,22 +377,24 @@ psppire_data_store_get_string(GSheetModel *model, gint row, gint column) s[len] = '\0'; } - static gchar buf[255]; - GError *err = NULL; - gchar *text = g_locale_to_utf8(s, fp->w, 0, 0, &err); - if ( !err ) - { - g_snprintf(buf, 255, text); - g_free(text); - } - else - { - g_warning("Cannot convert string \"%s\" to utf-8: %s\n", s, err->message); - g_error_free(err); - return NULL; - } + { + static gchar buf[255]; + GError *err = NULL; + gchar *text = g_locale_to_utf8(s, fp->w, 0, 0, &err); + if ( !err ) + { + g_snprintf(buf, 255, text); + g_free(text); + } + else + { + g_warning("Cannot convert string \"%s\" to utf-8: %s\n", s, err->message); + g_error_free(err); + return NULL; + } return buf ; + } } @@ -462,17 +471,19 @@ psppire_data_store_set_string(GSheetModel *model, psppire_data_store_clear_datum(model, r, c); } - const gint index = psppire_variable_get_index(pv); + { + const gint index = psppire_variable_get_index(pv); - struct data_in d_in; - d_in.s = text; - d_in.e = text + strlen(text); - d_in.v = 0; - d_in.f1 = d_in.f2 = 0; - d_in.format = * psppire_variable_get_write_spec(pv); - d_in.flags = 0; + struct data_in d_in; + d_in.s = text; + d_in.e = text + strlen(text); + d_in.v = 0; + d_in.f1 = d_in.f2 = 0; + d_in.format = * psppire_variable_get_write_spec(pv); + d_in.flags = 0; - psppire_case_array_set_value(store->cases, row, index, fillit, &d_in); + psppire_case_array_set_value(store->cases, row, index, fillit, &d_in); + } return TRUE; } @@ -521,15 +532,17 @@ void psppire_data_store_create_system_file(PsppireDataStore *store, struct file_handle *handle) { - g_assert(handle); - const struct sfm_write_options wo = { true, /* writeable */ false, /* dont compress */ 3 /* version */ }; - struct sfm_writer *writer = sfm_open_writer(handle, store->dict->dict, wo); + struct sfm_writer *writer ; + + g_assert(handle); + + writer = sfm_open_writer(handle, store->dict->dict, wo); if ( ! writer) return; @@ -557,13 +570,13 @@ static guint M_width(GtkSheet *sheet, gint row, gint col) { GtkSheetCellAttr attributes; - - gtk_sheet_get_attributes(sheet, row, col, &attributes); - PangoRectangle rect; /* FIXME: make this a member of the data store */ static PangoLayout *layout = 0; + + gtk_sheet_get_attributes(sheet, row, col, &attributes); + if (! layout ) layout = gtk_widget_create_pango_layout (GTK_WIDGET(sheet), "M"); @@ -592,13 +605,14 @@ columnWidthToPixels(GtkSheet *sheet, gint column, guint width) static gint geometry_get_width(const GSheetColumn *geom, gint unit, GtkSheet *sheet) { + const struct PsppireVariable *pv ; PsppireDataStore *ds = PSPPIRE_DATA_STORE(geom); if ( unit >= psppire_dict_get_var_cnt(ds->dict) ) return 75; /* FIXME: We can optimise this by caching the widths until they're resized */ - const struct PsppireVariable *pv = psppire_dict_get_variable(ds->dict, unit); + pv = psppire_dict_get_variable(ds->dict, unit); return columnWidthToPixels(sheet, unit, psppire_variable_get_columns(pv)); } @@ -622,12 +636,13 @@ static GtkJustification geometry_get_justification(const GSheetColumn *geom, gint unit) { PsppireDataStore *ds = PSPPIRE_DATA_STORE(geom); + const struct PsppireVariable *pv ; if ( unit >= psppire_dict_get_var_cnt(ds->dict) ) return GTK_JUSTIFY_LEFT; - const struct PsppireVariable *pv = psppire_dict_get_variable(ds->dict, unit); + pv = psppire_dict_get_variable(ds->dict, unit); /* Kludge: Happily GtkJustification is defined similarly to enum alignment from pspp/variable.h */ @@ -640,12 +655,13 @@ static const gchar null_var_name[]=_("var"); static const gchar * geometry_get_button_label(const GSheetColumn *geom, gint unit) { + struct PsppireVariable *pv ; PsppireDataStore *ds = PSPPIRE_DATA_STORE(geom); if ( unit >= psppire_dict_get_var_cnt(ds->dict) ) return null_var_name; - struct PsppireVariable *pv = psppire_dict_get_variable(ds->dict, unit); + pv = psppire_dict_get_variable(ds->dict, unit); return psppire_variable_get_name(pv); } diff --git a/src/ui/gui/psppire-dict.c b/src/ui/gui/psppire-dict.c index 357ec031..f9196504 100644 --- a/src/ui/gui/psppire-dict.c +++ b/src/ui/gui/psppire-dict.c @@ -228,6 +228,7 @@ auto_generate_var_name(PsppireDict *dict) void psppire_dict_insert_variable(PsppireDict *d, gint idx, const gchar *name) { + struct variable *var ; gint i; g_return_if_fail(d); g_return_if_fail(G_IS_PSPPIRE_DICT(d)); @@ -257,12 +258,10 @@ psppire_dict_insert_variable(PsppireDict *d, gint idx, const gchar *name) if ( ! name ) name = auto_generate_var_name(d); - struct variable *var = - dict_create_var(d->dict, name, 0); + var = dict_create_var(d->dict, name, 0); dict_reorder_var(d->dict, var, idx); - d->variables[idx] = g_malloc(sizeof (struct PsppireVariable)); d->variables[idx]->v = var; d->variables[idx]->dict = d; @@ -332,6 +331,7 @@ psppire_dict_set_name(PsppireDict* d, gint idx, const gchar *name) struct PsppireVariable * psppire_dict_get_variable(PsppireDict *d, gint idx) { + struct PsppireVariable *var ; g_return_val_if_fail(d, NULL); g_return_val_if_fail(d->dict, NULL); g_return_val_if_fail(d->variables, NULL); @@ -339,7 +339,7 @@ psppire_dict_get_variable(PsppireDict *d, gint idx) if (idx < 0 || idx >= psppire_dict_get_var_cnt(d)) return NULL; - struct PsppireVariable *var = d->variables[idx] ; + var = d->variables[idx] ; if (! var ) { @@ -394,19 +394,21 @@ psppire_dict_clear(PsppireDict *d) g_return_if_fail(d); g_return_if_fail(d->dict); - const gint n_vars = dict_get_var_cnt(d->dict); - gint i; + { + const gint n_vars = dict_get_var_cnt(d->dict); + gint i; - dict_clear(d->dict); + dict_clear(d->dict); - /* Invalidate the entire cache */ - for ( i = 0 ; i < d->cache_size ; ++i ) - { - g_free(d->variables[i]); - d->variables[i] = 0; - } + /* Invalidate the entire cache */ + for ( i = 0 ; i < d->cache_size ; ++i ) + { + g_free(d->variables[i]); + d->variables[i] = 0; + } - g_signal_emit(d, signal[VARIABLES_DELETED], 0, 0, n_vars ); + g_signal_emit(d, signal[VARIABLES_DELETED], 0, 0, n_vars ); + } } diff --git a/src/ui/gui/psppire-var-store.c b/src/ui/gui/psppire-var-store.c index b6966f6a..1aefb8f9 100644 --- a/src/ui/gui/psppire-var-store.c +++ b/src/ui/gui/psppire-var-store.c @@ -115,11 +115,10 @@ psppire_var_store_class_init (PsppireVarStoreClass *class) static void psppire_var_store_init (PsppireVarStore *var_store) { + GdkColormap *colormap = gdk_colormap_get_system(); g_assert(gdk_color_parse("gray", &var_store->disabled)); - GdkColormap *colormap = gdk_colormap_get_system(); - gdk_colormap_alloc_color (colormap, &var_store->disabled, FALSE, TRUE); var_store->dict = 0; @@ -128,6 +127,7 @@ psppire_var_store_init (PsppireVarStore *var_store) static gboolean psppire_var_store_item_editable(PsppireVarStore *var_store, gint row, gint column) { + const struct fmt_spec *write_spec ; struct PsppireVariable *pv = psppire_var_store_get_variable(var_store, row); @@ -137,7 +137,7 @@ psppire_var_store_item_editable(PsppireVarStore *var_store, gint row, gint colum if ( ALPHA == psppire_variable_get_type(pv) && column == COL_DECIMALS ) return FALSE; - const struct fmt_spec *write_spec = psppire_variable_get_write_spec(pv); + write_spec = psppire_variable_get_write_spec(pv); switch ( write_spec->type ) { @@ -298,6 +298,8 @@ psppire_var_store_finalize (GObject *object) static const gchar *const psppire_var_store_get_string(GSheetModel *model, gint row, gint column) { + const gchar *s ; + PsppireVarStore *store = PSPPIRE_VAR_STORE(model); struct PsppireVariable *pv; @@ -307,7 +309,7 @@ psppire_var_store_get_string(GSheetModel *model, gint row, gint column) pv = psppire_dict_get_variable (store->dict, row); - const gchar *s = text_for_column(pv, column); + s = text_for_column(pv, column); return s; } @@ -332,12 +334,14 @@ psppire_var_store_get_variable(PsppireVarStore *store, gint row) static gboolean psppire_var_store_clear(GSheetModel *model, gint row, gint col) { + struct PsppireVariable *pv ; + PsppireVarStore *var_store = PSPPIRE_VAR_STORE(model); if ( row >= psppire_dict_get_var_cnt(var_store->dict)) return FALSE; - struct PsppireVariable *pv = psppire_var_store_get_variable(var_store, row); + pv = psppire_var_store_get_variable(var_store, row); if ( !pv ) return FALSE; @@ -361,13 +365,14 @@ static gboolean psppire_var_store_set_string(GSheetModel *model, const gchar *text, gint row, gint col) { + struct PsppireVariable *pv ; + PsppireVarStore *var_store = PSPPIRE_VAR_STORE(model); if ( row >= psppire_dict_get_var_cnt(var_store->dict)) return FALSE; - struct PsppireVariable *pv = psppire_var_store_get_variable(var_store, row); - + pv = psppire_var_store_get_variable(var_store, row); if ( !pv ) return FALSE; @@ -583,11 +588,12 @@ text_for_column(const struct PsppireVariable *pv, gint c) g_assert(vl); - gchar *const vstr = value_to_text(vl->value, *write_spec); - - g_snprintf(buf, MAX_CELL_TEXT_LEN, "{%s,\"%s\"}_", vstr, vl->label); + { + gchar *const vstr = value_to_text(vl->value, *write_spec); - g_free(vstr); + g_snprintf(buf, MAX_CELL_TEXT_LEN, "{%s,\"%s\"}_", vstr, vl->label); + g_free(vstr); + } val_labs_done(&ip); diff --git a/src/ui/gui/psppire-variable.c b/src/ui/gui/psppire-variable.c index 7d23f48b..49dd84b6 100644 --- a/src/ui/gui/psppire-variable.c +++ b/src/ui/gui/psppire-variable.c @@ -87,11 +87,13 @@ psppire_variable_set_label(struct PsppireVariable *pv, const gchar *label) gboolean psppire_variable_set_decimals(struct PsppireVariable *pv, gint decimals) { + struct fmt_spec fmt; + g_return_val_if_fail(pv, FALSE); g_return_val_if_fail(pv->dict, FALSE); g_return_val_if_fail(pv->v, FALSE); - struct fmt_spec fmt = pv->v->write; + fmt = pv->v->write; fmt.d = decimals; @@ -103,11 +105,12 @@ psppire_variable_set_decimals(struct PsppireVariable *pv, gint decimals) gboolean psppire_variable_set_width(struct PsppireVariable *pv, gint width) { + struct fmt_spec fmt ; g_return_val_if_fail(pv, FALSE); g_return_val_if_fail(pv->dict, FALSE); g_return_val_if_fail(pv->v, FALSE); - struct fmt_spec fmt = pv->v->write; + fmt = pv->v->write; fmt.w = width; diff --git a/src/ui/gui/psppire.c b/src/ui/gui/psppire.c index d1878815..58264d99 100644 --- a/src/ui/gui/psppire.c +++ b/src/ui/gui/psppire.c @@ -56,6 +56,11 @@ static bool parse_command_line (int *argc, char ***argv); int main(int argc, char *argv[]) { + PsppireVarStore *var_store ; + GtkWidget *data_editor ; + GtkSheet *var_sheet ; + GtkSheet *data_sheet ; + if ( ! parse_command_line(&argc, &argv) ) return 0; @@ -66,7 +71,7 @@ main(int argc, char *argv[]) the_dictionary = psppire_dict_new(); /* Create the model for the var_sheet */ - PsppireVarStore *var_store = psppire_var_store_new(the_dictionary); + var_store = psppire_var_store_new(the_dictionary); /* Create the model for the data sheet */ the_cases = psppire_case_array_new(100, 20); @@ -78,15 +83,15 @@ main(int argc, char *argv[]) if ( !xml ) return 1; - GtkWidget *data_editor = get_widget_assert(xml, "data_editor"); + data_editor = get_widget_assert(xml, "data_editor"); gtk_window_set_icon_from_file(GTK_WINDOW(data_editor), PKGDATADIR "/psppicon.png",0); /* connect the signals in the interface */ glade_xml_signal_autoconnect(xml); - GtkSheet *var_sheet = GTK_SHEET(get_widget_assert(xml, "variable_sheet")); - GtkSheet *data_sheet = GTK_SHEET(get_widget_assert(xml, "data_sheet")); + var_sheet = GTK_SHEET(get_widget_assert(xml, "variable_sheet")); + data_sheet = GTK_SHEET(get_widget_assert(xml, "data_sheet")); gtk_sheet_set_model(var_sheet, G_SHEET_MODEL(var_store)); diff --git a/src/ui/gui/val-labs-dialog.c b/src/ui/gui/val-labs-dialog.c index 070a4f50..c8be70b9 100644 --- a/src/ui/gui/val-labs-dialog.c +++ b/src/ui/gui/val-labs-dialog.c @@ -34,11 +34,12 @@ static void on_label_entry_change(GtkEntry *entry, gpointer data) { + union value v; + const gchar *text ; struct val_labs_dialog *dialog = data; g_assert(dialog->labs); - union value v; - const gchar *text = gtk_entry_get_text(GTK_ENTRY(dialog->value_entry)); + text = gtk_entry_get_text(GTK_ENTRY(dialog->value_entry)); text_to_value(text, &v, *psppire_variable_get_write_spec(dialog->pv)); @@ -61,6 +62,8 @@ on_label_entry_change(GtkEntry *entry, gpointer data) static void select_treeview_from_value(GtkTreeView *treeview, union value *val) { + GtkTreePath *path ; + /* We do this with a linear search through the model --- hardly efficient, but the list is short ... */ @@ -73,11 +76,11 @@ select_treeview_from_value(GtkTreeView *treeview, union value *val) success; success = gtk_tree_model_iter_next(model, &iter)) { + union value v; GValue gvalue = {0}; gtk_tree_model_get_value(model, &iter, 1, &gvalue); - union value v; v.f = g_value_get_double(&gvalue); if ( 0 == memcmp(&v, val, sizeof (union value))) @@ -86,7 +89,7 @@ select_treeview_from_value(GtkTreeView *treeview, union value *val) } } - GtkTreePath *path = gtk_tree_model_get_path(model, &iter); + path = gtk_tree_model_get_path(model, &iter); if ( path ) { gtk_tree_view_set_cursor(treeview, path, 0, 0); @@ -101,6 +104,8 @@ select_treeview_from_value(GtkTreeView *treeview, union value *val) static void on_value_entry_change(GtkEntry *entry, gpointer data) { + char *s; + struct val_labs_dialog *dialog = data; const gchar *text = gtk_entry_get_text(GTK_ENTRY(dialog->value_entry)); @@ -116,7 +121,6 @@ on_value_entry_change(GtkEntry *entry, gpointer data) gtk_entry_set_text(GTK_ENTRY(dialog->label_entry),""); - char *s; if ( (s = val_labs_find (dialog->labs, v)) ) { gtk_entry_set_text(GTK_ENTRY(dialog->label_entry), s); @@ -302,6 +306,10 @@ on_select_row (GtkTreeView *treeview, struct val_labs_dialog * val_labs_dialog_create(GladeXML *xml) { + GtkTreeViewColumn *column; + + GtkCellRenderer *renderer ; + struct val_labs_dialog *dialog = g_malloc(sizeof(*dialog)); dialog->window = get_widget_assert(xml,"val_labs_dialog"); @@ -321,9 +329,7 @@ val_labs_dialog_create(GladeXML *xml) gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(dialog->treeview), FALSE); - GtkTreeViewColumn *column; - - GtkCellRenderer *renderer = gtk_cell_renderer_text_new(); + renderer = gtk_cell_renderer_text_new(); column = gtk_tree_view_column_new_with_attributes ("Title", renderer, diff --git a/src/ui/gui/var-sheet.c b/src/ui/gui/var-sheet.c index b38806bb..e04d4895 100644 --- a/src/ui/gui/var-sheet.c +++ b/src/ui/gui/var-sheet.c @@ -81,9 +81,9 @@ static gboolean click2row(GtkWidget *w, gint row, gpointer data) { gint current_row, current_column; + GtkWidget *data_sheet = get_widget_assert(xml, "data_sheet"); select_sheet(PAGE_DATA_SHEET); - GtkWidget *data_sheet = get_widget_assert(xml, "data_sheet"); gtk_sheet_get_active_cell(GTK_SHEET(data_sheet), ¤t_row, ¤t_column); @@ -112,13 +112,14 @@ const gchar *measures[]={ static GtkListStore * create_label_list(const gchar **labels) { + const gchar *s; gint i = 0; GtkTreeIter iter; GtkListStore *list_store; list_store = gtk_list_store_new (1, G_TYPE_STRING); - const gchar *s; + while ( (s = labels[i++])) { gtk_list_store_append (list_store, &iter); @@ -206,9 +207,13 @@ static gboolean var_sheet_cell_change_entry (GtkSheet * sheet, gint row, gint column, gpointer leaving) { + GtkSheetCellAttr attributes; + PsppireVarStore *var_store ; + struct PsppireVariable *pv ; + g_return_val_if_fail(sheet != NULL, FALSE); - PsppireVarStore *var_store = PSPPIRE_VAR_STORE(gtk_sheet_get_model(sheet)); + var_store = PSPPIRE_VAR_STORE(gtk_sheet_get_model(sheet)); if ( row >= psppire_var_store_get_var_cnt(var_store)) return TRUE; @@ -219,10 +224,10 @@ var_sheet_cell_change_entry (GtkSheet * sheet, gint row, gint column, return TRUE; } - GtkSheetCellAttr attributes; + gtk_sheet_get_attributes(sheet, row, column, &attributes); - struct PsppireVariable *pv = psppire_var_store_get_variable(var_store, row); + pv = psppire_var_store_get_variable(var_store, row); switch (column) { @@ -351,40 +356,43 @@ var_sheet_cell_change_entry (GtkSheet * sheet, gint row, gint column, if (!s) return FALSE; - const gint current_value = atoi(s); - - const struct fmt_spec *fmt = psppire_variable_get_write_spec(pv); - switch (column) - { - case COL_WIDTH: - r_min = fmt->d + 1; - r_max = (psppire_variable_get_type(pv) == ALPHA) ? 255 : 40; - break; - case COL_DECIMALS: - r_min = 0 ; - r_max = min(fmt->w - 1, 16); - break; - case COL_COLUMNS: - r_min = 1; - r_max = 255 ; /* Is this a sensible value ? */ - break; - default: - g_assert_not_reached(); - } - - GtkObject *adj = - gtk_adjustment_new(current_value, - r_min, r_max, - 1.0, 1.0, 1.0 /* steps */ - ); - - gtk_sheet_change_entry(sheet, GTK_TYPE_SPIN_BUTTON); - - GtkSpinButton *spinButton = - GTK_SPIN_BUTTON(gtk_sheet_get_entry(sheet)); - - gtk_spin_button_set_adjustment(spinButton, GTK_ADJUSTMENT(adj)); - gtk_spin_button_set_digits(spinButton, 0); + { + GtkSpinButton *spinButton ; + const gint current_value = atoi(s); + GtkObject *adj ; + + const struct fmt_spec *fmt = psppire_variable_get_write_spec(pv); + switch (column) + { + case COL_WIDTH: + r_min = fmt->d + 1; + r_max = (psppire_variable_get_type(pv) == ALPHA) ? 255 : 40; + break; + case COL_DECIMALS: + r_min = 0 ; + r_max = min(fmt->w - 1, 16); + break; + case COL_COLUMNS: + r_min = 1; + r_max = 255 ; /* Is this a sensible value ? */ + break; + default: + g_assert_not_reached(); + } + + adj = gtk_adjustment_new(current_value, + r_min, r_max, + 1.0, 1.0, 1.0 /* steps */ + ); + + gtk_sheet_change_entry(sheet, GTK_TYPE_SPIN_BUTTON); + + spinButton = + GTK_SPIN_BUTTON(gtk_sheet_get_entry(sheet)); + + gtk_spin_button_set_adjustment(spinButton, GTK_ADJUSTMENT(adj)); + gtk_spin_button_set_digits(spinButton, 0); + } } } break; diff --git a/src/ui/gui/var-type-dialog.c b/src/ui/gui/var-type-dialog.c index 3a6f67eb..12583f57 100644 --- a/src/ui/gui/var-type-dialog.c +++ b/src/ui/gui/var-type-dialog.c @@ -217,28 +217,31 @@ dollar_format_template(const struct fmt_spec *fmt) static gchar buf[LEN]; g_assert( fmt->type == FMT_DOLLAR); - gint int_part = fmt->w - fmt->d; - if ( fmt->d > 0 ) --int_part; - g_assert(int_part > 0); + { + gint c ; + gint int_part = fmt->w - fmt->d; + if ( fmt->d > 0 ) --int_part; + g_assert(int_part > 0); - g_strlcpy(buf, "$", LEN); + g_strlcpy(buf, "$", LEN); - gint c = int_part - 1; - while(c > 0) - { - g_strlcat(buf, "#", LEN); - if(--c % 4 == 0 && c > 0 ) + c = int_part - 1; + while(c > 0) { - g_strlcat(buf, ",", LEN); - --c; - } - } - if ( fmt->d > 0 ) - { - g_strlcat(buf, ".", LEN); - for ( c = 0 ; c < fmt->d ; ++c ) g_strlcat(buf, "#", LEN); - } + if(--c % 4 == 0 && c > 0 ) + { + g_strlcat(buf, ",", LEN); + --c; + } + } + if ( fmt->d > 0 ) + { + g_strlcat(buf, ".", LEN); + for ( c = 0 ; c < fmt->d ; ++c ) + g_strlcat(buf, "#", LEN); + } + } return buf; } @@ -255,9 +258,10 @@ add_to_group(GtkWidget *w, gpointer data) static void update_width_decimals(const struct var_type_dialog *dialog) { + gchar *text; g_assert(dialog); - gchar *text = g_strdup_printf("%d", dialog->fmt_l.w); + text = g_strdup_printf("%d", dialog->fmt_l.w); gtk_entry_set_text(GTK_ENTRY(dialog->entry_width), text); g_free(text); @@ -271,12 +275,14 @@ update_width_decimals(const struct var_type_dialog *dialog) static void preview_custom(GtkWidget *w, gpointer data) { + const gchar *text ; + struct var_type_dialog *dialog = data; if ( dialog->active_button != BUTTON_CUSTOM ) return; - const gchar *text = gtk_entry_get_text(GTK_ENTRY(dialog->entry_decimals)); + text = gtk_entry_get_text(GTK_ENTRY(dialog->entry_decimals)); dialog->fmt_l.d = atoi(text); text = gtk_entry_get_text(GTK_ENTRY(dialog->entry_width)); @@ -356,10 +362,10 @@ struct var_type_dialog * var_type_dialog_create(GladeXML *xml) { gint i; - g_assert(xml); - struct var_type_dialog *dialog = g_malloc(sizeof(struct var_type_dialog)); + g_assert(xml); + dialog->window = get_widget_assert(xml,"var_type_dialog"); gtk_window_set_transient_for(GTK_WINDOW(dialog->window), @@ -408,16 +414,24 @@ var_type_dialog_create(GladeXML *xml) dialog->ok = get_widget_assert(xml,"var_type_ok"); + { + GtkTreeIter iter; + GtkListStore *list_store ; + + GtkTreeViewColumn *column; + GtkCellRenderer *renderer ; + + static struct tgs tgs[num_BUTTONS]; /* The "middle_box" is a vbox with serveral children. However only one child is ever shown at a time. We need to make sure that they all have the same width, to avoid upleasant resizing effects */ GtkSizeGroup *sizeGroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); + gtk_container_foreach(GTK_CONTAINER(get_widget_assert(xml, "middle_box")), add_to_group, sizeGroup); - - static struct tgs tgs[num_BUTTONS]; + for (i = 0 ; i < num_BUTTONS; ++i ) { tgs[i].dialog = dialog; @@ -433,9 +447,7 @@ var_type_dialog_create(GladeXML *xml) dialog->date_format_treeview = GTK_TREE_VIEW(get_widget_assert(xml, "date_format_list_view")); - GtkTreeViewColumn *column; - - GtkCellRenderer *renderer = gtk_cell_renderer_text_new(); + renderer = gtk_cell_renderer_text_new(); column = gtk_tree_view_column_new_with_attributes ("Title", renderer, @@ -447,9 +459,7 @@ var_type_dialog_create(GladeXML *xml) column); - GtkTreeIter iter; - GtkListStore *list_store = gtk_list_store_new (2, G_TYPE_STRING, - G_TYPE_POINTER); + list_store = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_POINTER); for ( i = 0 ; i < sizeof(format_option) / sizeof(format_option[0]) ; ++i ) { @@ -567,6 +577,9 @@ var_type_dialog_create(GladeXML *xml) g_signal_connect(dialog->ok, "clicked", G_CALLBACK(on_var_type_ok_clicked), dialog); + + } + return dialog; } @@ -586,6 +599,8 @@ var_type_dialog_set_active_button(struct var_type_dialog *dialog, gint b) static void select_treeview_from_format(GtkTreeView *treeview, const struct fmt_spec *fmt) { + GtkTreePath *path ; + /* We do this with a linear search through the model --- hardly efficient, but the list is short ... */ @@ -598,11 +613,13 @@ select_treeview_from_format(GtkTreeView *treeview, const struct fmt_spec *fmt) success; success = gtk_tree_model_iter_next(model, &iter)) { + const struct fmt_spec *spec; + GValue value = {0}; gtk_tree_model_get_value(model, &iter, 1, &value); - const struct fmt_spec *spec = g_value_get_pointer(&value); + spec = g_value_get_pointer(&value); if ( 0 == memcmp(spec, fmt, sizeof (struct fmt_spec))) { @@ -610,7 +627,7 @@ select_treeview_from_format(GtkTreeView *treeview, const struct fmt_spec *fmt) } } - GtkTreePath *path = gtk_tree_model_get_path(model, &iter); + path = gtk_tree_model_get_path(model, &iter); if ( path ) { gtk_tree_view_set_cursor(treeview, path, 0, 0); @@ -627,7 +644,9 @@ static void select_treeview_from_format_type(GtkTreeView *treeview, const int fmt_type) { - /* + GtkTreePath *path ; + + /* We do this with a linear search through the model --- hardly efficient, but the list is short ... */ GtkTreeIter iter; @@ -639,17 +658,19 @@ select_treeview_from_format_type(GtkTreeView *treeview, success; success = gtk_tree_model_iter_next(model, &iter)) { + int spec ; + GValue value = {0}; gtk_tree_model_get_value(model, &iter, 1, &value); - const int spec = * ((int *) g_value_get_pointer(&value)); + spec = * ((int *) g_value_get_pointer(&value)); if ( spec == fmt_type) break; } - GtkTreePath *path = gtk_tree_model_get_path(model, &iter); + path = gtk_tree_model_get_path(model, &iter); if ( path ) { gtk_tree_view_set_cursor(treeview, path, 0, 0); @@ -664,14 +685,15 @@ select_treeview_from_format_type(GtkTreeView *treeview, static void var_type_dialog_set_state(struct var_type_dialog *dialog) { + const struct fmt_spec *write_spec ; + GString *str = g_string_new(""); + g_assert(dialog); g_assert(dialog->pv); /* Populate width and decimals */ - const struct fmt_spec *write_spec = psppire_variable_get_write_spec(dialog->pv); + write_spec = psppire_variable_get_write_spec(dialog->pv); - GString *str = g_string_new(""); - g_string_printf(str, "%d", write_spec->d); gtk_entry_set_text(GTK_ENTRY(dialog->entry_decimals), @@ -781,57 +803,59 @@ on_var_type_ok_clicked(GtkWidget *w, gpointer data) g_assert(dialog); g_assert(dialog->pv); - gint width = atoi(gtk_entry_get_text - (GTK_ENTRY(dialog->entry_width))); + { + gint width = atoi(gtk_entry_get_text + (GTK_ENTRY(dialog->entry_width))); - gint decimals = atoi(gtk_entry_get_text - (GTK_ENTRY(dialog->entry_decimals))); + gint decimals = atoi(gtk_entry_get_text + (GTK_ENTRY(dialog->entry_decimals))); - gint new_type = NUMERIC; - gint new_width = 0; - bool result = false; - struct fmt_spec spec; - switch (dialog->active_button) - { - case BUTTON_STRING: - new_type = ALPHA; - new_width = width; - result = make_output_format_try(&spec, FMT_A, width, 0); - break; - case BUTTON_NUMERIC: - result = make_output_format_try(&spec, FMT_F, width, decimals); - break; - case BUTTON_COMMA: - result = make_output_format_try(&spec, FMT_COMMA, width, decimals); - break; - case BUTTON_DOT: - result = make_output_format_try(&spec, FMT_DOT, width, decimals); - break; - case BUTTON_SCIENTIFIC: - result = make_output_format_try(&spec, FMT_E, width, decimals); - break; - case BUTTON_DATE: - case BUTTON_CUSTOM: - g_assert(check_output_specifier(&dialog->fmt_l, TRUE)); - result = memcpy(&spec, &dialog->fmt_l, sizeof(struct fmt_spec)); - break; - case BUTTON_DOLLAR: - result = make_output_format_try(&spec, FMT_DOLLAR, width, decimals); - break; - default: - g_print("Unknown variable type: %d\n", dialog->active_button) ; - result = false; - break; - } + gint new_type = NUMERIC; + gint new_width = 0; + bool result = false; + struct fmt_spec spec; + switch (dialog->active_button) + { + case BUTTON_STRING: + new_type = ALPHA; + new_width = width; + result = make_output_format_try(&spec, FMT_A, width, 0); + break; + case BUTTON_NUMERIC: + result = make_output_format_try(&spec, FMT_F, width, decimals); + break; + case BUTTON_COMMA: + result = make_output_format_try(&spec, FMT_COMMA, width, decimals); + break; + case BUTTON_DOT: + result = make_output_format_try(&spec, FMT_DOT, width, decimals); + break; + case BUTTON_SCIENTIFIC: + result = make_output_format_try(&spec, FMT_E, width, decimals); + break; + case BUTTON_DATE: + case BUTTON_CUSTOM: + g_assert(check_output_specifier(&dialog->fmt_l, TRUE)); + result = memcpy(&spec, &dialog->fmt_l, sizeof(struct fmt_spec)); + break; + case BUTTON_DOLLAR: + result = make_output_format_try(&spec, FMT_DOLLAR, width, decimals); + break; + default: + g_print("Unknown variable type: %d\n", dialog->active_button) ; + result = false; + break; + } - if ( result == true ) - { - psppire_variable_set_type(dialog->pv, new_type); - psppire_variable_set_width(dialog->pv, new_width); - psppire_variable_set_write_spec(dialog->pv, spec); - psppire_variable_set_print_spec(dialog->pv, spec); - } + if ( result == true ) + { + psppire_variable_set_type(dialog->pv, new_type); + psppire_variable_set_width(dialog->pv, new_width); + psppire_variable_set_write_spec(dialog->pv, spec); + psppire_variable_set_print_spec(dialog->pv, spec); + } + } gtk_widget_hide(dialog->window); return FALSE;