diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2020-09-04 21:36:59 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2020-09-04 21:36:59 +0000 |
commit | 14dafc8d65c0e21fd9ea523c74d6d7a265edcb18 (patch) | |
tree | 80c863c0e4a0d44655ff224eec7bc01b8032981e /Build/source/texk/dvipdfm-x/spc_pdfm.c | |
parent | 486ab78fef46708a628b3ac2495e8ca3097a1644 (diff) |
change operation to resource dict. (S. Hirata)
git-svn-id: svn://tug.org/texlive/trunk@56265 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipdfm-x/spc_pdfm.c')
-rw-r--r-- | Build/source/texk/dvipdfm-x/spc_pdfm.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Build/source/texk/dvipdfm-x/spc_pdfm.c b/Build/source/texk/dvipdfm-x/spc_pdfm.c index 477a22c39f8..fbe57618f08 100644 --- a/Build/source/texk/dvipdfm-x/spc_pdfm.c +++ b/Build/source/texk/dvipdfm-x/spc_pdfm.c @@ -194,6 +194,20 @@ safeputresdict (pdf_obj *kp, pdf_obj *vp, void *dp) dict = pdf_lookup_dict(dp, key); if (pdf_obj_typeof(vp) == PDF_INDIRECT) { + /* Copy the content of old resource category dict (if exists) */ + if (dict) { + pdf_obj *dst = pdf_deref_obj(vp); + if (dst) { + if (pdf_obj_typeof(dst) == PDF_DICT) { + pdf_foreach_dict(dict, safeputresdent, dst); + pdf_release_obj(dst); + } else { + WARN("Invalid type (not DICT) for page/form resource dict entry: key=\"%s\"", key); + pdf_release_obj(dst); + return -1; + } + } + } pdf_add_dict(dp, pdf_new_name(key), pdf_link_obj(vp)); } else if (pdf_obj_typeof(vp) == PDF_DICT) { if (dict) |