- /* Whether to apply the value labels. */
- int apply = 1;
-
- if (t->width < s->width)
- {
- struct val_labs_iterator *i;
- struct val_lab *lab;
-
- for (lab = val_labs_first (s->val_labs, &i); lab != NULL;
- lab = val_labs_next (s->val_labs, &i))
- {
- int j;
-
- /* We will apply the value labels only if all
- the truncated characters are blanks. */
- for (j = t->width; j < s->width; j++)
- if (lab->value.s[j] != ' ')
- {
- val_labs_done (&i);
- apply = 0;
- break;
- }
- }
- }
- else
- {
- /* Fortunately, we follow the convention that all value
- label values are right-padded with spaces, so it is
- unnecessary to bother padding values here. */
- }
-
- if (apply)
- {
- val_labs_destroy (t->val_labs);
- t->val_labs = s->val_labs;
- val_labs_set_width (t->val_labs, t->width);
- s->val_labs = val_labs_create (s->width);
- }
+ var_set_print_format (t, var_get_print_format (s));
+ var_set_write_format (t, var_get_write_format (s));