Search in sources :

Example 1 with COSUpdateInfo

use of com.tom_roush.pdfbox.cos.COSUpdateInfo in project PdfBox-Android by TomRoush.

the class COSWriter method addObjectToWrite.

private void addObjectToWrite(COSBase object) {
    COSBase actual = object;
    if (actual instanceof COSObject) {
        actual = ((COSObject) actual).getObject();
    }
    if (!writtenObjects.contains(object) && !objectsToWriteSet.contains(object) && !actualsAdded.contains(actual)) {
        COSBase cosBase = null;
        COSObjectKey cosObjectKey = null;
        if (actual != null) {
            cosObjectKey = objectKeys.get(actual);
        }
        if (cosObjectKey != null) {
            cosBase = keyObject.get(cosObjectKey);
        }
        if (actual != null && objectKeys.containsKey(actual) && object instanceof COSUpdateInfo && !((COSUpdateInfo) object).isNeedToBeUpdated() && cosBase instanceof COSUpdateInfo && !((COSUpdateInfo) cosBase).isNeedToBeUpdated()) {
            return;
        }
        objectsToWrite.add(object);
        objectsToWriteSet.add(object);
        if (actual != null) {
            actualsAdded.add(actual);
        }
    }
}
Also used : COSObjectKey(com.tom_roush.pdfbox.cos.COSObjectKey) COSUpdateInfo(com.tom_roush.pdfbox.cos.COSUpdateInfo) COSObject(com.tom_roush.pdfbox.cos.COSObject) COSBase(com.tom_roush.pdfbox.cos.COSBase)

Aggregations

COSBase (com.tom_roush.pdfbox.cos.COSBase)1 COSObject (com.tom_roush.pdfbox.cos.COSObject)1 COSObjectKey (com.tom_roush.pdfbox.cos.COSObjectKey)1 COSUpdateInfo (com.tom_roush.pdfbox.cos.COSUpdateInfo)1