Changeset View
Changeset View
Standalone View
Standalone View
src/renderer/KReportHTMLTableRenderer_p.cpp
Show First 20 Lines • Show All 109 Lines • ▼ Show 20 Line(s) | 100 | if (section->type() == KReportSectionData::GroupHeader || | |||
---|---|---|---|---|---|
110 | if (section->type() == KReportSectionData::PageFooterAny) | 110 | if (section->type() == KReportSectionData::PageFooterAny) | ||
111 | renderedPageFooter = true; | 111 | renderedPageFooter = true; | ||
112 | 112 | | |||
113 | tr = QLatin1String("<tr style=\"background-color: ") + section->backgroundColor().name() + QLatin1String("\">\n"); | 113 | tr = QLatin1String("<tr style=\"background-color: ") + section->backgroundColor().name() + QLatin1String("\">\n"); | ||
114 | //Render the objects in each section | 114 | //Render the objects in each section | ||
115 | for (int i = 0; i < section->primitiveCount(); i++) { | 115 | for (int i = 0; i < section->primitiveCount(); i++) { | ||
116 | OROPrimitive * prim = section->primitive(i); | 116 | OROPrimitive * prim = section->primitive(i); | ||
117 | 117 | | |||
118 | if (dynamic_cast<OROTextBox*>(prim)) { | 118 | if (OROTextBox *tb = dynamic_cast<OROTextBox*>(prim)) { | ||
119 | OROTextBox * tb = dynamic_cast<OROTextBox*>(prim); | | |||
120 | | ||||
121 | tr += QLatin1String("<td>") + | 119 | tr += QLatin1String("<td>") + | ||
122 | tb->text() + | 120 | tb->text() + | ||
123 | QLatin1String("</td>\n"); | 121 | QLatin1String("</td>\n"); | ||
124 | } else if (dynamic_cast<OROImage*>(prim)) { | 122 | } else if (OROImage *im = dynamic_cast<OROImage*>(prim)) { | ||
125 | //kreportDebug() << "Saving an image"; | | |||
126 | OROImage * im = dynamic_cast<OROImage*>(prim); | | |||
127 | tr += QLatin1String("<td>" | 123 | tr += QLatin1String("<td>" | ||
128 | "<img src=\"./") + m_actualDirName + QLatin1String("/object") + QString::number(s) + QString::number(i) + QLatin1String(".png\"></img>" | 124 | "<img src=\"./") + m_actualDirName + QLatin1String("/object") + QString::number(s) + QString::number(i) + QLatin1String(".png\"></img>" | ||
129 | "</td>\n"); | 125 | "</td>\n"); | ||
130 | im->image().save(m_tempDirName + QLatin1String("/object") + QString::number(s) + QString::number(i) + QLatin1String(".png")); | 126 | im->image().save(m_tempDirName + QLatin1String("/object") + QString::number(s) + QString::number(i) + QLatin1String(".png")); | ||
131 | } else if (dynamic_cast<OROPicture*>(prim)) { | 127 | } else if (OROPicture *im = dynamic_cast<OROPicture*>(prim)) { | ||
132 | //kreportDebug() << "Saving a picture"; | | |||
133 | OROPicture * im = dynamic_cast<OROPicture*>(prim); | | |||
134 | | ||||
135 | tr += QLatin1String("<td>" | 128 | tr += QLatin1String("<td>" | ||
136 | "<img src=\"./") + m_actualDirName + QLatin1String("/object") + QString::number(s) + QString::number(i) + QLatin1String(".png\"></img>" | 129 | "<img src=\"./") + m_actualDirName + QLatin1String("/object") + QString::number(s) + QString::number(i) + QLatin1String(".png\"></img>" | ||
137 | "</td>\n"); | 130 | "</td>\n"); | ||
138 | QImage image(im->size().toSize(), QImage::Format_RGB32); | 131 | QImage image(im->size().toSize(), QImage::Format_RGB32); | ||
139 | QPainter painter(&image); | 132 | QPainter painter(&image); | ||
140 | im->picture()->play(&painter); | 133 | im->picture()->play(&painter); | ||
141 | image.save(m_tempDirName + QLatin1String("/object") + QString::number(s) + QString::number(i) + QLatin1String(".png")); | 134 | image.save(m_tempDirName + QLatin1String("/object") + QString::number(s) + QString::number(i) + QLatin1String(".png")); | ||
142 | } else { | 135 | } else { | ||
Show All 30 Lines |