mirror of https://github.com/apache/poi.git
#65551 - Incorrect fetching paragraph and text runs props from master shape
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1894140 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6aa3871e64
commit
db71e2328a
|
@ -62,9 +62,9 @@ public final class CharacterPropertyFetcher<T> extends PropertyFetcher<T> {
|
||||||
public T fetchProperty(XSLFShape shape) {
|
public T fetchProperty(XSLFShape shape) {
|
||||||
final XSLFSheet sheet = shape.getSheet();
|
final XSLFSheet sheet = shape.getSheet();
|
||||||
|
|
||||||
|
fetchRunProp();
|
||||||
|
|
||||||
if (!(sheet instanceof XSLFSlideMaster)) {
|
if (!(sheet instanceof XSLFSlideMaster)) {
|
||||||
fetchRunProp();
|
|
||||||
fetchParagraphDefaultRunProp();
|
fetchParagraphDefaultRunProp();
|
||||||
fetchShapeProp(shape);
|
fetchShapeProp(shape);
|
||||||
fetchThemeProp(shape);
|
fetchThemeProp(shape);
|
||||||
|
|
|
@ -72,8 +72,9 @@ public final class ParagraphPropertyFetcher<T> extends PropertyFetcher<T> {
|
||||||
public T fetchProperty(XSLFShape shape) {
|
public T fetchProperty(XSLFShape shape) {
|
||||||
final XSLFSheet sheet = shape.getSheet();
|
final XSLFSheet sheet = shape.getSheet();
|
||||||
|
|
||||||
|
fetchParagraphProp();
|
||||||
|
|
||||||
if (!(sheet instanceof XSLFSlideMaster)) {
|
if (!(sheet instanceof XSLFSlideMaster)) {
|
||||||
fetchParagraphProp();
|
|
||||||
fetchShapeProp(shape);
|
fetchShapeProp(shape);
|
||||||
fetchThemeProp(shape);
|
fetchThemeProp(shape);
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,6 +71,7 @@ import org.apache.poi.sl.usermodel.ShapeType;
|
||||||
import org.apache.poi.sl.usermodel.Slide;
|
import org.apache.poi.sl.usermodel.Slide;
|
||||||
import org.apache.poi.sl.usermodel.SlideShow;
|
import org.apache.poi.sl.usermodel.SlideShow;
|
||||||
import org.apache.poi.sl.usermodel.SlideShowFactory;
|
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.TextRun;
|
||||||
import org.apache.poi.sl.usermodel.TextShape;
|
import org.apache.poi.sl.usermodel.TextShape;
|
||||||
import org.apache.poi.sl.usermodel.VerticalAlignment;
|
import org.apache.poi.sl.usermodel.VerticalAlignment;
|
||||||
|
@ -1063,4 +1064,18 @@ class TestXSLFBugs {
|
||||||
targetPresentation.write(new UnsynchronizedByteArrayOutputStream());
|
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());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue