summaryrefslogtreecommitdiff
path: root/qt4
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2011-03-01 10:56:40 +0100
committerCarlos Garcia Campos <carlosgc@gnome.org>2011-03-01 12:32:24 +0100
commit664865a2ddca9c20ac36a41aef52ebf12eab838d (patch)
tree35b8e56ca44eec26ae566696284754e4d3e9c4fd /qt4
parent1f6573e949aaba0eb0a4c2f9cd73d7ad45ba67be (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')
-rw-r--r--qt4/src/poppler-link-extractor-private.h2
-rw-r--r--qt4/src/poppler-link-extractor.cc3
-rw-r--r--qt4/src/poppler-page.cc12
3 files changed, 8 insertions, 9 deletions
diff --git a/qt4/src/poppler-link-extractor-private.h b/qt4/src/poppler-link-extractor-private.h
index 284f33cd..234ff6be 100644
--- a/qt4/src/poppler-link-extractor-private.h
+++ b/qt4/src/poppler-link-extractor-private.h
@@ -40,7 +40,7 @@ class LinkExtractorOutputDev : public OutputDev
virtual GBool upsideDown() { return gFalse; }
virtual GBool useDrawChar() { return gFalse; }
virtual GBool interpretType3Chars() { return gFalse; }
- virtual void processLink(::Link *link, Catalog *catalog);
+ virtual void processLink(::AnnotLink *link, Catalog *catalog);
// our stuff
QList< Link* > links();
diff --git a/qt4/src/poppler-link-extractor.cc b/qt4/src/poppler-link-extractor.cc
index e9806b59..f10a16a3 100644
--- a/qt4/src/poppler-link-extractor.cc
+++ b/qt4/src/poppler-link-extractor.cc
@@ -23,6 +23,7 @@
#include <Link.h>
#include <Object.h>
#include <Page.h>
+#include <Annot.h>
#include "poppler-qt4.h"
#include "poppler-page-private.h"
@@ -48,7 +49,7 @@ LinkExtractorOutputDev::~LinkExtractorOutputDev()
qDeleteAll(m_links);
}
-void LinkExtractorOutputDev::processLink(::Link *link, Catalog *catalog)
+void LinkExtractorOutputDev::processLink(::AnnotLink *link, Catalog *catalog)
{
if (!link->isOk())
return;
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;
}