Changeset View
Changeset View
Standalone View
Standalone View
src/renderer/KReportHTMLCSSRenderer_p.cpp
Show First 20 Lines • Show All 87 Lines • ▼ Show 20 Line(s) | 85 | { | |||
---|---|---|---|---|---|
88 | QString style; | 88 | QString style; | ||
89 | QStringList styles; | 89 | QStringList styles; | ||
90 | int styleindex; | 90 | int styleindex; | ||
91 | bool renderedPageHead = false; | 91 | bool renderedPageHead = false; | ||
92 | bool renderedPageFoot = false; | 92 | bool renderedPageFoot = false; | ||
93 | 93 | | |||
94 | QDir d(m_tempDirName); | 94 | QDir d(m_tempDirName); | ||
95 | // Render Each Section | 95 | // Render Each Section | ||
96 | for (long s = 0; s < document->sections(); s++) { | 96 | for (long s = 0; s < document->sectionCount(); s++) { | ||
staniek: long -> int | |||||
staniek: TODO | |||||
97 | OROSection *section = document->section(s); | 97 | OROSection *section = document->section(s); | ||
98 | 98 | | |||
99 | if (section->type() == KReportSectionData::GroupHeader || | 99 | if (section->type() == KReportSectionData::GroupHeader || | ||
100 | section->type() == KReportSectionData::GroupFooter || | 100 | section->type() == KReportSectionData::GroupFooter || | ||
101 | section->type() == KReportSectionData::Detail || | 101 | section->type() == KReportSectionData::Detail || | ||
102 | section->type() == KReportSectionData::ReportHeader || | 102 | section->type() == KReportSectionData::ReportHeader || | ||
103 | section->type() == KReportSectionData::ReportFooter || | 103 | section->type() == KReportSectionData::ReportFooter || | ||
104 | (section->type() == KReportSectionData::PageHeaderAny && !renderedPageHead) || | 104 | (section->type() == KReportSectionData::PageHeaderAny && !renderedPageHead) || | ||
105 | (section->type() == KReportSectionData::PageFooterAny && !renderedPageFoot && s > document->sections() - 2)) { //render the page foot right at the end, it will either be the last or second last section if there is a report footer | 105 | (section->type() == KReportSectionData::PageFooterAny && !renderedPageFoot && s > document->sectionCount() - 2)) { //render the page foot right at the end, it will either be the last or second last section if there is a report footer | ||
106 | if (section->type() == KReportSectionData::PageHeaderAny) | 106 | if (section->type() == KReportSectionData::PageHeaderAny) | ||
107 | renderedPageHead = true; | 107 | renderedPageHead = true; | ||
108 | 108 | | |||
109 | if (section->type() == KReportSectionData::PageFooterAny) | 109 | if (section->type() == KReportSectionData::PageFooterAny) | ||
110 | renderedPageFoot = true; | 110 | renderedPageFoot = true; | ||
111 | 111 | | |||
112 | style = QLatin1String("position: relative; top: 0pt; left: 0pt; background-color: ") + section->backgroundColor().name() + QLatin1String("; height: ") + QString::number(section->height()) + QLatin1String("pt;"); | 112 | style = QLatin1String("position: relative; top: 0pt; left: 0pt; background-color: ") + section->backgroundColor().name() + QLatin1String("; height: ") + QString::number(section->height()) + QLatin1String("pt;"); | ||
113 | 113 | | |||
114 | if (!styles.contains(style)) { | 114 | if (!styles.contains(style)) { | ||
115 | styles << style; | 115 | styles << style; | ||
116 | } | 116 | } | ||
117 | styleindex = styles.indexOf(style); | 117 | styleindex = styles.indexOf(style); | ||
118 | 118 | | |||
119 | body += QLatin1String("<div class=\"style") + QString::number(styleindex) + QLatin1String("\">\n"); | 119 | body += QLatin1String("<div class=\"style") + QString::number(styleindex) + QLatin1String("\">\n"); | ||
120 | //Render the objects in each section | 120 | //Render the objects in each section | ||
121 | for (int i = 0; i < section->primitives(); i++) { | 121 | for (int i = 0; i < section->primitiveCount(); i++) { | ||
122 | OROPrimitive * prim = section->primitive(i); | 122 | OROPrimitive * prim = section->primitive(i); | ||
123 | //kreportDebug() << "Got object type" << prim->type(); | 123 | //kreportDebug() << "Got object type" << prim->type(); | ||
124 | if (prim->type() == OROTextBox::TextBox) { | 124 | if (prim->type() == OROTextBox::TextBox) { | ||
125 | OROTextBox * tb = (OROTextBox*) prim; | 125 | OROTextBox * tb = (OROTextBox*) prim; | ||
126 | 126 | | |||
127 | QColor bg = tb->textStyle().backgroundColor; | 127 | QColor bg = tb->textStyle().backgroundColor; | ||
128 | style = QLatin1String("position: absolute; ") + | 128 | style = QLatin1String("position: absolute; ") + | ||
129 | QLatin1String("background-color: ") + QString::fromLatin1("rgba(%1,%2,%3,%4)") | 129 | QLatin1String("background-color: ") + QString::fromLatin1("rgba(%1,%2,%3,%4)") | ||
▲ Show 20 Lines • Show All 93 Lines • Show Last 20 Lines |
long -> int