From d3de3636cfb3b6ae89b64069292b515bd2702a96 Mon Sep 17 00:00:00 2001 From: Andreas Beeker Date: Sat, 21 Mar 2020 18:25:38 +0000 Subject: #64241 - XSLF - Wrong scheme colors used when rendering git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1875499 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/poi/sl/draw/DrawSimpleShape.java | 4 +--- src/java/org/apache/poi/sl/draw/DrawTextParagraph.java | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'src/java/org/apache/poi/sl') diff --git a/src/java/org/apache/poi/sl/draw/DrawSimpleShape.java b/src/java/org/apache/poi/sl/draw/DrawSimpleShape.java index cc50ed737c..98e8286be8 100644 --- a/src/java/org/apache/poi/sl/draw/DrawSimpleShape.java +++ b/src/java/org/apache/poi/sl/draw/DrawSimpleShape.java @@ -139,13 +139,11 @@ public class DrawSimpleShape extends DrawShape { } protected Paint getFillPaint(Graphics2D graphics) { - final PaintStyle ps = getShape().getFillStyle().getPaint(); DrawPaint drawPaint = DrawFactory.getInstance(graphics).getPaint(getShape()); - return drawPaint.getPaint(graphics, ps); + return drawPaint.getPaint(graphics, getShape().getFillStyle().getPaint()); } protected Paint getLinePaint(Graphics2D graphics) { - final PaintStyle ps = getShape().getFillStyle().getPaint(); DrawPaint drawPaint = DrawFactory.getInstance(graphics).getPaint(getShape()); return drawPaint.getPaint(graphics, getShape().getStrokeStyle().getPaint()); } diff --git a/src/java/org/apache/poi/sl/draw/DrawTextParagraph.java b/src/java/org/apache/poi/sl/draw/DrawTextParagraph.java index c1de9c90e1..c68eb44e0e 100644 --- a/src/java/org/apache/poi/sl/draw/DrawTextParagraph.java +++ b/src/java/org/apache/poi/sl/draw/DrawTextParagraph.java @@ -568,7 +568,7 @@ public class DrawTextParagraph implements Drawable { text = new StringBuilder(); } - PlaceableShape ps = getParagraphShape(); + final DrawPaint dp = new DrawPaint(getParagraphShape()); DrawFontManager dfm = DrawFactory.getInstance(graphics).getFontManager(graphics); assert(dfm != null); @@ -587,7 +587,7 @@ public class DrawTextParagraph implements Drawable { int endIndex = text.length(); PaintStyle fgPaintStyle = run.getFontColor(); - Paint fgPaint = new DrawPaint(ps).getPaint(graphics, fgPaintStyle); + Paint fgPaint = dp.getPaint(graphics, fgPaintStyle); attList.add(new AttributedStringData(TextAttribute.FOREGROUND, fgPaint, beginIndex, endIndex)); Double fontSz = run.getFontSize(); -- cgit v1.2.3