From 6aa33791a0c492d91e45e2597702d6953cd861e0 Mon Sep 17 00:00:00 2001 From: John Darrington Date: Mon, 5 Jun 2017 19:16:28 +0200 Subject: [PATCH] PsppireImportAssistant: Use a more reliable way of setting the number of cases. --- src/ui/gui/psppire-import-assistant.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ui/gui/psppire-import-assistant.c b/src/ui/gui/psppire-import-assistant.c index f4f41efa64..49e075a297 100644 --- a/src/ui/gui/psppire-import-assistant.c +++ b/src/ui/gui/psppire-import-assistant.c @@ -1452,9 +1452,12 @@ first_line_append_syntax (const PsppireImportAssistant *ia, struct string *s) static void intro_append_syntax (const PsppireImportAssistant *ia, struct string *s) { + gint first_line = 0; + g_object_get (ia->delimiters_model, "first-line", &first_line, NULL); + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (ia->n_cases_button))) - ds_put_format (s, "N OF CASES %d.\n", - gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (ia->n_cases_spin))); + ds_put_format (s, "SELECT IF ($CASENUM <= %d).\n", + gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (ia->n_cases_spin)) - first_line); else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (ia->percent_button))) ds_put_format (s, "SAMPLE %.4g.\n", gtk_spin_button_get_value (GTK_SPIN_BUTTON (ia->percent_spin)) / 100.0); -- 2.30.2