diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2016-02-26 17:02:49 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2016-02-29 15:52:52 +0100 |
commit | 5be6ce8b3b15fa3771c1ad903a5bde6ffd22d31d (patch) | |
tree | 1b10faa36c6feaaf2aa34561fb1de144f47e6f61 /source/pdf | |
parent | 9492fec254b440d707a120d0fc9b606d38f1acfd (diff) | |
download | mupdf-5be6ce8b3b15fa3771c1ad903a5bde6ffd22d31d.tar.xz |
Improve pretty-print formatting of arrays.
Diffstat (limited to 'source/pdf')
-rw-r--r-- | source/pdf/pdf-object.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/pdf/pdf-object.c b/source/pdf/pdf-object.c index db4358e1..406580b2 100644 --- a/source/pdf/pdf-object.c +++ b/source/pdf/pdf-object.c @@ -1951,15 +1951,19 @@ static void fmt_array(fz_context *ctx, struct fmt *fmt, pdf_obj *obj) fmt_putc(ctx, fmt, ']'); } else { - fmt_puts(ctx, fmt, "[ "); + fmt_putc(ctx, fmt, '['); + fmt->indent ++; for (i = 0; i < n; i++) { if (fmt->col > 60) { fmt_putc(ctx, fmt, '\n'); fmt_indent(ctx, fmt); + } else { + fmt_putc(ctx, fmt, ' '); } fmt_obj(ctx, fmt, pdf_array_get(ctx, obj, i)); - fmt_putc(ctx, fmt, ' '); } + fmt->indent --; + fmt_putc(ctx, fmt, ' '); fmt_putc(ctx, fmt, ']'); fmt_sep(ctx, fmt); } |