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

Bands relocation has been fixed

This commit is contained in:
Arin Alexander 2018-12-21 19:05:31 +03:00
parent 37cbc134d1
commit 533eb7efa0
2 changed files with 15 additions and 10 deletions

View File

@ -372,7 +372,7 @@ int BandDesignIntf::maxChildIndex(BandDesignIntf::BandsType bandType) const{
int BandDesignIntf::maxChildIndex(QSet<BandDesignIntf::BandsType> ignoredBands) const{
int curIndex = bandIndex();
foreach(BandDesignIntf* childBand, childBands()){
if (!ignoredBands.contains(childBand->bandType()) && childBand->bandIndex()>bandIndex()){
if (!ignoredBands.contains(childBand->bandType())){
curIndex = std::max(curIndex,childBand->maxChildIndex(ignoredBands));
}
}

View File

@ -201,18 +201,23 @@ int PageItemDesignIntf::calcBandIndex(BandDesignIntf::BandsType bandType, BandDe
int bandIndex=-1;
qSort(m_bands.begin(),m_bands.end(),bandSortBandLessThenByIndex);
if (bandType != BandDesignIntf::Data){
foreach(BandDesignIntf* band,m_bands){
if ((band->bandType() == BandDesignIntf::GroupHeader) && ( band->bandType() > bandType)) break;
if ((band->bandType() <= bandType)){
if (bandIndex <= band->bandIndex()) {
if (bandType != BandDesignIntf::Data){
bandIndex=band->maxChildIndex(bandType)+1;
} else {
bandIndex=band->maxChildIndex()+1;
}
}
} else { increaseBandIndex = true; break;}
}
} else {
int maxChildIndex = 0;
foreach(BandDesignIntf* band, m_bands){
if (band->bandType() == BandDesignIntf::Data)
maxChildIndex = std::max(maxChildIndex, band->maxChildIndex());
}
bandIndex = std::max(bandIndex, maxChildIndex+1);
}
if (bandIndex==-1) {
bandIndex = (int)(bandType);