CTABLES: Fix treatment of multiline titles.
authorBen Pfaff <blp@cs.stanford.edu>
Thu, 24 Nov 2022 00:51:19 +0000 (16:51 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Thu, 24 Nov 2022 00:51:19 +0000 (16:51 -0800)
Bug #63032.
Thanks to Frans Houweling for reporting this bug.

src/language/stats/ctables.c
tests/language/stats/ctables.at

index 5c71eb55ac40ff80456084a1a644fad59a82dff5..565c8ce1db10cbd512683973ee3c90968f3f24d2 100644 (file)
@@ -6537,7 +6537,7 @@ cmd_ctables (struct lexer *lexer, struct dataset *ds)
                   while (lex_is_string (lexer))
                     {
                       if (!ds_is_empty (&s))
-                        ds_put_byte (&s, ' ');
+                        ds_put_byte (&s, '\n');
                       put_title_text (&s, lex_tokss (lexer), now,
                                       lexer, dataset_dict (ds),
                                       expr_start, expr_end);
index 148899147a0f96517cd9c0cfd7cccd764809085a..57f854ec6337d7c23401934b5aee7fdad0ce178f 100644 (file)
@@ -3303,13 +3303,14 @@ AT_DATA([ctables.sps],
 CTABLES
     /VLABELS VARIABLES=qn1 DISPLAY=NONE
     /TABLE ((qn1[c][COUNT])) BY qns3a[c] > qnd5
-    /TITLES TITLE='How often do you drive?'
+    /TITLES TITLE='How often do you drive?' 'second line of title'
             CAPTION='Generated )TIME on )DATE'
            CORNER=')TABLE'.
 ]])
 AT_CHECK([pspp ctables.sps -O box=unicode | sed 's/..:..:../HH:MM:SS/
 s&../../..&MM/DD/YY&'], [0], [dnl
                             How often do you drive?
+                              second line of title
 ╭───────────────────────────────────┬─────────────────────────────────────────╮
 │                                   │               S3a. GENDER:              │
 │                                   ├────────────────────┬────────────────────┤