-2007-09-13 John Darrinton <john@darrington.wattle.id.au>
+2007-09-14 Ben Pfaff <blp@gnu.org>
+
+ * dictionary.c (dict_clone): Copy case indexes from cloned
+ dictionary. Fixes bug #21061. Reviewed by John Darrington.
+
+2007-09-13 John Darrington <john@darrington.wattle.id.au>
* value.c value.h (create_value): New function.
* casewriter-translator.c (struct casewriter_translator): Ditto.
(casewriter_create_translator): Ditto.
-2007-08-27 John Darrinton <john@darrington.wattle.id.au>
+2007-08-27 John Darrington <john@darrington.wattle.id.au>
* sys-file-reader.c (read_display_parameters): Force display width
to 8, if the sys file says 0 (like SPSS does).
}
/* Creates and returns a (deep) copy of an existing
- dictionary. */
+ dictionary.
+
+ The new dictionary's case indexes are copied from the old
+ dictionary. If the new dictionary won't be used to access
+ cases produced with the old dictionary, then the new
+ dictionary's case indexes should be compacted with
+ dict_compact_values to save space. */
struct dictionary *
dict_clone (const struct dictionary *s)
{
for (i = 0; i < var_get_short_name_cnt (sv); i++)
var_set_short_name (dv, i, var_get_short_name (sv, i));
+
+ var_set_vardict (dv, var_get_vardict (sv));
}
d->next_value_idx = s->next_value_idx;