The rendering process, if the not sliced band is moved to a new page, has been changed

This commit is contained in:
Arin Alexander 2019-04-16 16:59:35 +03:00
parent 220dcc3edb
commit 271b765722

View File

@ -428,6 +428,7 @@ void ReportRender::replaceGroupsFunction(BandDesignIntf *band)
BandDesignIntf* ReportRender::renderBand(BandDesignIntf *patternBand, BandDesignIntf* bandData, ReportRender::DataRenderMode mode, bool isLast) BandDesignIntf* ReportRender::renderBand(BandDesignIntf *patternBand, BandDesignIntf* bandData, ReportRender::DataRenderMode mode, bool isLast)
{ {
QCoreApplication::processEvents(); QCoreApplication::processEvents();
bool bandIsSliced = false;
if (patternBand){ if (patternBand){
if (patternBand->isHeader()) if (patternBand->isHeader())
@ -474,7 +475,8 @@ BandDesignIntf* ReportRender::renderBand(BandDesignIntf *patternBand, BandDesign
if (patternBand && patternBand->isHeader() && patternBand->reprintOnEachPage()) if (patternBand && patternBand->isHeader() && patternBand->reprintOnEachPage())
m_reprintableBands.removeOne(patternBand); m_reprintableBands.removeOne(patternBand);
if (bandClone->canBeSplitted(m_maxHeightByColumn[m_currentColumn])){ if (bandClone->canBeSplitted(m_maxHeightByColumn[m_currentColumn])){
bandClone = sliceBand(bandClone,patternBand,isLast); bandClone = sliceBand(bandClone, patternBand, isLast);
bandIsSliced = true;
} else { } else {
qreal percent = (bandClone->height()-m_maxHeightByColumn[m_currentColumn])/(bandClone->height()/100); qreal percent = (bandClone->height()-m_maxHeightByColumn[m_currentColumn])/(bandClone->height()/100);
if (bandClone->maxScalePercent()>=percent){ if (bandClone->maxScalePercent()>=percent){
@ -504,6 +506,10 @@ BandDesignIntf* ReportRender::renderBand(BandDesignIntf *patternBand, BandDesign
} else { } else {
savePage(); savePage();
startNewPage(); startNewPage();
if (!bandIsSliced){
delete bandClone;
bandClone = renderData(patternBand);
}
} }
if (!registerBand(bandClone)) { if (!registerBand(bandClone)) {
BandDesignIntf* upperPart = dynamic_cast<BandDesignIntf*>(bandClone->cloneUpperPart(m_maxHeightByColumn[m_currentColumn])); BandDesignIntf* upperPart = dynamic_cast<BandDesignIntf*>(bandClone->cloneUpperPart(m_maxHeightByColumn[m_currentColumn]));