Merge remote-tracking branch 'origin/master' into sheet
authorJohn Darrington <john@darrington.wattle.id.au>
Mon, 15 Aug 2016 12:16:26 +0000 (14:16 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Mon, 15 Aug 2016 12:16:26 +0000 (14:16 +0200)
NEWS
configure.ac
doc/variables.texi
src/language/dictionary/vector.c
src/ui/gui/pspp.appdata.xml
src/ui/gui/psppire-data-editor.c
src/ui/gui/psppire-dialog-action-comments.c
tests/language/dictionary/vector.at

diff --git a/NEWS b/NEWS
index 883590541ee61c5a4af4af84d6865a5b95053409..8959f7ec5d545561a426e1a7b33458bfca14bf30 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -6,9 +6,11 @@ Please send PSPP bug reports to bug-gnu-pspp@gnu.org.
 
 Changes from 0.10.2 to 0.10.4:
 
- *  Gtk+3.14.5 or later must now be used when building.
+ * Gtk+3.14.5 or later must now be used when building.
 
- *  The AUTORECODE command now accepts an optional / before INTO.
+ * The AUTORECODE command now accepts an optional / before INTO.
+
+ * The short form of the VECTOR command can now create string variables.
 
 Changes from 0.10.1 to 0.10.2:
 
index 401779f5da0f5e8c64e94b88f45642d9b71f136c..f921e6df0bb2792f14b7e16f301a5f12e3590f8a 100644 (file)
@@ -60,7 +60,7 @@ fi
 
 dnl Xmllint is used in the rules to build the documentation.  It is not actually necessary,
 dnl but is used for post-build consistency checks.  Thus, non-developers can live without it.
-dnl However for it to be usefull, it needs to be a certain version and have certain features.
+dnl However for it to be useful, it needs to be a certain version and have certain features.
 dnl The macros below check that it the xmllint available is up to scratch.  If it isn't
 dnl then a dummy /bin/echo is subsituted instead.
 
@@ -311,7 +311,7 @@ PSPP_READLINE
 dnl Checks for header files.
 AC_CHECK_HEADERS([sys/wait.h fpu_control.h ieeefp.h fenv.h pwd.h])
 
-dnl Some systems dont have SIGWINCH
+dnl Some systems don't have SIGWINCH
 AC_CHECK_DECLS([SIGWINCH], [], [],
           [#include <signal.h>
           /* NetBSD declares sys_siglist in unistd.h.  */
index 6a6a77b7febc94186b219b338eddbad7bebf48cc..cc13e784de2e9732d028b4fa03077e2f75096aad 100644 (file)
@@ -782,18 +782,20 @@ were consecutive members of an array with a vector(index) notation.
 
 To make a vector out of a set of existing variables, specify a name
 for the vector followed by an equals sign (@samp{=}) and the variables
-to put in the vector.  All the variables in the vector must be the same
-type.  String variables in a vector must all have the same width.
+to put in the vector.  The variables must be all numeric or all
+string, and string variables must have the same width.
 
 To make a vector and create variables at the same time, specify one or
-more vector names followed by a count in parentheses.  This will cause
-variables named @code{@var{vec}1} through @code{@var{vec}@var{count}}
-to be created as numeric variables.  By default, the new variables
-have print and write format F8.2, but an alternate format may be
-specified inside the parentheses before or after the count and
-separated from it by white space or a comma.  Variable names including
-numeric suffixes may not exceed 64 characters in length, and none of
-the variables may exist prior to @cmd{VECTOR}.
+more vector names followed by a count in parentheses.  This will
+create variables named @code{@var{vec}1} through
+@code{@var{vec}@var{count}}.  By default, the new variables are
+numeric with format F8.2, but an alternate format may be specified
+inside the parentheses before or after the count and separated from it
+by white space or a comma.  With a string format such as A8, the
+variables will be string variables; with a numeric format, they will
+be numeric.  Variable names including the suffixes may not exceed 64
+characters in length, and none of the variables may exist prior to
+@cmd{VECTOR}.
 
 Vectors created with @cmd{VECTOR} disappear after any procedure or
 procedure-like command is executed.  The variables contained in the
index 512ec3c2bfeaf99cde80aae28644b08f55225b1a..6560288c472e1232aed890d6d3e8dde7c4540998 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPP - a program for statistical analysis.
-   Copyright (C) 1997-9, 2000, 2010, 2011, 2012 Free Software Foundation, Inc.
+   Copyright (C) 1997-9, 2000, 2010, 2011, 2012, 2016 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -136,8 +136,7 @@ cmd_vector (struct lexer *lexer, struct dataset *ds)
                 {
                   seen_format = true;
                   if (!parse_format_specifier (lexer, &format)
-                      || !fmt_check_output (&format)
-                      || !fmt_check_type_compat (&format, VAL_NUMERIC))
+                      || !fmt_check_output (&format))
                     goto fail;
                 }
               else
@@ -184,7 +183,8 @@ cmd_vector (struct lexer *lexer, struct dataset *ds)
              for (j = 0; j < var_cnt; j++)
                {
                   char *name = xasprintf ("%s%d", vectors[i], j + 1);
-                 vars[j] = dict_create_var_assert (dict, name, 0);
+                 vars[j] = dict_create_var_assert (dict, name,
+                                                    fmt_var_width (&format));
                   var_set_both_formats (vars[j], &format);
                   free (name);
                }
index 1556b19ec9ef9c6287d041b17169e79fbd90ac0d..23b53e2c23a1b9e4ba840b5ace18fbd194806d58 100644 (file)
@@ -85,5 +85,6 @@
   </screenshot>
   </screenshots>
  <url type="homepage">http://www.gnu.org/software/pspp/</url>
+ <url type="translate">http://translationproject.org/domain/pspp.html</url>
  <updatecontact>pspp-dev@gnu.org</updatecontact>
 </component>
index f3a3059cb906835d69fe3d6d9d0af62f0c078b86..40a2c490b4460fcdb5a874dd28fb1d648ce3f55f 100644 (file)
@@ -542,6 +542,9 @@ psppire_data_editor_init (PsppireDataEditor *de)
   GtkWidget *hbox;
   gchar *fontname = NULL;
 
+  GtkStyleContext *context = gtk_widget_get_style_context (GTK_WIDGET (de));
+  gtk_style_context_add_class (context, "psppire-data-editor");
+  
   de->font = NULL;
   de->old_vbox_widget = NULL;
 
@@ -642,7 +645,28 @@ set_font_recursively (GtkWidget *w, gpointer data)
 {
   PangoFontDescription *font_desc = data;
 
-  gtk_widget_override_font (w, font_desc);
+  GtkStyleContext *style = gtk_widget_get_style_context (w);
+  GtkCssProvider *cssp = gtk_css_provider_new ();
+
+  gchar *str = pango_font_description_to_string (font_desc);
+  gchar *css =
+    g_strdup_printf ("* {font: %s}", str);
+  g_free (str);
+
+  GError *err = NULL;
+  gtk_css_provider_load_from_data (cssp, css, -1, &err);
+  if (err)
+    {
+      g_warning ("Failed to load font css \"%s\": %s", css, err->message);
+      g_error_free (err);
+    }
+  g_free (css);
+
+  gtk_style_context_add_provider (style,
+                                 GTK_STYLE_PROVIDER (cssp),
+                                 GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+  g_object_unref (cssp);
+
 
   if ( GTK_IS_CONTAINER (w))
     gtk_container_foreach (GTK_CONTAINER (w), set_font_recursively, font_desc);
@@ -663,7 +687,7 @@ psppire_data_editor_set_font (PsppireDataEditor *de, PangoFontDescription *font_
   psppire_conf_set_string (psppire_conf_new (),
                           "Data Editor", "font",
                           font_name);
-
+  g_free (font_name);
 }
 
 /* If SPLIT is TRUE, splits DE's data sheet into four panes.
index c500f1fad8bd660fb069936610c4ac57331ab7f1..bbb0a9dfda77e2a775793831b317b65cf884a5e4 100644 (file)
@@ -194,14 +194,36 @@ psppire_dialog_action_comments_activate (PsppireDialogAction *pda)
        PangoLayout *  layout ;
        PangoRectangle rect;
 
+       
        /* Since we're going to truncate lines to 80 chars,
           we need a monospaced font otherwise it'll look silly */
        PangoFontDescription *font_desc =
          pango_font_description_from_string ("monospace");
-
-       gtk_widget_override_font (act->textview, font_desc);
-
-       /* and let's just make sure that a complete line fits into the
+       {
+         GtkStyleContext *style = gtk_widget_get_style_context (GTK_WIDGET (act->textview));
+         GtkCssProvider *cssp = gtk_css_provider_new ();
+
+         gchar *str = pango_font_description_to_string (font_desc);
+         gchar *css =
+           g_strdup_printf ("* {font: %s}", str);
+         g_free (str);
+
+         GError *err = NULL;
+         gtk_css_provider_load_from_data (cssp, css, -1, &err);
+         if (err)
+           {
+             g_warning ("Failed to load font css \"%s\": %s", css, err->message);
+             g_error_free (err);
+           }
+         g_free (css);
+
+         gtk_style_context_add_provider (style,
+                                         GTK_STYLE_PROVIDER (cssp),
+                                         GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+         g_object_unref (cssp);
+       }
+       
+       /* And let's just make sure that a complete line fits into the
           widget's width */
        context = gtk_widget_create_pango_context (act->textview);
        layout = pango_layout_new (context);
@@ -233,9 +255,6 @@ psppire_dialog_action_comments_activate (PsppireDialogAction *pda)
   
   psppire_dialog_action_set_valid_predicate (pda, dialog_state_valid);
   psppire_dialog_action_set_refresh (pda, refresh);
-
-
-
 }
 
 static void
index e7a2cdd101c7ae7b861595b456235d01fca9c8cd..36aed7a6cba953786ab48ba6928d8e8726655f0e 100644 (file)
@@ -19,7 +19,8 @@ AT_CLEANUP
 AT_SETUP([VECTOR short form with format specification])
 AT_DATA([vector.sps], [dnl
 data list notable/x 1.
-vector #vec(4, comma10.2).
+vector #vec(4, comma10.2)
+      /#svec(3, a8).
 display vector.
 ])
 AT_CHECK([pspp -o pspp.csv vector.sps])
@@ -29,6 +30,9 @@ Vector,Position,Variable,Print Format
 ,2,#vec2,COMMA10.2
 ,3,#vec3,COMMA10.2
 ,4,#vec4,COMMA10.2
+#svec,1,#svec1,A8
+,2,#svec2,A8
+,3,#svec3,A8
 ])
 AT_CLEANUP