Changeset View
Changeset View
Standalone View
Standalone View
src/renderer/KReportKSpreadRenderer.cpp
Show All 40 Lines | 37 | { | |||
---|---|---|---|---|---|
41 | 41 | | |||
42 | //kreportDebug() << "Setting name to:" << document->title(); | 42 | //kreportDebug() << "Setting name to:" << document->title(); | ||
43 | sht->setName(document->title()); | 43 | sht->setName(document->title()); | ||
44 | 44 | | |||
45 | bool renderedPageHeader = false; | 45 | bool renderedPageHeader = false; | ||
46 | bool renderedPageFooter = false; | 46 | bool renderedPageFooter = false; | ||
47 | 47 | | |||
48 | // Render Each Section | 48 | // Render Each Section | ||
49 | for (long s = 0; s < document->sections(); s++) { | 49 | for (int s = 0; s < document->sectionCount(); s++) { | ||
staniek: long -> int | |||||
staniek: typo | |||||
50 | OROSection *section = document->section(s); | 50 | OROSection *section = document->section(s); | ||
51 | section->sortPrimatives(OROSection::SortX); | 51 | section->sortPrimitives(OROSection::SortX); | ||
52 | 52 | | |||
53 | if (section->type() == KReportSectionData::GroupHeader || | 53 | if (section->type() == KReportSectionData::GroupHeader || | ||
54 | section->type() == KReportSectionData::GroupFooter || | 54 | section->type() == KReportSectionData::GroupFooter || | ||
55 | section->type() == KReportSectionData::Detail || | 55 | section->type() == KReportSectionData::Detail || | ||
56 | section->type() == KReportSectionData::ReportHeader || | 56 | section->type() == KReportSectionData::ReportHeader || | ||
57 | section->type() == KReportSectionData::ReportFooter || | 57 | section->type() == KReportSectionData::ReportFooter || | ||
58 | (section->type() == KReportSectionData::PageHeaderAny && !renderedPageHeader) || | 58 | (section->type() == KReportSectionData::PageHeaderAny && !renderedPageHeader) || | ||
59 | (section->type() == KReportSectionData::PageFooterAny && !renderedPageFooter && 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 | 59 | (section->type() == KReportSectionData::PageFooterAny && !renderedPageFooter && 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 | ||
60 | if (section->type() == KReportSectionData::PageHeaderAny) | 60 | if (section->type() == KReportSectionData::PageHeaderAny) | ||
61 | renderedPageHeader = true; | 61 | renderedPageHeader = true; | ||
62 | 62 | | |||
63 | if (section->type() == KReportSectionData::PageFooterAny) | 63 | if (section->type() == KReportSectionData::PageFooterAny) | ||
64 | renderedPageFooter = true; | 64 | renderedPageFooter = true; | ||
65 | 65 | | |||
66 | //Render the objects in each section | 66 | //Render the objects in each section | ||
67 | for (int i = 0; i < section->primitives(); i++) { | 67 | for (int i = 0; i < section->primitiveCount(); i++) { | ||
68 | OROPrimitive * prim = section->primitive(i); | 68 | OROPrimitive * prim = section->primitive(i); | ||
69 | 69 | | |||
70 | if (prim->type() == OROTextBox::TextBox) { | 70 | if (prim->type() == OROTextBox::TextBox) { | ||
71 | OROTextBox * tb = (OROTextBox*) prim; | 71 | OROTextBox * tb = (OROTextBox*) prim; | ||
72 | 72 | | |||
73 | sht->addCell(s, i, new KoSimpleOdsCell(tb->text())); | 73 | sht->addCell(s, i, new KoSimpleOdsCell(tb->text())); | ||
74 | } | 74 | } | ||
75 | /* | 75 | /* | ||
▲ Show 20 Lines • Show All 42 Lines • Show Last 20 Lines |
long -> int