Changeset View
Changeset View
Standalone View
Standalone View
src/common/KReportDocument.cpp
Show First 20 Lines • Show All 102 Lines • ▼ Show 20 Line(s) | 101 | } else if (pagetype == QLatin1String("custom")) { | |||
---|---|---|---|---|---|
103 | 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); | 103 | 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); | ||
104 | 104 | | |||
105 | d->pageLayout.setPageSize(custom); | 105 | d->pageLayout.setPageSize(custom); | ||
106 | } else if (pagetype == QLatin1String("label")) { | 106 | } else if (pagetype == QLatin1String("label")) { | ||
107 | setLabelType(elemThis.firstChild().nodeValue()); | 107 | setLabelType(elemThis.firstChild().nodeValue()); | ||
108 | } | 108 | } | ||
109 | //! @todo add config for default margins or add within templates support | 109 | //! @todo add config for default margins or add within templates support | ||
110 | d->pageLayout.setUnits(QPageLayout::Point); | 110 | d->pageLayout.setUnits(QPageLayout::Point); | ||
111 | d->pageLayout.setLeftMargin(KReportUnit::parseValue(elemThis.attribute(QLatin1String("fo:margin-left"), QLatin1String("1.0cm")))); | 111 | d->pageLayout.setLeftMargin(KReportUnit::parseValue(elemThis.attribute( | ||
112 | d->pageLayout.setRightMargin(KReportUnit::parseValue(elemThis.attribute(QLatin1String("fo:margin-right"), QLatin1String("1.0cm")))); | 112 | QLatin1String("fo:margin-left"), DEFAULT_PAGE_MARGIN_STRING))); | ||
113 | d->pageLayout.setTopMargin(KReportUnit::parseValue(elemThis.attribute(QLatin1String("fo:margin-top"), QLatin1String("1.0cm")))); | 113 | d->pageLayout.setRightMargin(KReportUnit::parseValue(elemThis.attribute( | ||
114 | d->pageLayout.setBottomMargin(KReportUnit::parseValue(elemThis.attribute(QLatin1String("fo:margin-bottom"), QLatin1String("1.0cm")))); | 114 | QLatin1String("fo:margin-right"), DEFAULT_PAGE_MARGIN_STRING))); | ||
115 | d->pageLayout.setOrientation(elemThis.attribute(QLatin1String("report:print-orientation"), QLatin1String("portrait")) == QLatin1String("portrait") ? QPageLayout::Portrait : QPageLayout::Landscape); | 115 | d->pageLayout.setTopMargin(KReportUnit::parseValue(elemThis.attribute( | ||
116 | QLatin1String("fo:margin-top"), DEFAULT_PAGE_MARGIN_STRING))); | ||||
117 | d->pageLayout.setBottomMargin(KReportUnit::parseValue(elemThis.attribute( | ||||
118 | QLatin1String("fo:margin-bottom"), DEFAULT_PAGE_MARGIN_STRING))); | ||||
119 | d->pageLayout.setOrientation( | ||||
120 | elemThis.attribute(QLatin1String("report:print-orientation"), | ||||
121 | QLatin1String("portrait")) | ||||
122 | == QLatin1String("portrait") | ||||
123 | ? QPageLayout::Portrait | ||||
124 | : QPageLayout::Landscape); | ||||
116 | } else if (elemThis.tagName() == QLatin1String("report:body")) { | 125 | } else if (elemThis.tagName() == QLatin1String("report:body")) { | ||
117 | QDomNodeList sectionlist = elemThis.childNodes(); | 126 | QDomNodeList sectionlist = elemThis.childNodes(); | ||
118 | QDomNode sec; | 127 | QDomNode sec; | ||
119 | 128 | | |||
120 | for (int s = 0; s < sectionlist.count(); ++s) { | 129 | for (int s = 0; s < sectionlist.count(); ++s) { | ||
121 | sec = sectionlist.item(s); | 130 | sec = sectionlist.item(s); | ||
122 | if (sec.isElement()) { | 131 | if (sec.isElement()) { | ||
123 | QString sn = sec.nodeName().toLower(); | 132 | QString sn = sec.nodeName().toLower(); | ||
▲ Show 20 Lines • Show All 279 Lines • Show Last 20 Lines |