import org.openxmlformats.schemas.drawingml.x2006.main.CTPoint2D;\r
import org.openxmlformats.schemas.drawingml.x2006.main.CTPositiveSize2D;\r
import org.openxmlformats.schemas.presentationml.x2006.main.CTConnector;\r
+import org.openxmlformats.schemas.presentationml.x2006.main.CTGraphicalObjectFrame;\r
import org.openxmlformats.schemas.presentationml.x2006.main.CTGroupShape;\r
import org.openxmlformats.schemas.presentationml.x2006.main.CTGroupShapeNonVisual;\r
import org.openxmlformats.schemas.presentationml.x2006.main.CTPicture;\r
grpSp.getGrpSpList().remove(obj);\r
} else if (obj instanceof CTConnector){\r
grpSp.getCxnSpList().remove(obj);\r
+ } else if (obj instanceof CTGraphicalObjectFrame) {\r
+ grpSp.getGraphicFrameList().remove(obj);\r
} else if (obj instanceof CTPicture) {\r
XSLFPictureShape ps = (XSLFPictureShape)xShape;\r
XSLFSheet sh = getSheet();\r
CTGroupShape spTree = getSpTree();
if(obj instanceof CTShape){
spTree.getSpList().remove(obj);
- } else if (obj instanceof CTGroupShape){
+ } else if (obj instanceof CTGroupShape) {
spTree.getGrpSpList().remove(obj);
- } else if (obj instanceof CTConnector){
+ } else if (obj instanceof CTConnector) {
spTree.getCxnSpList().remove(obj);
+ } else if (obj instanceof CTGraphicalObjectFrame) {
+ spTree.getGraphicFrameList().remove(obj);
} else if (obj instanceof CTPicture) {
XSLFPictureShape ps = (XSLFPictureShape)xShape;
removePictureRelation(ps);
package org.apache.poi.xslf.usermodel;\r
\r
import static org.junit.Assert.assertEquals;\r
+import static org.junit.Assert.assertFalse;\r
import static org.junit.Assert.assertNotNull;\r
import static org.junit.Assert.assertNull;\r
import static org.junit.Assert.assertSame;\r
\r
ppt.close();\r
}\r
+ \r
+ @Test\r
+ public void removeTable() throws IOException {\r
+ XMLSlideShow ss = XSLFTestDataSamples.openSampleDocument("shapes.pptx");\r
+ XSLFSlide sl = ss.getSlides().get(0);\r
+ XSLFTable tab = (XSLFTable)sl.getShapes().get(4);\r
+ sl.removeShape(tab);\r
+ \r
+ XMLSlideShow ss2 = XSLFTestDataSamples.writeOutAndReadBack(ss);\r
+ ss.close();\r
+ \r
+ sl = ss2.getSlides().get(0);\r
+ for (XSLFShape s : sl.getShapes()) {\r
+ assertFalse(s instanceof XSLFTable);\r
+ }\r
+ \r
+ ss2.close();\r
+ }\r
}
\ No newline at end of file