[poppler] utils/HtmlOutputDev.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Mon Jul 28 11:45:46 PDT 2008


 utils/HtmlOutputDev.cc |   16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

New commits:
commit 650c73fa0f570f699d907e33060fb23290940b42
Author: Albert Astals Cid <aacid at kde.org>
Date:   Mon Jul 28 20:44:13 2008 +0200

    findDest crashes on null goostrings so rework the ifs a bit

diff --git a/utils/HtmlOutputDev.cc b/utils/HtmlOutputDev.cc
index dbcd3a6..2f06cf9 100644
--- a/utils/HtmlOutputDev.cc
+++ b/utils/HtmlOutputDev.cc
@@ -1279,10 +1279,11 @@ GooString* HtmlOutputDev::getLinkDest(Link *link,Catalog* catalog){
 	  int page=1;
 	  LinkGoTo *ha=(LinkGoTo *)link->getAction();
 	  LinkDest *dest=NULL;
-	  if (ha->getDest()==NULL) 
-	      dest=catalog->findDest(ha->getNamedDest());
-	  else 
+	  if (ha->getDest()!=NULL)
 	      dest=ha->getDest()->copy();
+	  else if (ha->getNamedDest()!=NULL)
+	      dest=catalog->findDest(ha->getNamedDest());
+	      
 	  if (dest){ 
 	      if (dest->isPageRef()){
 		  Ref pageref=dest->getPageRef();
@@ -1475,10 +1476,11 @@ GBool HtmlOutputDev::newOutlineLevel(FILE *output, Object *node, Catalog* catalo
       if (!curr.dictLookup("Dest", &dest)->isNull()) {
 		LinkGoTo *link = new LinkGoTo(&dest);
 		LinkDest *linkdest=NULL;
-		if (link->getDest()==NULL) 
-	  		linkdest=catalog->findDest(link->getNamedDest());
-		else 
-	  		linkdest=link->getDest()->copy();
+		if (link->getDest()!=NULL)
+			linkdest=link->getDest()->copy();
+		else if (link->getNamedDest()!=NULL)
+			linkdest=catalog->findDest(link->getNamedDest());
+			
 		delete link;
 		if (linkdest) { 
 	  		int page;


More information about the poppler mailing list