E-book viewer: When printing, resepect the specified page range. Fixes #1074220 (Trying to select the page to print will actually print the whole book)

This commit is contained in:
Kovid Goyal 2012-11-11 13:45:24 +05:30
parent f68b22881a
commit 3491ab4ab1

View File

@ -54,6 +54,8 @@ class Printing(QObject):
pr.height()/zoomy)) pr.height()/zoomy))
evaljs = self.mf.evaluateJavaScript evaljs = self.mf.evaluateJavaScript
loop = QEventLoop(self) loop = QEventLoop(self)
pagenum = 0
from_, to = printer.fromPage(), printer.toPage()
first = True first = True
for path in self.iterator.spine: for path in self.iterator.spine:
@ -74,6 +76,8 @@ class Printing(QObject):
''') ''')
while True: while True:
pagenum += 1
if (pagenum >= from_ and (to == 0 or pagenum <= to)):
if not first: if not first:
printer.newPage() printer.newPage()
first = False first = False