diff options
author | Carlos Garcia Campos <carlosgc@gnome.org> | 2011-03-01 10:56:40 +0100 |
---|---|---|
committer | Carlos Garcia Campos <carlosgc@gnome.org> | 2011-03-01 12:32:24 +0100 |
commit | 664865a2ddca9c20ac36a41aef52ebf12eab838d (patch) | |
tree | 35b8e56ca44eec26ae566696284754e4d3e9c4fd /qt4/src/poppler-page.cc | |
parent | 1f6573e949aaba0eb0a4c2f9cd73d7ad45ba67be (diff) |
Merge Link and AnnotLink code
Annotations now belong to the Page and are created only once on demand.
Annots are now ref counted and Links is a list of AnnotLink objects,
Link object has been removed. The AnnotLink API is mostly the same than
Link and frontends APIs are not affected.
Qt4 changes made by Pino Toscano.
Diffstat (limited to 'qt4/src/poppler-page.cc')
-rw-r--r-- | qt4/src/poppler-page.cc | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/qt4/src/poppler-page.cc b/qt4/src/poppler-page.cc index b0821cbc..3ca8c075 100644 --- a/qt4/src/poppler-page.cc +++ b/qt4/src/poppler-page.cc @@ -558,7 +558,6 @@ QList<Annotation*> Page::annotations() const const uint numAnnotations = annots->getNumAnnots(); if ( numAnnotations == 0 ) { - delete annots; return QList<Annotation*>(); } @@ -907,11 +906,9 @@ QList<Annotation*> Page::annotations() const // TODO // reading link action - if ( !linkann->getDest()->isNull() ) + if ( linkann->getAction() ) { - ::LinkAction *act = ::LinkAction::parseDest( linkann->getDest() ); - Link * popplerLink = m_page->convertLinkActionToLink( act, QRectF() ); - delete act; + Link * popplerLink = m_page->convertLinkActionToLink( linkann->getAction(), QRectF() ); if ( popplerLink ) { l->setLinkDestination( popplerLink ); @@ -1301,7 +1298,6 @@ QList<Annotation*> Page::annotations() const } } - delete annots; /** 5 - finally RETURN ANNOTATIONS */ return annotationsMap.values(); } @@ -1310,7 +1306,7 @@ QList<FormField*> Page::formFields() const { QList<FormField*> fields; ::Page *p = m_page->page; - ::FormPageWidgets * form = p->getPageWidgets(); + ::FormPageWidgets * form = p->getFormWidgets(m_page->parentDoc->doc->getCatalog()); int formcount = form->getNumWidgets(); for (int i = 0; i < formcount; ++i) { @@ -1343,6 +1339,8 @@ QList<FormField*> Page::formFields() const fields.append(ff); } + delete form; + return fields; } |