return;
t = tab_create (3, split_cnt + 1);
- tab_vline (t, TAL_GAP, 1, 0, split_cnt);
- tab_vline (t, TAL_GAP, 2, 0, split_cnt);
tab_text (t, 0, 0, TAB_NONE, _("Variable"));
tab_text (t, 1, 0, TAB_LEFT, _("Value"));
tab_text (t, 2, 0, TAB_LEFT, _("Label"));
t = tab_create (2, 11 + (info.product_ext != NULL));
r = 0;
- tab_vline (t, TAL_GAP, 1, 0, 8);
-
+
tab_text (t, 0, r, TAB_LEFT, _("File:"));
tab_text (t, 1, r++, TAB_LEFT, fh_get_file_name (h));
tab_box (t, TAL_2, TAL_2, -1, -1, 0, 0, tab_nc (t) - 1, tab_nr (t) - 1);
tab_box (t, -1, -1, -1, TAL_1, tab_l (t), tab_t (t) - 1, tab_nc (t) - 1,
tab_nr (t) - 1);
- tab_box (t, -1, -1, -1, TAL_GAP, 0, tab_t (t), tab_l (t) - 1,
- tab_nr (t) - 1);
tab_vline (t, TAL_2, tab_l (t), 0, tab_nr (t) - 1);
tab_submit (t);
tab_box (t, TAL_1, TAL_1, -1, -1 , 0 , 0 , 2, tab_nr(t) - 1) ;
tab_vline (t, TAL_1 , 2, 0, tab_nr(t) - 1);
- tab_vline (t, TAL_GAP , 1, 0, tab_nr(t) - 1 ) ;
for (i = 0; i < FRQ_ST_count; i++)
{
tab_box (t, TAL_2, TAL_2, TAL_0, TAL_1, 0, 0, cols - 1, rows - 1);
tab_hline (t, TAL_2, 0, cols - 1, 1);
- tab_vline (t, TAL_GAP, 1, 0, rows - 1);
tab_title (t, _("Group Statistics"));
tab_text (t, 1, 0, TAB_CENTER | TAT_TITLE, var_to_string (is->gvar));
tab_text (t, 2, 0, TAB_CENTER | TAT_TITLE, _("N"));
_("%g%% Confidence Interval of the Difference"),
tt->confidence * 100.0);
- tab_vline (t, TAL_GAP, 6, 1, 1);
tab_hline (t, TAL_1, 5, 6, 2);
tab_text (t, 1, 2, TAB_CENTER | TAT_TITLE, _("t"));
tab_text (t, 2, 2, TAB_CENTER | TAT_TITLE, _("df"));
_("%g%% Confidence Interval of the Difference"),
tt->confidence * 100.0);
- tab_vline (t, TAL_GAP, 6, 1, 1);
tab_hline (t, TAL_1, 5, 6, 2);
tab_text (t, 7, 2, TAB_CENTER | TAT_TITLE, _("t"));
tab_text (t, 8, 2, TAB_CENTER | TAT_TITLE, _("df"));
}
for (i = 0; i < TABLE_N_AXES; i++)
params.min_break[i] = a->min_break[i];
+ params.supports_margins = false;
if (a->file == NULL && !ascii_open_page (a))
return;
for (i = 0; i < TABLE_N_AXES; i++)
xr->params->min_break[i] = xr->min_break[i];
+ xr->params->supports_margins = true;
}
cairo_set_source_rgb (xr->cairo, xr->fg.red, xr->fg.green, xr->fg.blue);
n_borders = 0;
top = table_get_rule (t, TABLE_VERT, x, y);
- if (top > TAL_GAP)
+ if (top > TAL_0)
put_border (html->file, n_borders++, top, "top");
if (y + rowspan == table_nr (t))
{
bottom = table_get_rule (t, TABLE_VERT, x, y + rowspan);
- if (bottom > TAL_GAP)
+ if (bottom > TAL_0)
put_border (html->file, n_borders++, bottom, "bottom");
}
left = table_get_rule (t, TABLE_HORZ, x, y);
- if (left > TAL_GAP)
+ if (left > TAL_0)
put_border (html->file, n_borders++, left, "left");
if (x + colspan == table_nc (t))
{
right = table_get_rule (t, TABLE_HORZ, x + colspan, y);
- if (right > TAL_GAP)
+ if (right > TAL_0)
put_border (html->file, n_borders++, right, "right");
}
switch (type)
{
case TAL_0:
- case TAL_GAP:
return RENDER_LINE_NONE;
case TAL_1:
return RENDER_LINE_SINGLE;
for (d[b] = 0; d[b] < table->n[b]; d[b]++)
rules |= 1u << table_get_rule (table, a, d[H], d[V]);
+ /* Turn off TAL_NONE because it has width 0 and we needn't bother. However,
+ if the device doesn't support margins, make sure that there is at least a
+ small gap between cells (but we don't need any at the left or right edge
+ of the table). */
+ if (rules & (1u << TAL_0))
+ {
+ rules &= ~(1u << TAL_0);
+ if (z > 0 && z < table->n[a] && !params->supports_margins && a == H)
+ rules |= 1u << TAL_1;
+ }
+
/* Calculate maximum width of the rules that are present. */
width = 0;
if (rules & (1u << TAL_1)
- || (z > 0 && z < table->n[a] && rules & (1u << TAL_GAP)))
+ || (z > 0 && z < table->n[a] && rules & (1u << TAL_0)))
width = params->line_widths[a][RENDER_LINE_SINGLE];
if (rules & (1u << TAL_2))
width = MAX (width, params->line_widths[a][RENDER_LINE_DOUBLE]);
across two pages. (Joined cells may always be broken at join
points.) */
int min_break[TABLE_N_AXES];
+
+ bool supports_margins;
};
/* An iterator for breaking render_pages into smaller chunks. */
memset (t->ct, 0, nc * nr);
t->rh = pool_nmalloc (t->container, nc, nr + 1);
- memset (t->rh, 0, nc * (nr + 1));
+ memset (t->rh, TAL_0, nc * (nr + 1));
t->rv = pool_nmalloc (t->container, nr, nc + 1);
- memset (t->fmtmap, 0, sizeof (*t->fmtmap) * n_RC);
-
- memset (t->rv, TAL_GAP, nr * (nc + 1));
+ memset (t->rv, TAL_0, nr * (nc + 1));
+ memset (t->fmtmap, 0, sizeof (*t->fmtmap) * n_RC);
t->fmtmap[RC_PVALUE] = ugly[RC_PVALUE];
t->fmtmap[RC_INTEGER] = ugly[RC_INTEGER];
t->fmtmap[RC_OTHER] = *settings_get_format ();
{
memset (&t->rh[nc * (tab_nr (t) + 1)], TAL_0,
(nr - tab_nr (t)) * nc);
- memset (&t->rv[(nc + 1) * tab_nr (t)], TAL_GAP,
+ memset (&t->rv[(nc + 1) * tab_nr (t)], TAL_0,
(nr - tab_nr (t)) * (nc + 1));
}
}
if (axis == TABLE_VERT)
return tc->heading != NULL && y == 1 ? TAL_1 : TAL_0;
else
- return TAL_GAP;
+ return TAL_0;
}
static const struct table_class table_casereader_class =
enum
{
TAL_0, /* No line. */
- TAL_GAP, /* Spacing but no line. */
TAL_1, /* Single line. */
TAL_2, /* Double line. */
N_LINES
1*2 hij\nklm\nnop
])
AT_CHECK([render-test input], [0], [dnl
-abc
-def
-hij
-klm
-nop
+ abc
+ def
+ hij
+ klm
+ nop
])
AT_CLEANUP
1*2 @shorter
])
AT_CHECK([render-test --width=30 --length=15 input], [0], [dnl
-+-------------------+
-|A long text string.|
-+-------------------+
-| shorter|
-+-------------------+
++--------------------+
+| A long text string.|
++--------------------+
+| shorter|
++--------------------+
])
AT_CLEANUP