Changeset View
Changeset View
Standalone View
Standalone View
src/common/KReportDocument.cpp
Show First 20 Lines • Show All 87 Lines • ▼ Show 20 Line(s) | 86 | } else if (elemThis.tagName() == QLatin1String("report:page-style")) { | |||
---|---|---|---|---|---|
88 | 88 | | |||
89 | //Full page mode is required to allow margins to be set to whatever the user has specified | 89 | //Full page mode is required to allow margins to be set to whatever the user has specified | ||
90 | d->pageLayout.setMode(QPageLayout::FullPageMode); | 90 | d->pageLayout.setMode(QPageLayout::FullPageMode); | ||
91 | 91 | | |||
92 | if (pagetype == QLatin1String("predefined")) { | 92 | if (pagetype == QLatin1String("predefined")) { | ||
93 | setPageSize(elemThis.attribute(QLatin1String("report:page-size"), QLatin1String("A4"))); | 93 | setPageSize(elemThis.attribute(QLatin1String("report:page-size"), QLatin1String("A4"))); | ||
94 | d->pageLayout.setPageSize(QPageSize(KReportPageSize::pageSize(pageSize()))); | 94 | d->pageLayout.setPageSize(QPageSize(KReportPageSize::pageSize(pageSize()))); | ||
95 | } else if (pagetype == QLatin1String("custom")) { | 95 | } else if (pagetype == QLatin1String("custom")) { | ||
96 | QPageSize custom(QSize(elemThis.attribute(QLatin1String("report:custom-page-width"), QString()).toFloat() , elemThis.attribute(QLatin1String("report:custom-page-height"), QString()).toFloat()), QLatin1String("Custom")); | 96 | kreportDebug() << "Setting custom page size in document to " << KReportUnit::parseValue(elemThis.attribute(QLatin1String("report:custom-page-width"), QLatin1String("5.0cm"))) << KReportUnit::parseValue(elemThis.attribute(QLatin1String("report:custom-page-height"), QLatin1String("5.0cm"))) ; | ||
97 | QPageSize custom(QSize(KReportUnit::parseValue(elemThis.attribute(QLatin1String("report:custom-page-width"), QLatin1String("5.0cm"))) , KReportUnit::parseValue(elemThis.attribute(QLatin1String("report:custom-page-height"), QLatin1String("5.0cm"))) ), QString(), QPageSize::ExactMatch); | ||||
97 | 98 | | |||
98 | d->pageLayout.setPageSize(custom); | 99 | d->pageLayout.setPageSize(custom); | ||
99 | } else if (pagetype == QLatin1String("label")) { | 100 | } else if (pagetype == QLatin1String("label")) { | ||
100 | setLabelType(elemThis.firstChild().nodeValue()); | 101 | setLabelType(elemThis.firstChild().nodeValue()); | ||
101 | } | 102 | } | ||
102 | //! @todo add config for default margins or add within templates support | 103 | //! @todo add config for default margins or add within templates support | ||
103 | d->pageLayout.setUnits(QPageLayout::Point); | 104 | d->pageLayout.setUnits(QPageLayout::Point); | ||
104 | d->pageLayout.setLeftMargin(KReportUnit::parseValue(elemThis.attribute(QLatin1String("fo:margin-left"), QLatin1String("1.0cm")))); | 105 | d->pageLayout.setLeftMargin(KReportUnit::parseValue(elemThis.attribute(QLatin1String("fo:margin-left"), QLatin1String("1.0cm")))); | ||
▲ Show 20 Lines • Show All 283 Lines • Show Last 20 Lines |