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

Finish 1.4.89

This commit is contained in:
Arin Alexander 2018-07-13 02:25:20 +03:00
commit 329ac09db2
5 changed files with 44 additions and 5 deletions

View File

@ -105,7 +105,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc
LIMEREPORT_VERSION_MAJOR = 1
LIMEREPORT_VERSION_MINOR = 4
LIMEREPORT_VERSION_RELEASE = 88
LIMEREPORT_VERSION_RELEASE = 89
LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}'
DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\"

View File

@ -398,6 +398,19 @@ int BandDesignIntf::minChildIndex(BandDesignIntf::BandsType bandType){
return curIndex;
}
int BandDesignIntf::minChildIndex(QSet<BandDesignIntf::BandsType> ignoredBands)
{
int curIndex = bandIndex();
foreach(BandDesignIntf* childBand, childBands()){
if (!ignoredBands.contains(childBand->bandType()) && childBand->bandIndex() < bandIndex()){
curIndex = std::min(curIndex, childBand->maxChildIndex(ignoredBands));
}
}
return curIndex;
}
QList<BandDesignIntf *> BandDesignIntf::childrenByType(BandDesignIntf::BandsType type)
{
QList<BandDesignIntf*> resList;

View File

@ -173,6 +173,7 @@ public:
bool isConnectedToBand(BandDesignIntf::BandsType bandType) const;
int minChildIndex(BandsType bandType);
int minChildIndex(QSet<BandsType> ignoredBands = QSet<BandDesignIntf::BandsType>());
int maxChildIndex(BandDesignIntf::BandsType bandType) const;
int maxChildIndex(QSet<BandsType> ignoredBands = QSet<BandDesignIntf::BandsType>()) const;

View File

@ -1001,7 +1001,9 @@ void BaseDesignIntf::setGeometryProperty(QRectF rect)
setWidth(rect.width());
if (rect.height() != geometry().height())
setHeight(rect.height());
if (!isLoading()) notify("geometry",oldValue,rect);
if (!isLoading()) {
notify("geometry",oldValue,rect);
}
}
}

View File

@ -729,9 +729,32 @@ void PageItemDesignIntf::bandGeometryChanged(QObject* object, QRectF newGeometry
}
}
if (curIndex != band->bandIndex()){
int swapIndex = bandToSwap->maxChildIndex();
bandToSwap->changeBandIndex(band->bandIndex(),true);
band->changeBandIndex(swapIndex,true);
int startIndex = std::min(band->minChildIndex(), bandToSwap->minChildIndex());
// int endIndex = std::max(band->maxChildIndex(), bandToSwap->maxChildIndex());
// QList<BandDesignIntf*> bandToMove;
// foreach(BandDesignIntf* curBand, m_bands){
// if (curBand->bandIndex() > endIndex)
// bandToMove.append(curBand);
// }
BandDesignIntf* firstMoveBand = (bandToSwap->bandIndex() > band->bandIndex()) ? bandToSwap: band;
firstMoveBand->changeBandIndex(startIndex, true);
if (firstMoveBand == band){
bandToSwap->changeBandIndex(firstMoveBand->maxChildIndex()+1,true);
} else {
band->changeBandIndex(firstMoveBand->maxChildIndex()+1, true);
}
// int maxNewIndex = std::max(band->maxChildIndex(), bandToSwap->maxChildIndex());
// if (maxNewIndex > endIndex){
// foreach(BandDesignIntf* curBand, bandToMove){
// curBand->setBandIndex(curBand->bandIndex()+(maxNewIndex - endIndex));
// }
// }
}
relocateBands();