diff options
Diffstat (limited to 'src/java/org/apache')
-rw-r--r-- | src/java/org/apache/fop/pdf/PDFFunction.java | 4 | ||||
-rw-r--r-- | src/java/org/apache/fop/render/gradient/Function.java | 3 | ||||
-rw-r--r-- | src/java/org/apache/fop/render/ps/svg/PSSVGGraphics2D.java | 8 |
3 files changed, 8 insertions, 7 deletions
diff --git a/src/java/org/apache/fop/pdf/PDFFunction.java b/src/java/org/apache/fop/pdf/PDFFunction.java index be74dfc10..ed2d1d16c 100644 --- a/src/java/org/apache/fop/pdf/PDFFunction.java +++ b/src/java/org/apache/fop/pdf/PDFFunction.java @@ -118,7 +118,9 @@ public class PDFFunction extends PDFObject { out.append(pdfFunctions.get(functionIndex).referencePDF()); } }; - return encode(function.toWriteableString(subFunctionRenderer)); + StringBuilder out = new StringBuilder(); + function.output(out, subFunctionRenderer); + return encode(out.toString()); } /** {@inheritDoc} */ diff --git a/src/java/org/apache/fop/render/gradient/Function.java b/src/java/org/apache/fop/render/gradient/Function.java index e83f6dc05..220c5f791 100644 --- a/src/java/org/apache/fop/render/gradient/Function.java +++ b/src/java/org/apache/fop/render/gradient/Function.java @@ -338,8 +338,7 @@ public class Function { return cOne; } - public String toWriteableString(SubFunctionRenderer subFunctionRenderer) { - StringBuilder out = new StringBuilder(256); + public String output(StringBuilder out, SubFunctionRenderer subFunctionRenderer) { out.append("<<\n/FunctionType " + functionType + "\n"); outputDomain(out); if (this.functionType == 0) { diff --git a/src/java/org/apache/fop/render/ps/svg/PSSVGGraphics2D.java b/src/java/org/apache/fop/render/ps/svg/PSSVGGraphics2D.java index b8ddc20d8..a89b16bde 100644 --- a/src/java/org/apache/fop/render/ps/svg/PSSVGGraphics2D.java +++ b/src/java/org/apache/fop/render/ps/svg/PSSVGGraphics2D.java @@ -121,7 +121,7 @@ public class PSSVGGraphics2D extends PSGraphics2D { return p.toString(); } - private void outputShading(StringBuilder p, Shading shading) { + private void outputShading(StringBuilder out, Shading shading) { final Function function = shading.getFunction(); Shading.FunctionRenderer functionRenderer = new Shading.FunctionRenderer() { @@ -131,13 +131,13 @@ public class PSSVGGraphics2D extends PSGraphics2D { public void outputFunction(StringBuilder out, int functionIndex) { Function subFunction = function.getFunctions().get(functionIndex); assert subFunction.getFunctions().isEmpty(); - out.append(subFunction.toWriteableString(null)); + subFunction.output(out, null); } }; - out.append(function.toWriteableString(subFunctionRenderer)); + function.output(out, subFunctionRenderer); } }; - shading.output(p, functionRenderer); + shading.output(out, functionRenderer); } protected AffineTransform getBaseTransform() { |