From ae4a022ecc5f163bd63960b43dadb5fec7108e77 Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Thu, 18 Jan 2018 21:44:11 +0300 Subject: [PATCH] Prevent double start new page by group headers --- limereport/lrreportrender.cpp | 10 ++++++---- limereport/lrreportrender.h | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/limereport/lrreportrender.cpp b/limereport/lrreportrender.cpp index 6bc1d2a..5eb81e6 100644 --- a/limereport/lrreportrender.cpp +++ b/limereport/lrreportrender.cpp @@ -148,7 +148,7 @@ void ReportRender::renameChildItems(BaseDesignIntf *item){ ReportRender::ReportRender(QObject *parent) :QObject(parent), m_renderPageItem(0), m_pageCount(0), - m_lastDataBand(0), m_lastRenderedFooter(0), m_currentColumn(0) + m_lastDataBand(0), m_lastRenderedFooter(0), m_currentColumn(0), m_newPageStarted(false) { initColumns(); } @@ -558,6 +558,7 @@ void ReportRender::renderDataBand(BandDesignIntf *dataBand) renderBand(header, 0, StartNewPageAsNeeded); renderBand(dataBand, rawData, StartNewPageAsNeeded, !bandDatasource->hasNext()); + m_newPageStarted = false; renderChildBands(dataBand); } @@ -729,7 +730,7 @@ void ReportRender::renderGroupHeader(BandDesignIntf *parentBand, IDataSource* da } gb->startGroup(m_datasources); openDataGroup(band); - if (!firstTime && gb->startNewPage()){ + if (!firstTime && gb->startNewPage() && !m_newPageStarted){ if (gb->resetPageNumber()) resetPageNumber(BandReset); if (band->reprintOnEachPage()){ savePage(); @@ -1085,8 +1086,9 @@ void ReportRender::startNewColumn(){ void ReportRender::startNewPage() { - m_renderPageItem=0; - m_currentColumn=0; + m_renderPageItem = 0; + m_currentColumn = 0; + m_newPageStarted = true; initColumns(); initRenderPage(); diff --git a/limereport/lrreportrender.h b/limereport/lrreportrender.h index 40a27b7..3e9f26f 100644 --- a/limereport/lrreportrender.h +++ b/limereport/lrreportrender.h @@ -185,6 +185,7 @@ private: QList m_ranges; QVector m_columnedBandItems; unsigned long long m_curentNameIndex; + bool m_newPageStarted; };