Show
Ignore:
Timestamp:
04/15/06 10:40:50 (3 years ago)
Author:
jordi
Message:

Added support for named destinations for PDF outlines.
Now the view shows the links sidebar and allows to go to where they point if you double click on them...

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/PDFDocument.cxx

    r65 r67  
    246246            gint destination = 1; 
    247247            LinkAction *action = item->getAction (); 
    248             if ( NULL != action && action->isOk () &&  
    249                  actionGoTo == action->getKind () )  
    250             { 
    251                 LinkDest *linkDestination = ((LinkGoTo *)action)->getDest (); 
    252                 if ( linkDestination->isOk () ) 
     248            if ( NULL != action && actionGoTo == action->getKind () && 
     249                 action->isOk () ) 
     250            { 
     251                LinkDest *linkDestination = NULL; 
     252                GooString *namedDest = ((LinkGoTo *)action)->getNamedDest (); 
     253                // getNamedDest() or getDest() will return NULL, just need to 
     254                // find which one. 
     255                if ( NULL != namedDest ) 
     256                { 
     257                    linkDestination = m_Document->findDest (namedDest); 
     258                } 
     259                else 
     260                { 
     261                    linkDestination = ((LinkGoTo *)action)->getDest (); 
     262                } 
     263                if ( NULL != linkDestination && linkDestination->isOk () ) 
    253264                { 
    254265                    if ( linkDestination->isPageRef () )