Ignore:
Timestamp:
Dec 30, 2009, 7:13:45 PM (12 years ago)
Author:
rbri
Message:

PDF plugin: Poppler library updated to version 0.12.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/poppler/mypoppler/poppler/Page.cc

    r261 r277  
    1616// Copyright (C) 2005 Kristian HÞgsberg <krh@redhat.com>
    1717// Copyright (C) 2005 Jeff Muizelaar <jeff@infidigm.net>
    18 // Copyright (C) 2005-2008 Albert Astals Cid <aacid@kde.org>
     18// Copyright (C) 2005-2009 Albert Astals Cid <aacid@kde.org>
    1919// Copyright (C) 2006-2008 Pino Toscano <pino@kde.org>
    2020// Copyright (C) 2006 Nickolay V. Shmyrev <nshmyrev@yandex.ru>
    2121// Copyright (C) 2006 Scott Turner <scotty1024@mac.com>
    22 // Copyright (C) 2006-2008 Carlos Garcia Campos <carlosgc@gnome.org>
     22// Copyright (C) 2006-2009 Carlos Garcia Campos <carlosgc@gnome.org>
    2323// Copyright (C) 2007 Julien Rebetez <julienr@svn.gnome.org>
    2424// Copyright (C) 2008 Iñigo Martínez <inigomartinez@gmail.com>
     
    253253//------------------------------------------------------------------------
    254254
    255 Page::Page(XRef *xrefA, int numA, Dict *pageDict, PageAttrs *attrsA, Form *form) {
     255Page::Page(XRef *xrefA, int numA, Dict *pageDict, Ref pageRefA, PageAttrs *attrsA, Form *form) {
    256256  Object tmp;
    257257       
     
    262262  pageWidgets = NULL;
    263263
     264  pageObj.initDict(pageDict);
     265  pageRef = pageRefA;
     266
    264267  // get attributes
    265268  attrs = attrsA;
     
    267270  // transtion
    268271  pageDict->lookupNF("Trans", &trans);
    269   if (!(trans.isDict() || trans.isNull())) {
     272  if (!(trans.isRef() || trans.isDict() || trans.isNull())) {
    270273    error(-1, "Page transition object (page %d) is wrong type (%s)",
    271274          num, trans.getTypeName());
     
    335338  delete pageWidgets;
    336339  delete attrs;
     340  pageObj.free();
    337341  annots.free();
    338342  contents.free();
     
    349353  obj.free();
    350354  return annots;
     355}
     356
     357void Page::addAnnot(Annot *annot) {
     358  Object obj1;
     359  Object tmp;
     360  Ref annotRef = annot->getRef ();
     361
     362  if (annots.isNull()) {
     363    Ref annotsRef;
     364    // page doesn't have annots array,
     365    // we have to create it
     366
     367    obj1.initArray(xref);
     368    obj1.arrayAdd(tmp.initRef (annotRef.num, annotRef.gen));
     369    tmp.free();
     370
     371    annotsRef = xref->addIndirectObject (&obj1);
     372    annots.initRef(annotsRef.num, annotsRef.gen);
     373    pageObj.dictSet ("Annots", &annots);
     374    xref->setModifiedObject (&pageObj, pageRef);
     375  } else {
     376    getAnnots(&obj1);
     377    if (obj1.isArray()) {
     378      obj1.arrayAdd (tmp.initRef (annotRef.num, annotRef.gen));
     379      xref->setModifiedObject (&obj1, annots.getRef());
     380    }
     381    obj1.free();
     382  }
    351383}
    352384
     
    523555    dict->lookup ("CS", &obj1);
    524556  }
    525   colorSpace = GfxColorSpace::parse(&obj1);
     557  colorSpace = GfxColorSpace::parse(&obj1, NULL);
    526558  obj1.free();
    527559  if (!colorSpace) {
     
    564596    }
    565597    *data_out = pixbufdata;
     598    imgstr->close();
    566599    delete imgstr;
    567600  }
Note: See TracChangeset for help on using the changeset viewer.