Changeset View
Changeset View
Standalone View
Standalone View
src/renderer/KReportPrintRenderer_p.cpp
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | 41 | if (document == nullptr || pPrinter == nullptr) | |||
---|---|---|---|---|---|
42 | return false; | 42 | return false; | ||
43 | 43 | | |||
44 | pPrinter->setCreator(QLatin1String("KReport Print Renderer")); | 44 | pPrinter->setCreator(QLatin1String("KReport Print Renderer")); | ||
45 | pPrinter->setDocName(document->title()); | 45 | pPrinter->setDocName(document->title()); | ||
46 | pPrinter->setFullPage(true); | 46 | pPrinter->setFullPage(true); | ||
47 | pPrinter->setOrientation((document->pageLayout().orientation() == QPageLayout::Portrait ? QPrinter::Portrait : QPrinter::Landscape)); | 47 | pPrinter->setOrientation((document->pageLayout().orientation() == QPageLayout::Portrait ? QPrinter::Portrait : QPrinter::Landscape)); | ||
48 | pPrinter->setPageOrder(QPrinter::FirstPageFirst); | 48 | pPrinter->setPageOrder(QPrinter::FirstPageFirst); | ||
49 | 49 | | |||
50 | if (!document->pageLayout().pageSize().isValid()) { | 50 | // if (!document->pageLayout().pageSize().isValid()) { | ||
51 | pPrinter->setPageSize(QPrinter::Custom); | 51 | // pPrinter->setPageSize(QPageSize(QSize(document->pageLayout().getCustomWidth(), document->pageLayout().getCustomHeight()), QLatin1String("Custom")); | ||
52 | } else { | 52 | // } else { | ||
53 | pPrinter->setPageSize(QPageSize(document->pageLayout().pageSize())); | 53 | pPrinter->setPageSize(QPageSize(document->pageLayout().pageSize())); | ||
54 | } | 54 | // } | ||
55 | 55 | | |||
56 | return true; | 56 | return true; | ||
57 | } | 57 | } | ||
58 | 58 | | |||
59 | bool PrintRenderer::render(const KReportRendererContext &context, ORODocument *document, int page) | 59 | bool PrintRenderer::render(const KReportRendererContext &context, ORODocument *document, int page) | ||
60 | { | 60 | { | ||
61 | Q_UNUSED(page); | 61 | Q_UNUSED(page); | ||
62 | if (document == nullptr || context.printer() == nullptr || context.painter() == nullptr) | 62 | if (document == nullptr || context.printer() == nullptr || context.painter() == nullptr) | ||
▲ Show 20 Lines • Show All 185 Lines • Show Last 20 Lines |