projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1b014fd
)
output: Implement styling for footnotes.
author
Ben Pfaff
<blp@cs.stanford.edu>
Thu, 22 Nov 2018 05:25:13 +0000
(21:25 -0800)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Tue, 25 Dec 2018 20:45:21 +0000
(12:45 -0800)
src/output/render.c
patch
|
blob
|
history
src/output/tab.c
patch
|
blob
|
history
src/output/tab.h
patch
|
blob
|
history
src/output/table-provider.h
patch
|
blob
|
history
tests/output/render-test.c
patch
|
blob
|
history
diff --git
a/src/output/render.c
b/src/output/render.c
index c3a59a6c429c01aa97ec7489a48cb543c7d5d0ce..f73137f0e35eafe8ab11b8981de11998f01c73cf 100644
(file)
--- a/
src/output/render.c
+++ b/
src/output/render.c
@@
-1425,6
+1425,11
@@
add_footnote_page (struct render_pager *p, const struct table_item *item)
{
tab_text_format (t, 0, i, TAB_LEFT, "%s.", f[i]->marker);
tab_text (t, 1, i, TAB_LEFT, f[i]->content);
{
tab_text_format (t, 0, i, TAB_LEFT, "%s.", f[i]->marker);
tab_text (t, 1, i, TAB_LEFT, f[i]->content);
+ if (f[i]->style)
+ {
+ tab_add_style (t, 0, i, f[i]->style);
+ tab_add_style (t, 1, i, f[i]->style);
+ }
}
render_pager_add_table (p, &t->table);
}
render_pager_add_table (p, &t->table);
diff --git
a/src/output/tab.c
b/src/output/tab.c
index db8488d8546329339e56c57d213b7d59b8831218..435fa609ce06d4547f885f07aad3ad5c6e336e08 100644
(file)
--- a/
src/output/tab.c
+++ b/
src/output/tab.c
@@
-621,12
+621,13
@@
tab_joint_text_format (struct tab_table *table, int x1, int y1, int x2,
struct footnote *
tab_create_footnote (struct tab_table *table, size_t idx, const char *content,
struct footnote *
tab_create_footnote (struct tab_table *table, size_t idx, const char *content,
- const char *marker)
+ const char *marker
, struct cell_style *style
)
{
struct footnote *f = pool_alloc (table->container, sizeof *f);
f->idx = idx;
f->content = pool_strdup (table->container, content);
f->marker = pool_strdup (table->container, marker);
{
struct footnote *f = pool_alloc (table->container, sizeof *f);
f->idx = idx;
f->content = pool_strdup (table->container, content);
f->marker = pool_strdup (table->container, marker);
+ f->style = style;
return f;
}
return f;
}
diff --git
a/src/output/tab.h
b/src/output/tab.h
index f45e1f605589f66729ed872f6cc9bbed44256d15..40f871b12df5101cc718a07d16e2de02cbaf627f 100644
(file)
--- a/
src/output/tab.h
+++ b/
src/output/tab.h
@@
-155,7
+155,8
@@
void tab_joint_text_format (struct tab_table *, int x1, int y1, int x2, int y2,
PRINTF_FORMAT (7, 8);
struct footnote *tab_create_footnote (struct tab_table *, size_t idx,
PRINTF_FORMAT (7, 8);
struct footnote *tab_create_footnote (struct tab_table *, size_t idx,
- const char *content, const char *marker);
+ const char *content, const char *marker,
+ struct cell_style *);
void tab_add_footnote (struct tab_table *, int x, int y,
const struct footnote *);
void tab_add_footnote (struct tab_table *, int x, int y,
const struct footnote *);
diff --git
a/src/output/table-provider.h
b/src/output/table-provider.h
index d875462c9c237b7c00f3f8f3e88b32666da55a17..2a3a17c9daeec45e4c8461ce6bcd2255b2cc8b68 100644
(file)
--- a/
src/output/table-provider.h
+++ b/
src/output/table-provider.h
@@
-27,6
+27,7
@@
struct footnote
size_t idx;
char *content;
char *marker;
size_t idx;
char *content;
char *marker;
+ struct cell_style *style;
};
/* An item of contents within a table cell. */
};
/* An item of contents within a table cell. */
diff --git
a/tests/output/render-test.c
b/tests/output/render-test.c
index 42b8795336f6f354b0391f6b46246bb3ecbbdcd8..e5eea91d94fefd0b2f9ae921e87699bf3b5eb5bf 100644
(file)
--- a/
tests/output/render-test.c
+++ b/
tests/output/render-test.c
@@
-475,7
+475,7
@@
read_table (FILE *stream)
{
char marker[2] = { 'a' + n_footnotes, '\0' };
struct footnote *f = tab_create_footnote (
{
char marker[2] = { 'a' + n_footnotes, '\0' };
struct footnote *f = tab_create_footnote (
- tab, n_footnotes, content, marker);
+ tab, n_footnotes, content, marker
, NULL
);
tab_add_footnote (tab, c, r, f);
n_footnotes++;
}
tab_add_footnote (tab, c, r, f);
n_footnotes++;
}