naruto-lgtm commented on code in PR #1571:
URL: https://github.com/apache/poi/pull/1571#discussion_r4662933126


##########
poi-ooxml/src/test/java/org/apache/poi/xslf/usermodel/TestXSLFGraphicFrame.java:
##########
@@ -17,13 +17,85 @@ Licensed to the Apache Software Foundation (ASF) under one 
or more
 package org.apache.poi.xslf.usermodel;
 
 import org.junit.jupiter.api.Test;
+import 
org.openxmlformats.schemas.presentationml.x2006.main.CTGraphicalObjectFrame;
+
 import java.io.IOException;
+import java.util.regex.Pattern;
 
 import static org.junit.jupiter.api.Assertions.*;
 import static org.apache.poi.xslf.XSLFTestDataSamples.openSampleDocument;
+import static org.apache.poi.xslf.XSLFTestDataSamples.writeOutAndReadBack;
 
 class TestXSLFGraphicFrame {
 
+    /**
+     * Removing the frame of a chart, an embedded object or a diagram also 
removes the parts
+     * only it used, so the chart data, embedded documents, etc. aren't 
written out anymore.
+     */
+    @Test
+    void testRemoveGraphicFrameRemovesParts() throws IOException {
+        try (XMLSlideShow ppt = openSampleDocument("pie-chart.pptx")) {
+            XSLFSlide slide = ppt.getSlides().get(0);
+            assertTrue(slide.removeShape(findFrame(slide)));
+            assertTrue(ppt.getCharts().isEmpty());

Review Comment:
   Switched the chart and part list checks to assertThat(..., empty()) and 
added the createChart and duplicated SmartArt cases.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to