From 54c5070a0e728c48874e3d9a394098b341e8f5d3 Mon Sep 17 00:00:00 2001 From: Matthias Reischenbacher Date: Thu, 4 Oct 2018 19:10:32 +0000 Subject: [PATCH] FOP-2818: fix color spaces of parent pdf resources member getting lost git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1842844 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/org/apache/fop/pdf/PDFResources.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fop-core/src/main/java/org/apache/fop/pdf/PDFResources.java b/fop-core/src/main/java/org/apache/fop/pdf/PDFResources.java index 96d45a13a..e269ad361 100644 --- a/fop-core/src/main/java/org/apache/fop/pdf/PDFResources.java +++ b/fop-core/src/main/java/org/apache/fop/pdf/PDFResources.java @@ -298,8 +298,13 @@ public class PDFResources extends PDFDictionary { put("ExtGState", dict); } - if (!this.colorSpaces.isEmpty()) { + if (!this.colorSpaces.isEmpty() || (parent != null && !parent.colorSpaces.isEmpty())) { PDFDictionary dict = new PDFDictionary(this); + if (parent != null) { + for (PDFColorSpace colorSpace : parent.colorSpaces.values()) { + dict.put(colorSpace.getName(), colorSpace); + } + } for (PDFColorSpace colorSpace : colorSpaces.values()) { dict.put(colorSpace.getName(), colorSpace); } -- 2.39.5