summaryrefslogtreecommitdiffstats
path: root/src/printsupport/kernel
diff options
context:
space:
mode:
authorEirik Aavitsland <eirik.aavitsland@qt.io>2022-10-18 17:29:23 +0200
committerEirik Aavitsland <eirik.aavitsland@qt.io>2022-10-19 11:27:35 +0200
commit7988cf25a52d26109e60fe5a7b72ec2940c59ecc (patch)
tree7f168fb04d6f077aea04dbbc1c73b7869abd641d /src/printsupport/kernel
parent0709af1c02a653f3121c76ae7879cc64b2e246b7 (diff)
Avoid warning from QPrinter::setFromTo() in the documented 0,0 case
The doc says the setFromTo(0, 0) will print the whole document, i.e. clear the page ranges. Although this works, it creates a runtime warning. Fixes: QTBUG-105292 Pick-to: 6.4 Change-Id: Ic5de5be71ffc91762c8a4a44875ba133831d981f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/printsupport/kernel')
-rw-r--r--src/printsupport/kernel/qprinter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/printsupport/kernel/qprinter.cpp b/src/printsupport/kernel/qprinter.cpp
index 66fc883cae..e591b51aee 100644
--- a/src/printsupport/kernel/qprinter.cpp
+++ b/src/printsupport/kernel/qprinter.cpp
@@ -1410,7 +1410,8 @@ int QPrinter::toPage() const
void QPrinter::setFromTo(int from, int to)
{
d->pageRanges.clear();
- d->pageRanges.addRange(from, to);
+ if (from && to)
+ d->pageRanges.addRange(from, to);
}
/*!