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

New commits:
commit 84e6306b4ef5403c5ecaca38e59bb9b0c56c4209
Author: Albert Astals Cid <[EMAIL PROTECTED]>
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 1fe960f..94fb2bb 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;
_______________________________________________
poppler mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/poppler

Reply via email to