use of org.apache.poi.ddf.EscherBSERecord in project poi by apache.
the class HSSFComment method resetBackgroundImage.
public void resetBackgroundImage() {
EscherSimpleProperty property = getOptRecord().lookup(EscherProperties.FILL__PATTERNTEXTURE);
if (null != property) {
EscherBSERecord bse = getPatriarch().getSheet().getWorkbook().getWorkbook().getBSERecord(property.getPropertyValue());
bse.setRef(bse.getRef() - 1);
getOptRecord().removeEscherProperty(EscherProperties.FILL__PATTERNTEXTURE);
}
setPropertyValue(new EscherSimpleProperty(EscherProperties.FILL__FILLTYPE, false, false, FILL_TYPE_SOLID));
}
use of org.apache.poi.ddf.EscherBSERecord in project poi by apache.
the class HSSFPicture method getPictureData.
/**
* Return picture data for this shape
*
* @return picture data for this shape or {@code null} if picture wasn't embedded, i.e. external linked
*/
@Override
public HSSFPictureData getPictureData() {
int picIdx = getPictureIndex();
if (picIdx == -1) {
return null;
}
HSSFPatriarch patriarch = getPatriarch();
HSSFShape parent = getParent();
while (patriarch == null && parent != null) {
patriarch = parent.getPatriarch();
parent = parent.getParent();
}
if (patriarch == null) {
throw new IllegalStateException("Could not find a patriarch for a HSSPicture");
}
InternalWorkbook iwb = patriarch.getSheet().getWorkbook().getWorkbook();
EscherBSERecord bse = iwb.getBSERecord(picIdx);
EscherBlipRecord blipRecord = bse.getBlipRecord();
return new HSSFPictureData(blipRecord);
}
use of org.apache.poi.ddf.EscherBSERecord 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