use of org.apache.poi.hssf.record.EscherAggregate in project poi by apache.
the class TestHSSFComment method initState.
@Test
public void initState() throws IOException {
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sh = wb.createSheet();
HSSFPatriarch patriarch = sh.createDrawingPatriarch();
EscherAggregate agg = HSSFTestHelper.getEscherAggregate(patriarch);
assertEquals(agg.getTailRecords().size(), 0);
HSSFComment comment = patriarch.createCellComment(new HSSFClientAnchor());
assertEquals(agg.getTailRecords().size(), 1);
HSSFSimpleShape shape = patriarch.createSimpleShape(new HSSFClientAnchor());
assertNotNull(shape);
assertEquals(comment.getOptRecord().getEscherProperties().size(), 10);
wb.close();
}
use of org.apache.poi.hssf.record.EscherAggregate in project poi by apache.
the class HSSFPicture method afterInsert.
@Override
void afterInsert(HSSFPatriarch patriarch) {
EscherAggregate agg = patriarch.getBoundAggregate();
agg.associateShapeToObjRecord(getEscherContainer().getChildById(EscherClientDataRecord.RECORD_ID), getObjRecord());
if (getPictureIndex() != -1) {
EscherBSERecord bse = patriarch.getSheet().getWorkbook().getWorkbook().getBSERecord(getPictureIndex());
bse.setRef(bse.getRef() + 1);
}
}
Aggregations