diff options
author | Remi Cohen-Scali <rcoscali@cvs.gnome.org> | 2004-01-12 19:29:45 (GMT) |
---|---|---|
committer | RĂ©mi Cohen-Scali <rcoscali@src.gnome.org> | 2004-01-12 19:29:45 (GMT) |
commit | 8122abe385056ddfb68c622d12687ba9d9ed3a21 (patch) | |
tree | 5925cd1afe4ec1ff865d2c2d4d48569d72269ae5 /pdf/xpdf | |
parent | 69f875f6b8f0cf7313c257ac0729087530397acc (diff) |
:Annot): Extended Annot object to read several kind of annotations. Some
2004-01-12 Remi Cohen-Scali <rcoscali@cvs.gnome.org>
* xpdf/Annot.cc (Annot::Annot): Extended Annot
object to read several kind of annotations.
Some more work (in coord with xpdf) is needed...
(Annots::Annots): Same extensions on annotations
collection object.
Diffstat (limited to 'pdf/xpdf')
-rw-r--r-- | pdf/xpdf/Annot.cc | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/pdf/xpdf/Annot.cc b/pdf/xpdf/Annot.cc index 68373f9..20fe24b 100644 --- a/pdf/xpdf/Annot.cc +++ b/pdf/xpdf/Annot.cc @@ -21,15 +21,18 @@ // Annot //------------------------------------------------------------------------ -Annot::Annot(XRef *xrefA, Dict *dict) { +Annot::Annot(XRef *xrefA, Dict *dictA) { Object apObj, asObj, obj1, obj2; double t; ok = gFalse; xref = xrefA; + dict = dictA; + dict->incRef(); - if (dict->lookup("AP", &apObj)->isDict()) { - if (dict->lookup("AS", &asObj)->isName()) { + dictA->lookup("Subtype", &subtype); + if (dictA->lookup("AP", &apObj)->isDict()) { + if (dictA->lookup("AS", &asObj)->isName()) { if (apObj.dictLookup("N", &obj1)->isDict()) { if (obj1.dictLookupNF(asObj.getName(), &obj2)->isRef()) { obj2.copy(&appearance); @@ -49,7 +52,7 @@ Annot::Annot(XRef *xrefA, Dict *dict) { } apObj.free(); - if (dict->lookup("Rect", &obj1)->isArray() && + if (dictA->lookup("Rect", &obj1)->isArray() && obj1.arrayGetLength() == 4) { //~ should check object types here obj1.arrayGet(0, &obj2); @@ -109,18 +112,15 @@ Annots::Annots(XRef *xref, Object *annotsObj) { for (i = 0; i < annotsObj->arrayGetLength(); ++i) { if (annotsObj->arrayGet(i, &obj1)->isDict()) { obj1.dictLookup("Subtype", &obj2); - if (obj2.isName("Widget") || - obj2.isName("Stamp")) { - annot = new Annot(xref, obj1.getDict()); - if (annot->isOk()) { - if (nAnnots >= size) { - size += 16; - annots = (Annot **)grealloc(annots, size * sizeof(Annot *)); - } - annots[nAnnots++] = annot; - } else { - delete annot; - } + annot = new Annot(xref, obj1.getDict()); + if (annot->isOk()) { + if (nAnnots >= size) { + size += 16; + annots = (Annot **)grealloc(annots, size * sizeof(Annot *)); + } + annots[nAnnots++] = annot; + } else { + delete annot; } obj2.free(); } |