diff options
author | Trond Kjernåsen <trond@trolltech.com> | 2010-01-28 12:29:54 (GMT) |
---|---|---|
committer | Jesper Thomschutz <jesper.thomschutz@nokia.com> | 2010-02-05 13:53:23 (GMT) |
commit | 20606960de7755ee5ddb778a1c03f3d6ad198bac (patch) | |
tree | c2c92fe838429c13a11c1fb5c79f1ba7589285a6 | |
parent | dddfc432161c36e145e5f3ec234f50e3a2acb677 (diff) | |
download | Qt-20606960de7755ee5ddb778a1c03f3d6ad198bac.zip Qt-20606960de7755ee5ddb778a1c03f3d6ad198bac.tar.gz Qt-20606960de7755ee5ddb778a1c03f3d6ad198bac.tar.bz2 |
Fixed an endless loop if printing web pages.
Entering a page range which is valid, but outside of the printable
range would result in an infinite loop.
Task-number: QTBUG-6051
Reviewed-by: Simon Hausmann
(cherry picked from commit 7c2000060bbc152ae32594f3d4dd60bd3351dab0)
-rw-r--r-- | src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp index 29bde0d..e4c2afc 100644 --- a/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp +++ b/src/3rdparty/webkit/WebKit/qt/Api/qwebframe.cpp @@ -1369,6 +1369,11 @@ void QWebFrame::print(QPrinter *printer) const // paranoia check fromPage = qMax(1, fromPage); toPage = qMin(printContext.pageCount(), toPage); + if (toPage < fromPage) { + // if the user entered a page range outside the actual number + // of printable pages, just return + return; + } if (printer->pageOrder() == QPrinter::LastPageFirst) { int tmp = fromPage; |