- struct table *tab = table_create (1, 1, 0, 0, 0, 0);
-
- struct table_area_style *style = pool_alloc (tab->container, sizeof *style);
- *style = (struct table_area_style) { TABLE_AREA_STYLE_INITIALIZER__,
- .cell_style.halign = TABLE_HALIGN_LEFT };
- struct font_style *font_style = &style->font_style;
- if (text_item->typeface)
- font_style->typeface = pool_strdup (tab->container, text_item->typeface);
- font_style->size = text_item->size;
- font_style->bold = text_item->bold;
- font_style->italic = text_item->italic;
- font_style->underline = text_item->underline;
- font_style->markup = text_item->markup;
- tab->styles[0] = style;
-
- int opts = 0;
- if (text_item->markup)
- opts |= TAB_MARKUP;
- if (text_item->type == TEXT_ITEM_SYNTAX || text_item->type == TEXT_ITEM_LOG)
- opts |= TAB_FIX;
- table_text (tab, 0, 0, opts, text_item_get_text (text_item));
- struct table_item *table_item = table_item_create (tab, NULL, NULL, NULL);
- text_item_unref (text_item);
- return table_item;
+ struct pivot_table *table = pivot_table_create__ (NULL, "Text");
+ pivot_table_set_look (table, text_item_table_look ());
+
+ struct pivot_dimension *d = pivot_dimension_create (
+ table, PIVOT_AXIS_ROW, N_("Text"));
+ d->hide_all_labels = true;
+ pivot_category_create_leaf (d->root, pivot_value_new_text ("null"));
+
+ struct pivot_value *content = pivot_value_new_user_text (
+ text_item->text, SIZE_MAX);
+ pivot_value_set_font_style (content, &text_item->style);
+ pivot_table_put1 (table, 0, content);
+
+ return table_item_create (table);