resolve numeric destinations of outline items

pages can have identifiers made up only with numbers; this needs to be taken
into account when resolving the destination of outline items, otherwise the
previous algorithm would assume that a numeric destination is a page number,
and thus potentially accessing to wrong pages (and crashing)

svn path=/trunk/KDE/kdegraphics/okular/; revision=1182195
remotes/origin/KDE/4.6
Pino Toscano 16 years ago
parent 00288db0ba
commit 515f9c7ac1
  1. 12
      generators/djvu/kdjvu.cpp

@ -549,7 +549,17 @@ void KDjVu::Private::fillBookmarksRecurse( QDomDocument& maindoc, QDomNode& curn
dest.toInt( &isNumber );
if ( isNumber )
{
el.setAttribute( "PageNumber", dest );
// it might be an actual page number, but could also be a page label
// so resolve the number, and get the real page number
int pageNo = pageWithName( dest );
if ( pageNo != -1 )
{
el.setAttribute( "PageNumber", QString::number( pageNo + 1 ) );
}
else
{
el.setAttribute( "PageNumber", dest );
}
}
else
{

Loading…
Cancel
Save