From b58b05fe601458de72b35c336590c9def6602081 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 8 Nov 2018 13:00:50 +0100 Subject: Fix 699352: Call begin_layer for all marked content in PDF. Since we call end_layer without distinction, we should also call begin_layer the same way. Also change the XML to emit separate tags for beginning and ending a layer, since there is no guarantee the layer calls will be neatly nested with clipping pushes and pops; nor is there a guarantee that the PDF will even balance the BMC/BDC and EMC operators. --- source/pdf/pdf-op-run.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source/pdf') diff --git a/source/pdf/pdf-op-run.c b/source/pdf/pdf-op-run.c index f0ce5e9d..7d676214 100644 --- a/source/pdf/pdf-op-run.c +++ b/source/pdf/pdf-op-run.c @@ -2155,7 +2155,7 @@ static void pdf_run_BMC(fz_context *ctx, pdf_processor *proc, const char *tag) pdf_run_processor *pr = (pdf_run_processor *)proc; if (!tag) - tag = "UnnamedLayer"; + tag = "Untitled"; fz_begin_layer(ctx, pr->dev, tag); } @@ -2165,12 +2165,12 @@ static void pdf_run_BDC(fz_context *ctx, pdf_processor *proc, const char *tag, p pdf_run_processor *pr = (pdf_run_processor *)proc; const char *str; - if (!tag || strcmp(tag, "OC")) - return; + if (!tag) + tag = "Untitled"; - str = pdf_dict_get_string(ctx, cooked, PDF_NAME(Name), NULL); + str = pdf_dict_get_text_string(ctx, cooked, PDF_NAME(Name)); if (strlen(str) == 0) - str = "UnnamedLayer"; + str = tag; fz_begin_layer(ctx, pr->dev, str); } -- cgit v1.2.3