summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-11-13 14:39:15 +0100
committerTor Andersson <tor.andersson@artifex.com>2018-11-13 21:27:07 +0100
commit5f0026cc97c7084be768a776f2fd8802bf9b0c21 (patch)
treed20f9dd4843a344a27d0d4cc219a7da7c208d6a5 /source
parentc816c486dcc68d522035af3a8ebc7efa8fc1d9ad (diff)
downloadmupdf-5f0026cc97c7084be768a776f2fd8802bf9b0c21.tar.xz
Bug 699217: Show whether outline items are open in 'mutool show outline'.
A '+' prefix indicates an open branch. A '-' prefix indicates a closed branch. A ' ' prefix indicates a leaf node.
Diffstat (limited to 'source')
-rw-r--r--source/tools/pdfshow.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source/tools/pdfshow.c b/source/tools/pdfshow.c
index b9687150..0ed111bb 100644
--- a/source/tools/pdfshow.c
+++ b/source/tools/pdfshow.c
@@ -213,8 +213,13 @@ fz_print_outline(fz_context *ctx, fz_output *out, fz_outline *outline, int level
int i;
while (outline)
{
+ if (outline->down)
+ fz_write_byte(ctx, out, outline->is_open ? '-' : '+');
+ else
+ fz_write_byte(ctx, out, '|');
+
for (i = 0; i < level; i++)
- fz_write_printf(ctx, out, "\t");
+ fz_write_byte(ctx, out, '\t');
fz_write_printf(ctx, out, "%s\t%s\n", outline->title, outline->uri);
if (outline->down)
fz_print_outline(ctx, out, outline->down, level + 1);
@@ -226,7 +231,7 @@ static void showoutline(void)
{
fz_outline *outline = fz_load_outline(ctx, (fz_document*)doc);
fz_try(ctx)
- fz_print_outline(ctx, fz_stdout(ctx), outline, 0);
+ fz_print_outline(ctx, fz_stdout(ctx), outline, 1);
fz_always(ctx)
fz_drop_outline(ctx, outline);
fz_catch(ctx)