https://bz.apache.org/bugzilla/show_bug.cgi?id=65120
Bug ID: 65120
Summary: [PATCH] PartAlreadyExistsException when creating cell
comments
Product: POI
Version: 4.1.2-FINAL
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: XSSF
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
When creating a new VML drawing (as part of creating a cell comment), the
number assigned to the part file only takes the current number of parts into
account, but this "ID" might already been taken if one of the parts has been
previously removed (i.e. by deleting a sheet).
org.apache.poi.openxml4j.exceptions.PartAlreadyExistsException: A part with the
name '/xl/drawings/vmlDrawing2.vml' already exists : Packages shall not contain
equivalent part names and package implementers shall neither create nor
recognize packages with equivalent part names. [M1.12]
at
org.apache.poi.openxml4j.opc.OPCPackage.createPart(OPCPackage.java:840)
at
org.apache.poi.openxml4j.opc.OPCPackage.createPart(OPCPackage.java:803)
at
org.apache.poi.ooxml.POIXMLDocumentPart.createRelationship(POIXMLDocumentPart.java:586)
at
org.apache.poi.xssf.usermodel.XSSFSheet.getVMLDrawing(XSSFSheet.java:606)
at
org.apache.poi.xssf.usermodel.XSSFDrawing.createCellComment(XSSFDrawing.java:371)
at
org.apache.poi.xssf.usermodel.XSSFDrawing.createCellComment(XSSFDrawing.java:78)
When assigning the number to a new part, it must be checked for uniqueness.
The attached patch uses the same solution in the XSSFSheet.getVMLDrawing()
method as already implemented in XSSFSheet.createDrawingPatriarch().
--
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]