Merge remote-tracking branch 'origin/master' into sheet
authorJohn Darrington <john@darrington.wattle.id.au>
Fri, 12 Aug 2016 04:43:40 +0000 (06:43 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Fri, 12 Aug 2016 04:43:40 +0000 (06:43 +0200)
src/language/lexer/variable-parser.c
src/output/cairo.c
src/ui/gui/help-menu.c
src/ui/gui/psppire-import-assistant.c
src/ui/gui/psppire-window.c

index a45d384293ba9b6251433a60abd4d89480dbc9fa..390b98dae36860019f90638f02c45bbfb9e443d2 100644 (file)
@@ -201,9 +201,9 @@ add_variable (struct variable ***v, size_t *nv, size_t *mv,
                "All variables in this variable list must have the "
                "same width.  %s will be omitted from the list."),
          var_get_name ((*v)[0]), add_name, add_name);
-  else if ((pv_opts & PV_NO_DUPLICATE) && included[idx])
+  else if ((pv_opts & PV_NO_DUPLICATE) && included && included[idx])
     msg (SE, _("Variable %s appears twice in variable list."), add_name);
-  else if ((pv_opts & PV_DUPLICATE) || !included[idx])
+  else if ((pv_opts & PV_DUPLICATE) || !included || !included[idx])
     {
       if (*nv >= *mv)
         {
index 1a8c78c69fe0d0062dcb379aa0f4d758c2ebb48c..c7188af0b60a1ab24cc15f30296ee8916d442495 100644 (file)
@@ -1078,7 +1078,8 @@ xr_layout_cell_text (struct xr_driver *xr,
             {
               if (brk && clip[H][0] != clip[H][1])
                 best = bottom;
-              *brk = bottom;
+              if (brk)
+                *brk = bottom;
             }
           else
             break;
index aeef8c10c44ba2deb1d4762177fc3b56d964211e..b5b38757c355ef5a6791b83605ce71b662d14dcf 100644 (file)
@@ -148,7 +148,7 @@ online_help (const char *page)
     {
       gchar **tokens = NULL;
       const int maxtokens = 5;
-      int idx = 0;
+      int idx ;
       argv[1] = g_strdup_printf ("file://%s#%s",
                                  relocate (DOCDIR "/pspp.xml"), page);
       /* The page will be translated to the htmlfilename
@@ -157,7 +157,8 @@ online_help (const char *page)
          QUICK-CLUSTER          QUICK-CLUSTER.html
          which is valid for the multiple page html doc*/
       tokens = g_strsplit (page, "#", maxtokens);
-      for(;tokens[idx] && idx < maxtokens;idx++);
+      for (idx = 0; idx < maxtokens && tokens[idx]; idx++)
+       ;
       htmlfilename = g_strdup_printf ("%s.html", tokens[idx-1]);
       g_strfreev (tokens);
     }
index 89d1cf8e6decbcb5829e5d75c7df22889db0dc32..9374f7f68e15fbb2ecc4d4c94e30ab3deddeeb26 100644 (file)
@@ -1740,18 +1740,24 @@ make_data_column (PsppireImportAssistant *ia, GtkWidget *tree_view,
 {
   struct variable *var = NULL;
   struct column *column = NULL;
-  size_t char_cnt;
+  size_t char_cnt = 0;
   gint content_width, header_width;
   PsppSheetViewColumn *tree_column;
-  char *name;
+  char *name = NULL;
 
   if (input)
-    column = &ia->columns[dict_idx];
+    {
+      column = &ia->columns[dict_idx];
+      name = escape_underscores (column->name);
+      char_cnt = column->width; 
+    }
   else
-    var = dict_get_var (ia->dict, dict_idx);
+    {
+      var = dict_get_var (ia->dict, dict_idx);
+      name = escape_underscores (var_get_name (var));
+      char_cnt = var_get_print_format (var)->w;
+    }
 
-  name = escape_underscores (input ? column->name : var_get_name (var));
-  char_cnt = input ? column->width : var_get_print_format (var)->w;
   content_width = get_monospace_width (tree_view, ia->fixed_renderer,
                                        char_cnt);
   header_width = get_string_width (tree_view, ia->prop_renderer,
index f3c360b35e06d192e93ae1f92379824a9b223cf9..c268256bb003ea1c43c460d087b4454c11486c41 100644 (file)
@@ -196,7 +196,6 @@ psppire_window_set_property (GObject         *object,
                           : NULL);
       psppire_window_name_changed (window);
       break;
-      break;
     case PROP_ID:
       g_free (window->id);
       window->id = g_value_dup_string (value);