use of org.apache.poi.ddf.EscherContainerRecord in project poi by apache.
the class PPDrawing method findInSpContainer.
private StyleTextProp9Atom findInSpContainer(final EscherContainerRecord spContainer) {
HSLFEscherClientDataRecord cldata = spContainer.getChildById(RecordTypes.EscherClientData.typeID);
if (cldata == null) {
return null;
}
DummyPositionSensitiveRecordWithChildren progTags = getChildRecord(cldata.getHSLFChildRecords(), RecordTypes.ProgTags);
if (progTags == null) {
return null;
}
DummyPositionSensitiveRecordWithChildren progBinaryTag = (DummyPositionSensitiveRecordWithChildren) progTags.findFirstOfType(RecordTypes.ProgBinaryTag.typeID);
if (progBinaryTag == null) {
return null;
}
int size = progBinaryTag.getChildRecords().length;
if (2 != size) {
return null;
}
final Record r0 = progBinaryTag.getChildRecords()[0];
final Record r1 = progBinaryTag.getChildRecords()[1];
if (!(r0 instanceof CString)) {
return null;
}
if (!("___PPT9".equals(((CString) r0).getText()))) {
return null;
}
if (!(r1 instanceof BinaryTagDataBlob)) {
return null;
}
final BinaryTagDataBlob blob = (BinaryTagDataBlob) r1;
if (1 != blob.getChildRecords().length) {
return null;
}
return (StyleTextProp9Atom) blob.findFirstOfType(RecordTypes.StyleTextProp9Atom.typeID);
}
use of org.apache.poi.ddf.EscherContainerRecord in project poi by apache.
the class PPDrawing method findInDgContainer.
private EscherTextboxWrapper[] findInDgContainer(final EscherContainerRecord dgContainer) {
final List<EscherTextboxWrapper> found = new LinkedList<EscherTextboxWrapper>();
final EscherContainerRecord spgrContainer = findFirstEscherContainerRecordOfType(RecordTypes.EscherSpgrContainer, dgContainer);
final EscherContainerRecord[] spContainers = findAllEscherContainerRecordOfType(RecordTypes.EscherSpContainer, spgrContainer);
for (EscherContainerRecord spContainer : spContainers) {
EscherSpRecord sp = (EscherSpRecord) findFirstEscherRecordOfType(RecordTypes.EscherSp, spContainer);
EscherTextboxRecord clientTextbox = (EscherTextboxRecord) findFirstEscherRecordOfType(RecordTypes.EscherClientTextbox, spContainer);
if (null == clientTextbox) {
continue;
}
EscherTextboxWrapper w = new EscherTextboxWrapper(clientTextbox);
StyleTextProp9Atom nineAtom = findInSpContainer(spContainer);
w.setStyleTextProp9Atom(nineAtom);
if (null != sp) {
w.setShapeId(sp.getShapeId());
}
found.add(w);
}
return found.toArray(new EscherTextboxWrapper[found.size()]);
}
use of org.apache.poi.ddf.EscherContainerRecord in project poi by apache.
the class PPDrawing method getNumberedListInfo.
public StyleTextProp9Atom[] getNumberedListInfo() {
final List<StyleTextProp9Atom> result = new LinkedList<StyleTextProp9Atom>();
EscherContainerRecord dgContainer = getDgContainer();
final EscherContainerRecord spgrContainer = findFirstEscherContainerRecordOfType(RecordTypes.EscherSpgrContainer, dgContainer);
final EscherContainerRecord[] spContainers = findAllEscherContainerRecordOfType(RecordTypes.EscherSpContainer, spgrContainer);
for (EscherContainerRecord spContainer : spContainers) {
StyleTextProp9Atom prop9 = findInSpContainer(spContainer);
if (prop9 != null) {
result.add(prop9);
}
}
return result.toArray(new StyleTextProp9Atom[result.size()]);
}
Aggregations