0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-25 00:54:39 +03:00

checkLostHeadersInPrevColumn() has been added

This commit is contained in:
Arin Alexander 2019-02-19 15:44:23 +03:00
parent 243fcc8fe3
commit b5f2f50993
2 changed files with 34 additions and 0 deletions

View File

@ -1201,6 +1201,7 @@ BandDesignIntf *ReportRender::renderData(BandDesignIntf *patternBand)
void ReportRender::startNewColumn(){ void ReportRender::startNewColumn(){
if (m_currentColumn < m_maxHeightByColumn.size()-1){ if (m_currentColumn < m_maxHeightByColumn.size()-1){
m_currentColumn++; m_currentColumn++;
checkLostHeadersInPrevColumn();
} else { } else {
savePage(); savePage();
startNewPage(); startNewPage();
@ -1339,6 +1340,38 @@ void ReportRender::checkLostHeadersOnPrevPage()
} }
void ReportRender::checkLostHeadersInPrevColumn()
{
QVector<BandDesignIntf*> lostHeaders;
QMutableListIterator<BandDesignIntf*>it(m_renderPageItem->bands());
it.toBack();
if (it.hasPrevious()){
if (it.previous()->isFooter()){
if (it.hasPrevious()) it.previous();
else return;
}
}
while (it.hasPrevious()){
if (it.value()->isHeader()){
if (it.value()->reprintOnEachPage()){
delete it.value();
} else { lostHeaders.append(it.value());}
it.remove();
it.previous();
} else break;
}
if (lostHeaders.size() > 0){
qSort(lostHeaders.begin(), lostHeaders.end(), bandLessThen);
foreach(BandDesignIntf* header, lostHeaders){
registerBand(header);
}
}
}
BandDesignIntf* ReportRender::findEnclosingGroup() BandDesignIntf* ReportRender::findEnclosingGroup()
{ {
BandDesignIntf* result=0; BandDesignIntf* result=0;

View File

@ -157,6 +157,7 @@ private:
void checkFooterGroup(BandDesignIntf* groupBand); void checkFooterGroup(BandDesignIntf* groupBand);
void pasteGroups(); void pasteGroups();
void checkLostHeadersOnPrevPage(); void checkLostHeadersOnPrevPage();
void checkLostHeadersInPrevColumn();
BandDesignIntf* findEnclosingGroup(); BandDesignIntf* findEnclosingGroup();
bool registerBand(BandDesignIntf* band, bool registerInChildren=true); bool registerBand(BandDesignIntf* band, bool registerInChildren=true);