mirror of
https://github.com/apache/poi.git
synced 2026-02-27 20:40:08 +08:00
test that original slide is not modified
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1903438 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0f45464494
commit
3a42bc3247
@ -220,6 +220,23 @@ class TestXSLFShape {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
XSLFSlide ppt2Slide0 = ppt2.getSlides().get(0);
|
||||||
|
int shapeNumber = 0;
|
||||||
|
for (XSLFShape shape : ppt2Slide0.getShapes()) {
|
||||||
|
if (shape instanceof XSLFTextShape) {
|
||||||
|
XSLFTextShape textShape = (XSLFTextShape) shape;
|
||||||
|
List<XSLFTextParagraph> textBoxParagraphs = textShape.getTextParagraphs();
|
||||||
|
List<XSLFTextRun> textBoxParagraphTextRuns = textBoxParagraphs.stream()
|
||||||
|
.map(XSLFTextParagraph::getTextRuns)
|
||||||
|
.flatMap(List::stream)
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
assertEquals(1, textBoxParagraphTextRuns.size());
|
||||||
|
String expected = shapeNumber == 0 ? "Learning PPTX" : "Cloud";
|
||||||
|
assertEquals(expected, textBoxParagraphTextRuns.get(0).getRawText());
|
||||||
|
}
|
||||||
|
shapeNumber++;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user