summaryrefslogtreecommitdiff
path: root/gfx
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-09-05 02:02:02 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-09-05 02:02:02 (GMT)
commit73d03be3950c5f1d67d15f430d75195a9f3656b6 (patch)
tree1de817d9cf2441cb889f5caaa23ff8279b907fcd /gfx
parent0d99deb40fe00e4cf33f894ab47108a1716790c6 (diff)
downloadeeshow-73d03be3950c5f1d67d15f430d75195a9f3656b6.zip
eeshow-73d03be3950c5f1d67d15f430d75195a9f3656b6.tar.gz
eeshow-73d03be3950c5f1d67d15f430d75195a9f3656b6.tar.bz2
gfx/cro.c (cr_pdf_init): add_toc is only available after cr_args
Diffstat (limited to 'gfx')
-rw-r--r--gfx/cro.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gfx/cro.c b/gfx/cro.c
index 492e63f..876ac3b 100644
--- a/gfx/cro.c
+++ b/gfx/cro.c
@@ -607,9 +607,6 @@ static void *cr_pdf_init(void)
cc->cr = cairo_create(cc->s);
setup_font(cc);
- if (cc->add_toc)
- cc->toc = pdftoc_begin();
-
return cc;
}
@@ -621,8 +618,11 @@ static bool cr_pdf_args(void *ctx, int argc, char *const *argv,
if (!cr_args(cc, argc, argv, opts))
return 0;
- if (cc->add_toc && cc->output_name && strcmp(cc->output_name, "-"))
- return pdftoc_set_file(cc->toc, cc->output_name);
+ if (cc->add_toc) {
+ cc->toc = pdftoc_begin();
+ if (cc->output_name && strcmp(cc->output_name, "-"))
+ return pdftoc_set_file(cc->toc, cc->output_name);
+ }
return 1;
}