#include "output/pivot-table.h"
#include "output/spv/spv.h"
-#include "output/text-item.h"
+#include "output/output-item.h"
#include "gl/xalloc.h"
spv_text_submit (const struct spv_item *in)
{
enum spv_item_class class = spv_item_get_class (in);
- enum text_item_type type
- = (class == SPV_CLASS_HEADINGS ? TEXT_ITEM_TITLE
- : class == SPV_CLASS_PAGETITLE ? TEXT_ITEM_PAGE_TITLE
- : TEXT_ITEM_LOG);
- const struct pivot_value *value = spv_item_get_text (in);
- char *text = pivot_value_to_string_defaults (value);
- char *label = in->label ? xstrdup (in->label) : NULL;
- struct text_item *item = text_item_create_nocopy (type, text, label);
-
- if (value->font_style)
- {
- font_style_uninit (&item->style);
- font_style_copy (NULL, &item->style, value->font_style);
- }
- text_item_submit (item);
+ struct output_item *item = text_item_create_value (
+ (class == SPV_CLASS_HEADINGS ? TEXT_ITEM_TITLE
+ : class == SPV_CLASS_PAGETITLE ? TEXT_ITEM_PAGE_TITLE
+ : TEXT_ITEM_LOG),
+ pivot_value_clone (spv_item_get_text (in)),
+ xstrdup_if_nonnull (in->label));
+ output_item_submit (item);
}