pspp-sheet-view: Make Shift+Tab select only one cell when switching rows.
[pspp] / src / data / dictionary.c
index b64d84a2ca58622eb06c99ede072579b71d476ed..5731d78695148ad14e199d51ea0431109769f65e 100644 (file)
@@ -194,10 +194,6 @@ dict_clone (const struct dictionary *s)
 
   d = dict_create (s->encoding);
 
-  /* Set the new dictionary's encoding early so that string length limitations
-     are interpreted correctly. */
-  d->encoding = xstrdup (s->encoding);
-
   for (i = 0; i < s->var_cnt; i++)
     {
       struct variable *sv = s->var[i].var;
@@ -305,6 +301,7 @@ dict_destroy (struct dictionary *d)
       d->callbacks  = NULL ;
 
       dict_clear (d);
+      string_array_destroy (&d->documents);
       hmap_destroy (&d->name_map);
       attrset_destroy (&d->attributes);
       dict_clear_mrsets (d);
@@ -600,7 +597,6 @@ dict_delete_var (struct dictionary *d, struct variable *v)
 {
   int dict_index = var_get_dict_index (v);
   const int case_index = var_get_case_index (v);
-  const int width = var_get_width (v);
 
   assert (dict_contains_var (d, v));
 
@@ -628,13 +624,14 @@ dict_delete_var (struct dictionary *d, struct variable *v)
 
   /* Free memory. */
   var_clear_vardict (v);
-  var_destroy (v);
 
   if ( d->changed ) d->changed (d, d->changed_data);
 
   invalidate_proto (d);
   if (d->callbacks &&  d->callbacks->var_deleted )
-    d->callbacks->var_deleted (d, dict_index, case_index, width, d->cb_data);
+    d->callbacks->var_deleted (d, v, dict_index, case_index, d->cb_data);
+
+  var_destroy (v);
 }
 
 /* Deletes the COUNT variables listed in VARS from D.  This is