summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Kjernåsen <trond@trolltech.com>2010-01-28 12:29:54 (GMT)
committerJesper Thomschutz <jesper.thomschutz@nokia.com>2010-02-05 13:53:23 (GMT)
commit20606960de7755ee5ddb778a1c03f3d6ad198bac (patch)
treec2c92fe838429c13a11c1fb5c79f1ba7589285a6
parentdddfc432161c36e145e5f3ec234f50e3a2acb677 (diff)
downloadQt-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.cpp5
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;