diff --git a/poi-ooxml/src/main/java/org/apache/poi/xslf/model/CharacterPropertyFetcher.java b/poi-ooxml/src/main/java/org/apache/poi/xslf/model/CharacterPropertyFetcher.java index 0ad4ef8743..9443580496 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xslf/model/CharacterPropertyFetcher.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xslf/model/CharacterPropertyFetcher.java @@ -62,9 +62,9 @@ public final class CharacterPropertyFetcher extends PropertyFetcher { public T fetchProperty(XSLFShape shape) { final XSLFSheet sheet = shape.getSheet(); + fetchRunProp(); if (!(sheet instanceof XSLFSlideMaster)) { - fetchRunProp(); fetchParagraphDefaultRunProp(); fetchShapeProp(shape); fetchThemeProp(shape); diff --git a/poi-ooxml/src/main/java/org/apache/poi/xslf/model/ParagraphPropertyFetcher.java b/poi-ooxml/src/main/java/org/apache/poi/xslf/model/ParagraphPropertyFetcher.java index 7cce4c64a7..eabe75df11 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xslf/model/ParagraphPropertyFetcher.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xslf/model/ParagraphPropertyFetcher.java @@ -72,8 +72,9 @@ public final class ParagraphPropertyFetcher extends PropertyFetcher { public T fetchProperty(XSLFShape shape) { final XSLFSheet sheet = shape.getSheet(); + fetchParagraphProp(); + if (!(sheet instanceof XSLFSlideMaster)) { - fetchParagraphProp(); fetchShapeProp(shape); fetchThemeProp(shape); } diff --git a/poi-ooxml/src/test/java/org/apache/poi/xslf/TestXSLFBugs.java b/poi-ooxml/src/test/java/org/apache/poi/xslf/TestXSLFBugs.java index c21d24f513..80ebf05556 100644 --- a/poi-ooxml/src/test/java/org/apache/poi/xslf/TestXSLFBugs.java +++ b/poi-ooxml/src/test/java/org/apache/poi/xslf/TestXSLFBugs.java @@ -71,6 +71,7 @@ import org.apache.poi.sl.usermodel.ShapeType; import org.apache.poi.sl.usermodel.Slide; import org.apache.poi.sl.usermodel.SlideShow; import org.apache.poi.sl.usermodel.SlideShowFactory; +import org.apache.poi.sl.usermodel.TextParagraph; import org.apache.poi.sl.usermodel.TextRun; import org.apache.poi.sl.usermodel.TextShape; import org.apache.poi.sl.usermodel.VerticalAlignment; @@ -1063,4 +1064,18 @@ class TestXSLFBugs { targetPresentation.write(new UnsynchronizedByteArrayOutputStream()); } } + + @Test + public void bug65551() throws IOException { + try (XMLSlideShow ppt = openSampleDocument("bug65551.pptx")) { + XSLFTextShape shape = (XSLFTextShape)ppt.getSlideMasters().get(0).getShapes().get(1); + XSLFTextParagraph tp = shape.getTextParagraphs().get(0); + assertEquals(TextParagraph.TextAlign.RIGHT, tp.getTextAlign()); + XSLFTextRun tr = tp.getTextRuns().get(0); + PaintStyle fc = tr.getFontColor(); + assertTrue(fc instanceof SolidPaint); + SolidPaint sp = (SolidPaint)fc; + assertEquals(Color.RED, sp.getSolidColor().getColor()); + } + } } diff --git a/test-data/slideshow/bug65551.pptx b/test-data/slideshow/bug65551.pptx new file mode 100644 index 0000000000..f0baa5b3ee Binary files /dev/null and b/test-data/slideshow/bug65551.pptx differ