pivot-table: Make template pivot_values localized.
authorBen Pfaff <blp@cs.stanford.edu>
Mon, 21 Oct 2019 03:04:22 +0000 (03:04 +0000)
committerBen Pfaff <blp@cs.stanford.edu>
Sun, 29 Dec 2019 05:28:10 +0000 (05:28 +0000)
This will be used in an upcoming commit.

src/output/pivot-table.c
src/output/pivot-table.h

index bab2a8d6aefab9886c06d02967e4435917997e48..057df4ef02f226cc612b28e9537e52e49bb39dc3 100644 (file)
@@ -1860,7 +1860,7 @@ pivot_value_format_body (const struct pivot_value *value,
       break;
 
     case PIVOT_VALUE_TEMPLATE:
-      pivot_format_template (out, value->template.s, value->template.args,
+      pivot_format_template (out, value->template.local, value->template.args,
                              value->template.n_args, show_values,
                              show_variables);
       break;
@@ -1949,7 +1949,9 @@ pivot_value_destroy (struct pivot_value *value)
           break;
 
         case PIVOT_VALUE_TEMPLATE:
-          free (value->template.s);
+          free (value->template.local);
+          if (value->template.id != value->template.local)
+            free (value->template.id);
           for (size_t i = 0; i < value->template.n_args; i++)
             pivot_argument_uninit (&value->template.args[i]);
           free (value->template.args);
index 8006adaf00f851d61f04117bbcfdb4937dd263b1..99308c9e443daa3f2294744732f569f48223ba95 100644 (file)
@@ -651,7 +651,8 @@ struct pivot_value
         /* PIVOT_VALUE_TEMPLATE. */
         struct
           {
-            char *s;
+            char *local;              /* Localized. */
+            char *id;                 /* Identifier. */
             struct pivot_argument *args;
             size_t n_args;
           }