struct libscols_cell *ce,
struct ul_buffer *buf)
{
- char *path;
+ const char *path;
/* URI disabled at all */
if (ce->no_uri)
return NULL;
- /* No column prefix, return cell URI (or NULL if undefined) */
- if (!cl->uri)
- return ce->uri;
+ /* No column prefix, return cell's URI (or NULL if undefined) */
+ if (!scols_column_get_uri(cl))
+ return scols_cell_get_uri(ce);
- /* Compose URI from column-uri + path. The path is ce->uri or cell data. */
- path = ce->uri;
+ /* Compose URI from column's URI + path. The path is cell's URI or cell data. */
+ path = scols_cell_get_uri(ce);
if (!path && buf) {
/* The buffer may already contain tree data, so we need to skip it. */
DBG(COL, ul_debugobj(cl, "printing pending data"));
- if (cl->uri || ce->uri)
+ if (scols_column_get_uri(cl) || scols_cell_get_uri(ce))
uri = mk_cell_uri(cl, ce, buf);
if (scols_table_is_noencoding(tb))
break; /* continue below */
}
- if (cl->uri || ce->uri)
+ if (!ln) {
+ /* column header */
+ annot = scols_column_get_annotation(cl);
+ } else if (scols_column_get_uri(cl) || scols_cell_get_uri(ce)) {
+ /* column data */
uri = mk_cell_uri(cl, ce, buf);
+ }
- if (cl->annotation)
- annot = scols_column_get_annotation(cl);
/* Encode. Note that 'len' and 'width' are number of glyphs not bytes.
*/
fputc(data[i], tb->out);
}
ul_fputs_hyperlink(uri, link, tb->out);
- } else if (!ln && annot && *annot) {
- /* Printing the header with a column annotation as tooltip */
+
+ } else if (annot && *annot) {
ul_fputs_hyperlink(annot, data, tb->out);
} else {
fputs(data, tb->out);
continue;
ul_buffer_reset_data(buf);
- if (cl->uri)
+ if (scols_column_get_uri(cl))
scols_cell_disable_uri(&cl->header, 1);
scols_table_set_cursor(tb, NULL, cl, &cl->header);