[poppler] Branch 'xpdf303merge' - glib/poppler-document.cc glib/poppler-page.cc poppler/FontInfo.cc poppler/OutputDev.h poppler/Page.cc poppler/Page.h poppler/PDFDoc.cc poppler/PSOutputDev.cc poppler/PSOutputDev.h poppler/TextOutputDev.cc poppler/TextOutputDev.h qt4/src utils/HtmlOutputDev.cc utils/HtmlOutputDev.h utils/pdftohtml.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Thu Sep 1 07:12:04 PDT 2011


 glib/poppler-document.cc                 |    2 -
 glib/poppler-page.cc                     |   11 +++------
 poppler/FontInfo.cc                      |    2 -
 poppler/OutputDev.h                      |    4 +--
 poppler/PDFDoc.cc                        |    8 +++---
 poppler/PSOutputDev.cc                   |    6 ++---
 poppler/PSOutputDev.h                    |    2 -
 poppler/Page.cc                          |   36 +++++++++++++++----------------
 poppler/Page.h                           |   16 ++++++-------
 poppler/TextOutputDev.cc                 |    2 -
 poppler/TextOutputDev.h                  |    2 -
 qt4/src/poppler-link-extractor-private.h |    2 -
 qt4/src/poppler-link-extractor.cc        |    4 +--
 qt4/src/poppler-page.cc                  |    4 +--
 utils/HtmlOutputDev.cc                   |    9 ++++---
 utils/HtmlOutputDev.h                    |    7 ++----
 utils/pdftohtml.cc                       |    2 -
 17 files changed, 58 insertions(+), 61 deletions(-)

New commits:
commit 38ebe8c568aafbe5f248f9e0a654f46829e0b659
Author: Albert Astals Cid <aacid at kde.org>
Date:   Thu Sep 1 16:13:53 2011 +0200

    xpdf303: Page functions do not need Catalog * anymore

diff --git a/glib/poppler-document.cc b/glib/poppler-document.cc
index 346b646..121bdac 100644
--- a/glib/poppler-document.cc
+++ b/glib/poppler-document.cc
@@ -2514,7 +2514,7 @@ poppler_document_get_form_field (PopplerDocument *document,
   if (!page)
     return NULL;
 
-  widgets = page->getFormWidgets (document->doc->getCatalog ());
+  widgets = page->getFormWidgets ();
   if (!widgets)
     return NULL;
 
diff --git a/glib/poppler-page.cc b/glib/poppler-page.cc
index d8722fb..7b98625 100644
--- a/glib/poppler-page.cc
+++ b/glib/poppler-page.cc
@@ -270,7 +270,6 @@ poppler_page_get_text_page (PopplerPage *page)
 				gTrue, /* Crop */
 				-1, -1, -1, -1,
 				gFalse, /* printing */
-				page->document->doc->getCatalog (),
 				NULL, NULL, NULL, NULL);
     page->page->display(gfx);
     text_dev->endPage();
@@ -354,7 +353,6 @@ _poppler_page_render (PopplerPage      *page,
 			   -1, -1,
 			   -1, -1,
 			   printing,
-			   page->document->doc->getCatalog (),
 			   NULL, NULL,
 			   printing ? poppler_print_annot_cb : NULL,
                            printing ? GINT_TO_POINTER ((gint)print_flags) : NULL);
@@ -926,7 +924,6 @@ poppler_page_get_image_output_dev (PopplerPage *page,
 			      gTrue, /* Crop */
 			      -1, -1, -1, -1,
 			      gFalse, /* printing */
-			      page->document->doc->getCatalog (),
 			      NULL, NULL, NULL, NULL);
   page->page->display(gfx);
   delete gfx;
@@ -1139,7 +1136,7 @@ poppler_page_get_link_mapping (PopplerPage *page)
   
   g_return_val_if_fail (POPPLER_IS_PAGE (page), NULL);
   
-  links = new Links (page->page->getAnnots (page->document->doc->getCatalog ()));
+  links = new Links (page->page->getAnnots ());
 
   if (links == NULL)
     return NULL;
@@ -1243,7 +1240,7 @@ poppler_page_get_form_field_mapping (PopplerPage *page)
   
   g_return_val_if_fail (POPPLER_IS_PAGE (page), NULL);
 
-  forms = page->page->getFormWidgets (page->document->doc->getCatalog ());
+  forms = page->page->getFormWidgets ();
 
   if (forms == NULL)
     return NULL;
@@ -1310,7 +1307,7 @@ poppler_page_get_annot_mapping (PopplerPage *page)
 
   g_return_val_if_fail (POPPLER_IS_PAGE (page), NULL);
 
-  annots = page->page->getAnnots (page->document->doc->getCatalog ());
+  annots = page->page->getAnnots ();
   if (!annots)
     return NULL;
 
@@ -1427,7 +1424,7 @@ poppler_page_add_annot (PopplerPage  *page,
   g_return_if_fail (POPPLER_IS_PAGE (page));
   g_return_if_fail (POPPLER_IS_ANNOT (annot));
 
-  page->page->addAnnot (annot->annot, page->document->doc->getCatalog ());
+  page->page->addAnnot (annot->annot);
 }
 
 /* PopplerRectangle type */
diff --git a/poppler/FontInfo.cc b/poppler/FontInfo.cc
index 0fd8966..7352ed1 100644
--- a/poppler/FontInfo.cc
+++ b/poppler/FontInfo.cc
@@ -74,7 +74,7 @@ GooList *FontInfoScanner::scan(int nPages) {
     if ((resDict = page->getResourceDict())) {
       scanFonts(resDict, result);
     }
-    annots = page->getAnnots(doc->getCatalog());
+    annots = page->getAnnots();
     for (int i = 0; i < annots->getNumAnnots(); ++i) {
       if (annots->getAnnot(i)->getAppearance(&obj1)->isStream()) {
 	obj1.streamGetDict()->lookup("Resources", &obj2);
diff --git a/poppler/OutputDev.h b/poppler/OutputDev.h
index bf984fc..0ef11ee 100644
--- a/poppler/OutputDev.h
+++ b/poppler/OutputDev.h
@@ -128,7 +128,7 @@ public:
   virtual GBool checkPageSlice(Page *page, double hDPI, double vDPI,
 			       int rotate, GBool useMediaBox, GBool crop,
 			       int sliceX, int sliceY, int sliceW, int sliceH,
-			       GBool printing, Catalog * catalog,
+			       GBool printing,
 			       GBool (* abortCheckCbk)(void *data) = NULL,
 			       void * abortCheckCbkData = NULL)
     { return gTrue; }
@@ -305,7 +305,7 @@ public:
   virtual void clearSoftMask(GfxState * /*state*/) {}
 
   //----- links
-  virtual void processLink(AnnotLink * /*link*/, Catalog * /*catalog*/) {}
+  virtual void processLink(AnnotLink * /*link*/) {}
 
 #if 1 //~tmp: turn off anti-aliasing temporarily
   virtual GBool getVectorAntialias() { return gFalse; }
diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc
index 62039ef..ca5f432 100644
--- a/poppler/PDFDoc.cc
+++ b/poppler/PDFDoc.cc
@@ -431,7 +431,7 @@ void PDFDoc::displayPage(OutputDev *out, int page,
 
   if (getPage(page))
     getPage(page)->display(out, hDPI, vDPI,
-				    rotate, useMediaBox, crop, printing, catalog,
+				    rotate, useMediaBox, crop, printing,
 				    abortCheckCbk, abortCheckCbkData,
 				    annotDisplayDecideCbk, annotDisplayDecideCbkData);
 
@@ -465,7 +465,7 @@ void PDFDoc::displayPageSlice(OutputDev *out, int page,
     getPage(page)->displaySlice(out, hDPI, vDPI,
 					 rotate, useMediaBox, crop,
 					 sliceX, sliceY, sliceW, sliceH,
-					 printing, catalog,
+					 printing,
 					 abortCheckCbk, abortCheckCbkData,
 					 annotDisplayDecideCbk, annotDisplayDecideCbkData);
 }
@@ -475,12 +475,12 @@ Links *PDFDoc::getLinks(int page) {
   if (!p) {
     return new Links (NULL);
   }
-  return p->getLinks(catalog);
+  return p->getLinks();
 }
 
 void PDFDoc::processLinks(OutputDev *out, int page) {
   if (getPage(page))
-    getPage(page)->processLinks(out, catalog);
+    getPage(page)->processLinks(out);
 }
 
 Linearization *PDFDoc::getLinearization()
diff --git a/poppler/PSOutputDev.cc b/poppler/PSOutputDev.cc
index e64f278..0f03c2b 100644
--- a/poppler/PSOutputDev.cc
+++ b/poppler/PSOutputDev.cc
@@ -2980,7 +2980,7 @@ GBool PSOutputDev::checkPageSlice(Page *page, double /*hDPI*/, double /*vDPI*/,
 				  int rotateA, GBool useMediaBox, GBool crop,
 				  int sliceX, int sliceY,
 				  int sliceW, int sliceH,
-				  GBool printing, Catalog *catalog,
+				  GBool printing,
 				  GBool (*abortCheckCbk)(void *data),
 				  void *abortCheckCbkData) {
 #if HAVE_SPLASH
@@ -3008,7 +3008,7 @@ GBool PSOutputDev::checkPageSlice(Page *page, double /*hDPI*/, double /*vDPI*/,
     scan = new PreScanOutputDev(doc);
     page->displaySlice(scan, 72, 72, rotateA, useMediaBox, crop,
                      sliceX, sliceY, sliceW, sliceH,
-                     printing, catalog, abortCheckCbk, abortCheckCbkData);
+                     printing, abortCheckCbk, abortCheckCbkData);
     rasterize = scan->usesTransparency() || scan->hasLevel1PSBug();
     delete scan;
   } else {
@@ -3046,7 +3046,7 @@ GBool PSOutputDev::checkPageSlice(Page *page, double /*hDPI*/, double /*vDPI*/,
   page->displaySlice(splashOut, splashDPI, splashDPI, rotateA,
 		     useMediaBox, crop,
 		     sliceX, sliceY, sliceW, sliceH,
-		     printing, catalog, abortCheckCbk, abortCheckCbkData);
+		     printing, abortCheckCbk, abortCheckCbkData);
 
   // start the PS page
   page->makeBox(splashDPI, splashDPI, rotateA, useMediaBox, gFalse,
diff --git a/poppler/PSOutputDev.h b/poppler/PSOutputDev.h
index 83aeb84..57ede3f 100644
--- a/poppler/PSOutputDev.h
+++ b/poppler/PSOutputDev.h
@@ -163,7 +163,7 @@ public:
   virtual GBool checkPageSlice(Page *page, double hDPI, double vDPI,
 			       int rotate, GBool useMediaBox, GBool crop,
 			       int sliceX, int sliceY, int sliceW, int sliceH,
-			       GBool printing, Catalog *catalog,
+			       GBool printing,
 			       GBool (*abortCheckCbk)(void *data) = NULL,
 			       void *abortCheckCbkData = NULL);
 
diff --git a/poppler/Page.cc b/poppler/Page.cc
index 486ab45..7c48aad 100644
--- a/poppler/Page.cc
+++ b/poppler/Page.cc
@@ -346,17 +346,17 @@ Page::~Page() {
   actions.free();
 }
 
-Annots *Page::getAnnots(Catalog *catalog) {
+Annots *Page::getAnnots() {
   if (!annots) {
     Object obj;
-    annots = new Annots(xref, catalog, getAnnots(&obj));
+    annots = new Annots(xref, doc->getCatalog(), getAnnots(&obj));
     obj.free();
   }
 
   return annots;
 }
 
-void Page::addAnnot(Annot *annot, Catalog *catalog) {
+void Page::addAnnot(Annot *annot) {
   Object obj1;
   Object tmp;
   Ref annotRef = annot->getRef ();
@@ -364,7 +364,7 @@ void Page::addAnnot(Annot *annot, Catalog *catalog) {
   // Make sure we have annots before adding the new one
   // even if it's an empty list so that we can safely
   // call annots->appendAnnot(annot)
-  getAnnots(catalog);
+  getAnnots();
 
   if (annotsObj.isNull()) {
     Ref annotsRef;
@@ -396,22 +396,22 @@ void Page::addAnnot(Annot *annot, Catalog *catalog) {
   annot->setPage(&pageRef, num);
 }
 
-Links *Page::getLinks(Catalog *catalog) {
-  return new Links(getAnnots(catalog));
+Links *Page::getLinks() {
+  return new Links(getAnnots());
 }
 
-FormPageWidgets *Page::getFormWidgets(Catalog *catalog) {
-  return new FormPageWidgets(getAnnots(catalog), num, catalog->getForm());
+FormPageWidgets *Page::getFormWidgets() {
+  return new FormPageWidgets(getAnnots(), num, doc->getCatalog()->getForm());
 }
 
 void Page::display(OutputDev *out, double hDPI, double vDPI,
 		   int rotate, GBool useMediaBox, GBool crop,
-		   GBool printing, Catalog *catalog,
+		   GBool printing,
 		   GBool (*abortCheckCbk)(void *data),
 		   void *abortCheckCbkData,
                    GBool (*annotDisplayDecideCbk)(Annot *annot, void *user_data),
                    void *annotDisplayDecideCbkData) {
-  displaySlice(out, hDPI, vDPI, rotate, useMediaBox, crop, -1, -1, -1, -1, printing, catalog,
+  displaySlice(out, hDPI, vDPI, rotate, useMediaBox, crop, -1, -1, -1, -1, printing,
 	       abortCheckCbk, abortCheckCbkData,
                annotDisplayDecideCbk, annotDisplayDecideCbkData);
 }
@@ -419,7 +419,7 @@ void Page::display(OutputDev *out, double hDPI, double vDPI,
 Gfx *Page::createGfx(OutputDev *out, double hDPI, double vDPI,
 		     int rotate, GBool useMediaBox, GBool crop,
 		     int sliceX, int sliceY, int sliceW, int sliceH,
-		     GBool printing, Catalog *catalog,
+		     GBool printing,
 		     GBool (*abortCheckCbk)(void *data),
 		     void *abortCheckCbkData,
 		     GBool (*annotDisplayDecideCbk)(Annot *annot, void *user_data),
@@ -458,7 +458,7 @@ Gfx *Page::createGfx(OutputDev *out, double hDPI, double vDPI,
 void Page::displaySlice(OutputDev *out, double hDPI, double vDPI,
 			int rotate, GBool useMediaBox, GBool crop,
 			int sliceX, int sliceY, int sliceW, int sliceH,
-			GBool printing, Catalog *catalog,
+			GBool printing,
 			GBool (*abortCheckCbk)(void *data),
 			void *abortCheckCbkData,
                         GBool (*annotDisplayDecideCbk)(Annot *annot, void *user_data),
@@ -470,14 +470,14 @@ void Page::displaySlice(OutputDev *out, double hDPI, double vDPI,
   
   if (!out->checkPageSlice(this, hDPI, vDPI, rotate, useMediaBox, crop,
 			   sliceX, sliceY, sliceW, sliceH,
-			   printing, catalog,
+			   printing,
 			   abortCheckCbk, abortCheckCbkData)) {
     return;
   }
 
   gfx = createGfx(out, hDPI, vDPI, rotate, useMediaBox, crop,
 		  sliceX, sliceY, sliceW, sliceH,
-		  printing, catalog,
+		  printing,
 		  abortCheckCbk, abortCheckCbkData,
 		  annotDisplayDecideCbk, annotDisplayDecideCbkData);
 
@@ -490,7 +490,7 @@ void Page::displaySlice(OutputDev *out, double hDPI, double vDPI,
   obj.free();
 
   // draw annotations
-  annotList = getAnnots(catalog);
+  annotList = getAnnots();
 
   if (annotList->getNumAnnots() > 0) {
     if (globalParams->getPrintCommands()) {
@@ -688,13 +688,13 @@ void Page::makeBox(double hDPI, double vDPI, int rotate,
   }
 }
 
-void Page::processLinks(OutputDev *out, Catalog *catalog) {
+void Page::processLinks(OutputDev *out) {
   Links *links;
   int i;
 
-  links = getLinks(catalog);
+  links = getLinks();
   for (i = 0; i < links->getNumLinks(); ++i) {
-    out->processLink(links->getLink(i), catalog);
+    out->processLink(links->getLink(i));
   }
   delete links;
 }
diff --git a/poppler/Page.h b/poppler/Page.h
index 40e4fdd..f78be70 100644
--- a/poppler/Page.h
+++ b/poppler/Page.h
@@ -166,13 +166,13 @@ public:
   // Get annotations array.
   Object *getAnnots(Object *obj) { return annotsObj.fetch(xref, obj); }
   // Add a new annotation to the page
-  void addAnnot(Annot *annot, Catalog *catalog);
+  void addAnnot(Annot *annot);
 
   // Return a list of links.
-  Links *getLinks(Catalog *catalog);
+  Links *getLinks();
 
   // Return a list of annots. Ownership is transferred to the caller.
-  Annots *getAnnots(Catalog *catalog);
+  Annots *getAnnots();
 
   // Get contents.
   Object *getContents(Object *obj) { return contents.fetch(xref, obj); }
@@ -185,7 +185,7 @@ public:
   Object *getTrans(Object *obj) { return trans.fetch(xref, obj); }
 
   // Get form.
-  FormPageWidgets *getFormWidgets(Catalog *catalog);
+  FormPageWidgets *getFormWidgets();
 
   // Get duration, the maximum length of time, in seconds,
   // that the page is displayed before the presentation automatically
@@ -198,7 +198,7 @@ public:
   Gfx *createGfx(OutputDev *out, double hDPI, double vDPI,
 		 int rotate, GBool useMediaBox, GBool crop,
 		 int sliceX, int sliceY, int sliceW, int sliceH,
-		 GBool printing, Catalog *catalog,
+		 GBool printing,
 		 GBool (*abortCheckCbk)(void *data),
 		 void *abortCheckCbkData,
 		 GBool (*annotDisplayDecideCbk)(Annot *annot, void *user_data),
@@ -207,7 +207,7 @@ public:
   // Display a page.
   void display(OutputDev *out, double hDPI, double vDPI,
 	       int rotate, GBool useMediaBox, GBool crop,
-	       GBool printing, Catalog *catalog,
+	       GBool printing,
 	       GBool (*abortCheckCbk)(void *data) = NULL,
 	       void *abortCheckCbkData = NULL,
                GBool (*annotDisplayDecideCbk)(Annot *annot, void *user_data) = NULL,
@@ -217,7 +217,7 @@ public:
   void displaySlice(OutputDev *out, double hDPI, double vDPI,
 		    int rotate, GBool useMediaBox, GBool crop,
 		    int sliceX, int sliceY, int sliceW, int sliceH,
-		    GBool printing, Catalog *catalog,
+		    GBool printing,
 		    GBool (*abortCheckCbk)(void *data) = NULL,
 		    void *abortCheckCbkData = NULL,
                     GBool (*annotDisplayDecideCbk)(Annot *annot, void *user_data) = NULL,
@@ -230,7 +230,7 @@ public:
 	       double sliceX, double sliceY, double sliceW, double sliceH,
 	       PDFRectangle *box, GBool *crop);
 
-  void processLinks(OutputDev *out, Catalog *catalog);
+  void processLinks(OutputDev *out);
 
   // Get the page's default CTM.
   void getDefaultCTM(double *ctm, double hDPI, double vDPI,
diff --git a/poppler/TextOutputDev.cc b/poppler/TextOutputDev.cc
index 80ab9df..f06ea17 100644
--- a/poppler/TextOutputDev.cc
+++ b/poppler/TextOutputDev.cc
@@ -5351,7 +5351,7 @@ void TextOutputDev::eoFill(GfxState *state) {
   fill(state);
 }
 
-void TextOutputDev::processLink(AnnotLink *link, Catalog * /*catalog*/) {
+void TextOutputDev::processLink(AnnotLink *link) {
   double x1, y1, x2, y2;
   int xMin, yMin, xMax, yMax, x, y;
 
diff --git a/poppler/TextOutputDev.h b/poppler/TextOutputDev.h
index 6c0fa4f..a85f581 100644
--- a/poppler/TextOutputDev.h
+++ b/poppler/TextOutputDev.h
@@ -731,7 +731,7 @@ public:
   virtual void eoFill(GfxState *state);
 
   //----- link borders
-  virtual void processLink(AnnotLink *link, Catalog *catalog);
+  virtual void processLink(AnnotLink *link);
 
   //----- special access
 
diff --git a/qt4/src/poppler-link-extractor-private.h b/qt4/src/poppler-link-extractor-private.h
index 1d6351d..32ddd03 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(::AnnotLink *link, Catalog *catalog);
+    virtual void processLink(::AnnotLink *link);
 
     // our stuff
     QList< Link* > links();
diff --git a/qt4/src/poppler-link-extractor.cc b/qt4/src/poppler-link-extractor.cc
index 91373b2..0b1563b 100644
--- a/qt4/src/poppler-link-extractor.cc
+++ b/qt4/src/poppler-link-extractor.cc
@@ -49,7 +49,7 @@ LinkExtractorOutputDev::~LinkExtractorOutputDev()
   qDeleteAll(m_links);
 }
 
-void LinkExtractorOutputDev::processLink(::AnnotLink *link, Catalog *catalog)
+void LinkExtractorOutputDev::processLink(::AnnotLink *link)
 {
   if (!link->isOk())
     return;
@@ -71,7 +71,7 @@ void LinkExtractorOutputDev::processLink(::AnnotLink *link, Catalog *catalog)
   {
     m_links.append(popplerLink);
   }
-  OutputDev::processLink(link, catalog);
+  OutputDev::processLink(link);
 }
 
 QList< Link* > LinkExtractorOutputDev::links()
diff --git a/qt4/src/poppler-page.cc b/qt4/src/poppler-page.cc
index f76700a..9dc1d15 100644
--- a/qt4/src/poppler-page.cc
+++ b/qt4/src/poppler-page.cc
@@ -555,7 +555,7 @@ QList<Link*> Page::links() const
 QList<Annotation*> Page::annotations() const
 {
     ::Page *pdfPage = m_page->page;
-    Annots* annots = pdfPage->getAnnots(m_page->parentDoc->doc->getCatalog());
+    Annots* annots = pdfPage->getAnnots();
     const uint numAnnotations = annots->getNumAnnots();
     if ( numAnnotations == 0 )
     {
@@ -1309,7 +1309,7 @@ QList<FormField*> Page::formFields() const
 {
   QList<FormField*> fields;
   ::Page *p = m_page->page;
-  ::FormPageWidgets * form = p->getFormWidgets(m_page->parentDoc->doc->getCatalog());
+  ::FormPageWidgets * form = p->getFormWidgets();
   int formcount = form->getNumWidgets();
   for (int i = 0; i < formcount; ++i)
   {
diff --git a/utils/HtmlOutputDev.cc b/utils/HtmlOutputDev.cc
index a8a5922..d41bd44 100644
--- a/utils/HtmlOutputDev.cc
+++ b/utils/HtmlOutputDev.cc
@@ -1009,13 +1009,14 @@ void HtmlOutputDev::doFrame(int firstPage){
   fclose(fContentsFrame);  
 }
 
-HtmlOutputDev::HtmlOutputDev(char *fileName, char *title, 
+HtmlOutputDev::HtmlOutputDev(Catalog *catalogA, char *fileName, char *title, 
 	char *author, char *keywords, char *subject, char *date,
 	char *extension,
 	GBool rawOrder, int firstPage, GBool outline) 
 {
   const char *htmlEncoding;
   
+  catalog = catalogA;
   fContentsFrame = NULL;
   docTitle = new GooString(title);
   pages = NULL;
@@ -1191,7 +1192,7 @@ void HtmlOutputDev::startPage(int pageNum, GfxState *state) {
 
 
 void HtmlOutputDev::endPage() {
-  Links *linksList = docPage->getLinks(catalog);
+  Links *linksList = docPage->getLinks();
   for (int i = 0; i < linksList->getNumLinks(); ++i)
   {
       doProcessLink(linksList->getLink(i));
@@ -1416,13 +1417,13 @@ void HtmlOutputDev::doProcessLink(AnnotLink* link){
   cvtUserToDev(_x2,_y2,&x2,&y2); 
 
 
-  GooString* _dest=getLinkDest(link,catalog);
+  GooString* _dest=getLinkDest(link);
   HtmlLink t((double) x1,(double) y2,(double) x2,(double) y1,_dest);
   pages->AddLink(t);
   delete _dest;
 }
 
-GooString* HtmlOutputDev::getLinkDest(AnnotLink *link,Catalog* catalog){
+GooString* HtmlOutputDev::getLinkDest(AnnotLink *link){
   char *p;
   if (!link->getAction())
     return new GooString();
diff --git a/utils/HtmlOutputDev.h b/utils/HtmlOutputDev.h
index 2d40c9e..5de6001 100644
--- a/utils/HtmlOutputDev.h
+++ b/utils/HtmlOutputDev.h
@@ -220,7 +220,7 @@ public:
   // 8-bit ISO Latin-1.  <useASCII7> should also be set for Japanese
   // (EUC-JP) text.  If <rawOrder> is true, the text is kept in content
   // stream order.
-  HtmlOutputDev(char *fileName, char *title, 
+  HtmlOutputDev(Catalog *catalogA, char *fileName, char *title, 
 	  char *author,
 	  char *keywords,
 	  char *subject,
@@ -257,12 +257,11 @@ public:
   virtual GBool checkPageSlice(Page *page, double hDPI, double vDPI,
                                int rotate, GBool useMediaBox, GBool crop,
                                int sliceX, int sliceY, int sliceW, int sliceH,
-                               GBool printing, Catalog * catalogA,
+                               GBool printing,
                                GBool (* abortCheckCbk)(void *data) = NULL,
                                void * abortCheckCbkData = NULL)
   {
    docPage = page;
-   catalog = catalogA;
    return gTrue;
   }
 
@@ -305,7 +304,7 @@ private:
   // recognized
   static const char* mapEncodingToHtml(GooString* encoding);
   void doProcessLink(AnnotLink *link);
-  GooString* getLinkDest(AnnotLink *link,Catalog *catalog);
+  GooString* getLinkDest(AnnotLink *link);
   void dumpMetaVars(FILE *);
   void doFrame(int firstPage);
   GBool newOutlineLevel(FILE *output, Object *node, Catalog* catalog, int level = 1);
diff --git a/utils/pdftohtml.cc b/utils/pdftohtml.cc
index 1e7350a..b5848af 100644
--- a/utils/pdftohtml.cc
+++ b/utils/pdftohtml.cc
@@ -370,7 +370,7 @@ int main(int argc, char *argv[]) {
       rawOrder = singleHtml;
 
   // write text file
-  htmlOut = new HtmlOutputDev(htmlFileName->getCString(), 
+  htmlOut = new HtmlOutputDev(doc->getCatalog(), htmlFileName->getCString(), 
 	  docTitle->getCString(), 
 	  author ? author->getCString() : NULL,
 	  keywords ? keywords->getCString() : NULL, 


More information about the poppler mailing list