X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fdictionary%2Fapply-dictionary.c;h=e3a77e5d4ab3fcb9bfaccfd13f6a9361bacd7569;hb=860ca55c65448584c436692380c4fa655d2c3ba1;hp=0cf66e2d09452c38bb20bfb940bccbb62971b143;hpb=dcf9b154cbcaa35c3d8459a201b77eec8bcb30bd;p=pspp-builds.git diff --git a/src/language/dictionary/apply-dictionary.c b/src/language/dictionary/apply-dictionary.c index 0cf66e2d..e3a77e5d 100644 --- a/src/language/dictionary/apply-dictionary.c +++ b/src/language/dictionary/apply-dictionary.c @@ -18,23 +18,25 @@ 02110-1301, USA. */ #include + #include -#include "any-reader.h" -#include "command.h" -#include "dictionary.h" -#include "message.h" -#include "file-handle-def.h" -#include "hash.h" -#include "lexer.h" -#include "str.h" -#include "value-labels.h" -#include "variable.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "gettext.h" #define _(msgid) gettext (msgid) -#include "debug-print.h" - /* Parses and executes APPLY DICTIONARY. */ int cmd_apply_dictionary (void) @@ -89,38 +91,7 @@ cmd_apply_dictionary (void) s->name); else if (val_labs_count (s->val_labs)) { - /* 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) + if (val_labs_can_set_width (s->val_labs, t->width)) { val_labs_destroy (t->val_labs); t->val_labs = s->val_labs;