#include "output/pivot-output.h"
#include "output/pivot-table.h"
#include "output/render.h"
-#include "output/table-item.h"
#include "output/table.h"
#include "gl/minmax.h"
for (int i = 0; i < TABLE_N_AXES; i++)
{
- page->cp[i] = xmalloc ((2 * n[i] + 2) * sizeof *page->cp[i]);
- page->join_crossing[i] = xzalloc ((n[i] + 1)
- * sizeof *page->join_crossing[i]);
+ page->cp[i] = xcalloc ((2 * n[i] + 2) , sizeof *page->cp[i]);
+ page->join_crossing[i] = xcalloc ((n[i] + 1) , sizeof *page->join_crossing[i]);
}
hmap_init (&page->overflows);
span multiple columns. */
struct render_row *columns[2];
for (int i = 0; i < 2; i++)
- columns[i] = xzalloc (nc * sizeof *columns[i]);
+ columns[i] = xcalloc (nc, sizeof *columns[i]);
for (int y = 0; y < nr; y++)
for (int x = 0; x < nc;)
{
}
/* Calculate heights of cells that do not span multiple rows. */
- struct render_row *rows = xzalloc (nr * sizeof *rows);
+ struct render_row *rows = XCALLOC (nr, struct render_row);
for (int y = 0; y < nr; y++)
for (int x = 0; x < nc;)
{
render_break_init_empty (&p->y_break);
}
-/* Creates and returns a new render_pager for rendering TABLE_ITEM on the
- device with the given PARAMS. */
+/* Creates and returns a new render_pager for rendering PT on the device
+ with the given PARAMS. */
struct render_pager *
render_pager_create (const struct render_params *params,
- const struct table_item *table_item,
+ const struct pivot_table *pt,
const size_t *layer_indexes)
{
- const struct pivot_table *pt = table_item->pt;
if (!layer_indexes)
layer_indexes = pt->current_layer;
double scale = 1.0;
if (body_width > params->size[H])
{
- if (table_item->pt
- && table_item->pt->look->shrink_to_fit[H]
- && params->ops->scale)
+ if (pt->look->shrink_to_fit[H] && params->ops->scale)
scale = params->size[H] / (double) body_width;
else
{
they won't break across as much vertical space, thus shrinking the table
vertically more than the scale would imply. Shrinking only as much as
necessary would require an iterative search. */
- if (table_item->pt
- && table_item->pt->look->shrink_to_fit[V]
- && params->ops->scale)
+ if (pt->look->shrink_to_fit[V] && params->ops->scale)
{
int total_height = 0;
for (size_t i = 0; i < p->n_pages; i++)
insert_overflow (struct render_page_selection *s,
const struct table_cell *cell)
{
- struct render_overflow *of = xzalloc (sizeof *of);
+ struct render_overflow *of = XZALLOC (struct render_overflow);
cell_to_subpage (s, cell, of->d);
hmap_insert (&s->subpage->overflows, &of->node,
hash_cell (of->d[H], of->d[V]));