Search in sources :

Example 51 with EscherContainerRecord

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);
}
Also used : EscherSpgrRecord(org.apache.poi.ddf.EscherSpgrRecord) EscherContainerRecord(org.apache.poi.ddf.EscherContainerRecord) EscherTextboxRecord(org.apache.poi.ddf.EscherTextboxRecord) EscherDgRecord(org.apache.poi.ddf.EscherDgRecord) EscherRecord(org.apache.poi.ddf.EscherRecord) EscherSpRecord(org.apache.poi.ddf.EscherSpRecord) EscherOptRecord(org.apache.poi.ddf.EscherOptRecord)

Example 52 with EscherContainerRecord

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()]);
}
Also used : EscherSpRecord(org.apache.poi.ddf.EscherSpRecord) EscherTextboxRecord(org.apache.poi.ddf.EscherTextboxRecord) EscherContainerRecord(org.apache.poi.ddf.EscherContainerRecord) LinkedList(java.util.LinkedList)

Example 53 with EscherContainerRecord

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()]);
}
Also used : EscherContainerRecord(org.apache.poi.ddf.EscherContainerRecord) LinkedList(java.util.LinkedList)

Aggregations

EscherContainerRecord (org.apache.poi.ddf.EscherContainerRecord)53 EscherRecord (org.apache.poi.ddf.EscherRecord)17 EscherSpRecord (org.apache.poi.ddf.EscherSpRecord)17 EscherOptRecord (org.apache.poi.ddf.EscherOptRecord)11 EscherBSERecord (org.apache.poi.ddf.EscherBSERecord)8 EscherSimpleProperty (org.apache.poi.ddf.EscherSimpleProperty)8 AbstractEscherOptRecord (org.apache.poi.ddf.AbstractEscherOptRecord)6 EscherDgRecord (org.apache.poi.ddf.EscherDgRecord)6 DefaultEscherRecordFactory (org.apache.poi.ddf.DefaultEscherRecordFactory)5 ObjRecord (org.apache.poi.hssf.record.ObjRecord)5 EscherDggRecord (org.apache.poi.ddf.EscherDggRecord)4 EscherSpgrRecord (org.apache.poi.ddf.EscherSpgrRecord)4 EscherTextboxRecord (org.apache.poi.ddf.EscherTextboxRecord)4 Document (org.apache.poi.hslf.record.Document)4 PPDrawing (org.apache.poi.hslf.record.PPDrawing)4 LinkedList (java.util.LinkedList)3 EscherBoolProperty (org.apache.poi.ddf.EscherBoolProperty)3 EscherClientDataRecord (org.apache.poi.ddf.EscherClientDataRecord)3 EscherRGBProperty (org.apache.poi.ddf.EscherRGBProperty)3 ExObjRefAtom (org.apache.poi.hslf.record.ExObjRefAtom)3