Changeset View
Changeset View
Standalone View
Standalone View
src/common/KReportDocument.cpp
Show All 13 Lines | |||||
14 | * You should have received a copy of the GNU Lesser General Public | 14 | * You should have received a copy of the GNU Lesser General Public | ||
15 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | 15 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | 16 | */ | ||
17 | 17 | | |||
18 | #include "KReportDocument.h" | 18 | #include "KReportDocument.h" | ||
19 | #include "KReportUnit.h" | 19 | #include "KReportUnit.h" | ||
20 | #include "KReportDetailSectionData.h" | 20 | #include "KReportDetailSectionData.h" | ||
21 | #include "KReportItemBase.h" | 21 | #include "KReportItemBase.h" | ||
22 | #include "KReportDpi.h" | ||||
22 | 23 | | |||
23 | #include <QDomElement> | 24 | #include <QDomElement> | ||
24 | #include <QApplication> | 25 | #include <QApplication> | ||
25 | #include <QScreen> | | |||
26 | #include "kreport_debug.h" | 26 | #include "kreport_debug.h" | ||
27 | 27 | | |||
28 | void KReportDocument::init() | 28 | void KReportDocument::init() | ||
29 | { | 29 | { | ||
30 | m_pageHeaderFirst = m_pageHeaderOdd = m_pageHeaderEven = m_pageHeaderLast = m_pageHeaderAny = 0; | 30 | m_pageHeaderFirst = m_pageHeaderOdd = m_pageHeaderEven = m_pageHeaderLast = m_pageHeaderAny = 0; | ||
31 | m_pageFooterFirst = m_pageFooterOdd = m_pageFooterEven = m_pageFooterLast = m_pageFooterAny = 0; | 31 | m_pageFooterFirst = m_pageFooterOdd = m_pageFooterEven = m_pageFooterLast = m_pageFooterAny = 0; | ||
32 | m_reportHeader = m_reportFooter = 0; | 32 | m_reportHeader = m_reportFooter = 0; | ||
33 | } | 33 | } | ||
Show All 13 Lines | 46 | { | |||
47 | m_valid = false; | 47 | m_valid = false; | ||
48 | init(); | 48 | init(); | ||
49 | //kreportDebug(); | 49 | //kreportDebug(); | ||
50 | if (elemSource.tagName() != QLatin1String("report:content")) { | 50 | if (elemSource.tagName() != QLatin1String("report:content")) { | ||
51 | kreportWarning() << "QDomElement is not <report:content> tag" | 51 | kreportWarning() << "QDomElement is not <report:content> tag" | ||
52 | << elemSource.text(); | 52 | << elemSource.text(); | ||
53 | return; | 53 | return; | ||
54 | } | 54 | } | ||
55 | QScreen *srn = QApplication::screens().at(0); | | |||
56 | 55 | | |||
57 | const qreal dpiX = srn->logicalDotsPerInchX(); | 56 | const qreal dpiX = KReportDpi::dpiX(); | ||
58 | const qreal dpiY = srn->logicalDotsPerInchY(); | 57 | const qreal dpiY = KReportDpi::dpiY(); | ||
59 | 58 | | |||
60 | 59 | | |||
61 | QDomNodeList sections = elemSource.childNodes(); | 60 | QDomNodeList sections = elemSource.childNodes(); | ||
62 | for (int nodeCounter = 0; nodeCounter < sections.count(); nodeCounter++) { | 61 | for (int nodeCounter = 0; nodeCounter < sections.count(); nodeCounter++) { | ||
63 | QDomElement elemThis = sections.item(nodeCounter).toElement(); | 62 | QDomElement elemThis = sections.item(nodeCounter).toElement(); | ||
64 | if (elemThis.tagName() == QLatin1String("report:title")) { | 63 | if (elemThis.tagName() == QLatin1String("report:title")) { | ||
65 | m_title = elemThis.text(); | 64 | m_title = elemThis.text(); | ||
66 | #ifdef KREPORT_SCRIPTING | 65 | #ifdef KREPORT_SCRIPTING | ||
▲ Show 20 Lines • Show All 239 Lines • Show Last 20 Lines |