comparison src/main.cpp @ 117:71cfb7d96cfc

If printer object->fromPage() and toPage() return 0, we are supposed to print all pages, thus adjust accordingly.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 05 Jul 2017 15:08:54 +0300
parents a5c8741b8662
children b982ac0fdae4
comparison
equal deleted inserted replaced
116:e03f6adf108d 117:71cfb7d96cfc
577 bool ret = printDocumentPage(pinfo, true, -1, &tmpPainter, printer); 577 bool ret = printDocumentPage(pinfo, true, -1, &tmpPainter, printer);
578 tmpPainter.end(); 578 tmpPainter.end();
579 579
580 if (!ret) 580 if (!ret)
581 return; 581 return;
582
583 // If from and to are 0, we are supposed to print all pages
584 if (printer->fromPage() == 0 && printer->toPage() == 0)
585 printer->setFromTo(1, pinfo.npages);
582 586
583 // Setup rest of the progress dialog here 587 // Setup rest of the progress dialog here
584 progress.setWindowModality(Qt::ApplicationModal); 588 progress.setWindowModality(Qt::ApplicationModal);
585 progress.setMinimum(printer->fromPage() - 1); 589 progress.setMinimum(printer->fromPage() - 1);
586 progress.setMaximum(printer->toPage()); 590 progress.setMaximum(printer->toPage());