Author: fanningpj
Date: Sat Aug 13 15:32:03 2022
New Revision: 1903394

URL: http://svn.apache.org/viewvc?rev=1903394&view=rev
Log:
[bug-66212] try to remove package part for table when removing table

Modified:
    
poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
    poi/trunk/src/resources/ooxml-lite-report.clazz

Modified: 
poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
URL: 
http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java?rev=1903394&r1=1903393&r2=1903394&view=diff
==============================================================================
--- 
poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java 
(original)
+++ 
poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java 
Sat Aug 13 15:32:03 2022
@@ -36,10 +36,7 @@ import org.apache.poi.ooxml.POIXMLDocume
 import org.apache.poi.ooxml.POIXMLException;
 import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 import org.apache.poi.openxml4j.exceptions.PartAlreadyExistsException;
-import org.apache.poi.openxml4j.opc.PackagePart;
-import org.apache.poi.openxml4j.opc.PackageRelationship;
-import org.apache.poi.openxml4j.opc.PackageRelationshipCollection;
-import org.apache.poi.openxml4j.opc.TargetMode;
+import org.apache.poi.openxml4j.opc.*;
 import org.apache.poi.poifs.crypt.HashAlgorithm;
 import org.apache.poi.ss.SpreadsheetVersion;
 import org.apache.poi.ss.formula.FormulaShifter;
@@ -4315,6 +4312,11 @@ public class XSSFSheet extends POIXMLDoc
             removeRelation(getRelationById(toDelete.getKey()), true);
             tables.remove(toDelete.getKey());
             toDelete.getValue().onTableDelete();
+            OPCPackage opcPackage = getWorkbook().getPackage();
+            PackagePart packagePart = t.getPackagePart();
+            if (packagePart != null && 
opcPackage.containPart(packagePart.getPartName())) {
+                opcPackage.removePart(packagePart);
+            }
         }
     }
 

Modified: poi/trunk/src/resources/ooxml-lite-report.clazz
URL: 
http://svn.apache.org/viewvc/poi/trunk/src/resources/ooxml-lite-report.clazz?rev=1903394&r1=1903393&r2=1903394&view=diff
==============================================================================
--- poi/trunk/src/resources/ooxml-lite-report.clazz (original)
+++ poi/trunk/src/resources/ooxml-lite-report.clazz Sat Aug 13 15:32:03 2022
@@ -2504,3 +2504,12 @@ com/microsoft/schemas/office/drawing/x20
 com/microsoft/schemas/office/drawing/x2008/diagram/impl/CTShapeImpl
 com/microsoft/schemas/office/drawing/x2008/diagram/impl/CTShapeNonVisualImpl
 com/microsoft/schemas/office/drawing/x2008/diagram/CTShapeNonVisual
+org/openxmlformats/schemas/drawingml/x2006/chart/impl/CTBubbleChartImpl
+org/openxmlformats/schemas/drawingml/x2006/chart/CTBubbleChart
+org/openxmlformats/schemas/drawingml/x2006/chart/CTBubbleSer
+org/openxmlformats/schemas/drawingml/x2006/chart/impl/CTBubbleSerImpl
+org/openxmlformats/schemas/drawingml/x2006/chart/impl/CTDLblPosImpl
+org/openxmlformats/schemas/drawingml/x2006/chart/CTDLblPos
+org/openxmlformats/schemas/drawingml/x2006/chart/STDLblPos$Enum
+org/openxmlformats/schemas/drawingml/x2006/chart/impl/STDLblPosImpl
+org/openxmlformats/schemas/drawingml/x2006/chart/STDLblPos



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

Reply via email to