summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Kjernåsen <trond@trolltech.com>2010-01-28 12:29:54 (GMT)
committerTrond Kjernåsen <trond@trolltech.com>2010-01-28 12:31:45 (GMT)
commit7c2000060bbc152ae32594f3d4dd60bd3351dab0 (patch)
tree7eb50a6dc006d2e59cdc0c28cdcf750f13239124
parent902229bfffd709fb3294ac92180f1b171dc37eb8 (diff)
downloadQt-7c2000060bbc152ae32594f3d4dd60bd3351dab0.zip
Qt-7c2000060bbc152ae32594f3d4dd60bd3351dab0.tar.gz
Qt-7c2000060bbc152ae32594f3d4dd60bd3351dab0.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
-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;