summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-pattern.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-03-29 22:25:09 +0200
committerTor Andersson <tor.andersson@artifex.com>2018-04-24 16:47:43 +0200
commit51b8205a513e86c62121a927a067632c1a933839 (patch)
treec2882a6c253a715bfc2ea72854c75350f0b2024b /source/pdf/pdf-pattern.c
parent67a7449fc1f186f318942b9c6b8d66d4458b7d87 (diff)
downloadmupdf-51b8205a513e86c62121a927a067632c1a933839.tar.xz
Remove need for namedump by using macros and preprocessor.
Add a PDF_NAME(Foo) macro that evaluates to a pdf_obj for /Foo. Use the C preprocessor to create the enum values and string table from one include file instead of using a separate code generator tool.
Diffstat (limited to 'source/pdf/pdf-pattern.c')
-rw-r--r--source/pdf/pdf-pattern.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/pdf/pdf-pattern.c b/source/pdf/pdf-pattern.c
index 7523c5bc..e1e6f08f 100644
--- a/source/pdf/pdf-pattern.c
+++ b/source/pdf/pdf-pattern.c
@@ -53,20 +53,20 @@ pdf_load_pattern(fz_context *ctx, pdf_document *doc, pdf_obj *dict)
/* Store pattern now, to avoid possible recursion if objects refer back to this one */
pdf_store_item(ctx, dict, pat, pdf_pattern_size(pat));
- pat->ismask = pdf_to_int(ctx, pdf_dict_get(ctx, dict, PDF_NAME_PaintType)) == 2;
- pat->xstep = pdf_to_real(ctx, pdf_dict_get(ctx, dict, PDF_NAME_XStep));
- pat->ystep = pdf_to_real(ctx, pdf_dict_get(ctx, dict, PDF_NAME_YStep));
+ pat->ismask = pdf_to_int(ctx, pdf_dict_get(ctx, dict, PDF_NAME(PaintType))) == 2;
+ pat->xstep = pdf_to_real(ctx, pdf_dict_get(ctx, dict, PDF_NAME(XStep)));
+ pat->ystep = pdf_to_real(ctx, pdf_dict_get(ctx, dict, PDF_NAME(YStep)));
- obj = pdf_dict_get(ctx, dict, PDF_NAME_BBox);
+ obj = pdf_dict_get(ctx, dict, PDF_NAME(BBox));
pdf_to_rect(ctx, obj, &pat->bbox);
- obj = pdf_dict_get(ctx, dict, PDF_NAME_Matrix);
+ obj = pdf_dict_get(ctx, dict, PDF_NAME(Matrix));
if (obj)
pdf_to_matrix(ctx, obj, &pat->matrix);
else
pat->matrix = fz_identity;
- pat->resources = pdf_dict_get(ctx, dict, PDF_NAME_Resources);
+ pat->resources = pdf_dict_get(ctx, dict, PDF_NAME(Resources));
if (pat->resources)
pdf_keep_obj(ctx, pat->resources);