https://bz.apache.org/bugzilla/show_bug.cgi?id=62591
Bug ID: 62591
Summary: Trivial regression in trunk in isPlaceHolder in newer
sl
Product: POI
Version: 4.0-dev
Hardware: PC
Status: NEW
Severity: trivial
Priority: P2
Component: HSLF
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
In TIKA-712 and TIKA-1171, we tried to ignore placeholder text from master
slides. Three of our unit tests for this fail after upgrading to
4.0.0-SNAPSHOT. slide.isPlaceHolder() is now returning false for some shapes
for which it used to return true. In the few cases I've looked at, it appears
to only be a regression for date and slidenumber placeholders.
With 4.0.0 and the sl framework this code:
@Test
public void masterBoilerplateTest() throws Exception {
try (InputStream is =
getResourceAsStream("/test-documents/testPPT_masterText.ppt")) {
SlideShow slideShow = SlideShowFactory.create(is);
for (Object masterSheetObj : slideShow.getSlideMasters()) {
MasterSheet ms = (MasterSheet)masterSheetObj;
for (Object shape : ms.getShapes()) {
if (shape instanceof TextShape) {
TextShape ts = (TextShape)shape;
System.out.println(ts.getShapeName() + " : "
+ts.isPlaceholder() + " : >"+ts.getText().replaceAll("[\r\n]", "\n")+"<");
}
}
}
}
}
prints out this:
Title Placeholder 1 : true : >Click to edit Master title style<
Text Placeholder 2 : true : >Click to edit Master text styles
Second level
Third level
Fourth level
Fifth level<
Date Placeholder 3 : false : >*<
Footer Placeholder 4 : false : ><
Slide Number Placeholder 5 : false : >*<
TextBox 6 : false : >Text that I added to the master slide<
Title Placeholder 1 : true : >Click to edit Master title style<
Text Placeholder 2 : true : >Click to edit Master text styles
Second level
Third level
Fourth level
Fifth level<
Date Placeholder 3 : false : >*<
Footer Placeholder 4 : false : ><
Slide Number Placeholder 5 : false : >*<
With out older HSLF-specific code, this:
public void masterBoilerplateTest() throws Exception {
try (InputStream is =
getResourceAsStream("/test-documents/testPPT_masterText.ppt")) {
HSLFSlideShow slideShow = new HSLFSlideShow(is);
for (HSLFMasterSheet masterSheet : slideShow.getSlideMasters()) {
for (HSLFShape shape : masterSheet.getShapes()) {
if (shape instanceof TextShape) {
TextShape ts = (TextShape)shape;
System.out.println(shape.getShapeName()+ " : "
+HSLFMasterSheet.isPlaceholder(shape) + " :
>"+ts.getText().replaceAll("[\r\n]", "\n")+"<");
}
}
}
}
}
prints out this:
Rectangle : true : >Click to edit Master title style<
Rectangle : true : >Click to edit Master text styles
Second level
Third level
Fourth level
Fifth level<
Rectangle : true : >*<
Rectangle : true : ><
Rectangle : true : >*<
TextBox : false : >Text that I added to the master slide<
Rectangle : true : >Click to edit Master title style<
Rectangle : true : >Click to edit Master text styles
Second level
Third level
Fourth level
Fifth level<
Rectangle : true : >*<
Rectangle : true : ><
Rectangle : true : >*<
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]