[poppler] Branch 'poppler-0.6' - qt4/src
Albert Astals Cid
aacid at kemper.freedesktop.org
Sat Dec 22 05:31:01 PST 2007
qt4/src/poppler-link.cc | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
New commits:
commit d8cfc721ffb1d3083b554544a8333ef8752094ef
Author: Albert Astals Cid <aacid at kde.org>
Date: Sat Dec 22 14:29:45 2007 +0100
Check the destination page of the link does exist
diff --git a/qt4/src/poppler-link.cc b/qt4/src/poppler-link.cc
index 22c9ec3..4d407a3 100644
--- a/qt4/src/poppler-link.cc
+++ b/qt4/src/poppler-link.cc
@@ -210,14 +210,18 @@ class LinkMoviePrivate : public LinkPrivate
int leftAux = 0, topAux = 0, rightAux = 0, bottomAux = 0;
- ::Page *page = data.doc->doc->getCatalog()->getPage( d->pageNum );
- cvtUserToDev( page, left, top, &leftAux, &topAux );
- cvtUserToDev( page, right, bottom, &rightAux, &bottomAux );
-
- d->left = leftAux / (double)page->getCropWidth();
- d->top = topAux / (double)page->getCropHeight();
- d->right = rightAux/ (double)page->getCropWidth();
- d->bottom = bottomAux / (double)page->getCropHeight();
+ if (d->pageNum > 0 && d->pageNum <= data.doc->doc->getNumPages())
+ {
+ ::Page *page = data.doc->doc->getCatalog()->getPage( d->pageNum );
+ cvtUserToDev( page, left, top, &leftAux, &topAux );
+ cvtUserToDev( page, right, bottom, &rightAux, &bottomAux );
+
+ d->left = leftAux / (double)page->getCropWidth();
+ d->top = topAux / (double)page->getCropHeight();
+ d->right = rightAux/ (double)page->getCropWidth();
+ d->bottom = bottomAux / (double)page->getCropHeight();
+ }
+ else d->pageNum = 0;
if (deleteDest) delete ld;
}
More information about the poppler
mailing list