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