use of org.apache.poi.ddf.EscherSpRecord in project poi by apache.
the class TestHSSFComment method shapeId.
@Test
public void shapeId() throws IOException {
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sh = wb.createSheet();
HSSFPatriarch patriarch = sh.createDrawingPatriarch();
HSSFComment comment = patriarch.createCellComment(new HSSFClientAnchor());
comment.setShapeId(2024);
assertEquals(comment.getShapeId(), 2024);
CommonObjectDataSubRecord cod = (CommonObjectDataSubRecord) comment.getObjRecord().getSubRecords().get(0);
assertEquals(2024, cod.getObjectId());
EscherSpRecord spRecord = (EscherSpRecord) comment.getEscherContainer().getChild(0);
assertEquals(2024, spRecord.getShapeId(), 2024);
assertEquals(2024, comment.getShapeId(), 2024);
assertEquals(2024, comment.getNoteRecord().getShapeId());
wb.close();
}
Aggregations