exclude '**/BaseTestCellUtil.class'
exclude '**/TestUnfixedBugs.class'
exclude '**/TestOneFile.class'
+ include '**/TestXSSFSheet.class'
// Exclude Test Suites
exclude '**/All*Tests.class'
CTLegacyDrawing ctDrawing = getCTLegacyDrawing();
if(ctDrawing == null) {
if(autoCreate) {
- //drawingNumber = #drawings.size() + 1
- int drawingNumber = getPackagePart().getPackage().getPartsByContentType(XSSFRelation.VML_DRAWINGS.getContentType()).size() + 1;
+ int drawingNumber = getNextPartNumber(XSSFRelation.VML_DRAWINGS,
+ getPackagePart().getPackage().getPartsByContentType(XSSFRelation.VML_DRAWINGS.getContentType()).size());
RelationPart rp = createRelationship(XSSFRelation.VML_DRAWINGS, XSSFFactory.getInstance(), drawingNumber, false);
drawing = rp.getDocumentPart();
String relId = rp.getRelationship().getId();
*/
@Test
void testInsertCommentsToClonedSheet() throws IOException {
- try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("52425.xlsx")) {
+ try (Workbook wb = XSSFTestDataSamples.openSampleWorkbook("52425.xlsx")) {
CreationHelper helper = wb.getCreationHelper();
Sheet sheet2 = wb.createSheet("Sheet 2");
Sheet sheet3 = wb.cloneSheet(0);
}
}
}
+
+ @Test
+ public void bug65120() throws IOException {
+ XSSFWorkbook wb = new XSSFWorkbook();
+ CreationHelper creationHelper = wb.getCreationHelper();
+
+ Sheet sheet1 = wb.createSheet();
+ Cell cell1 = sheet1.createRow(0).createCell(0);
+ Comment comment1 = sheet1.createDrawingPatriarch().createCellComment(creationHelper.createClientAnchor());
+ cell1.setCellComment(comment1);
+
+ Sheet sheet2 = wb.createSheet();
+ Cell cell2 = sheet2.createRow(0).createCell(0);
+ Comment comment2 = sheet2.createDrawingPatriarch().createCellComment(creationHelper.createClientAnchor());
+ cell2.setCellComment(comment2);
+
+ wb.removeSheetAt(0);
+
+ Sheet sheet3 = wb.createSheet();
+ Cell cell3 = sheet3.createRow(0).createCell(0);
+ Comment comment3 = sheet3.createDrawingPatriarch().createCellComment(creationHelper.createClientAnchor());
+ cell3.setCellComment(comment3);
+
+ wb.close();
+ }
}