mirror of
https://github.com/fralx/LimeReport.git
synced 2024-12-25 17:14:40 +03:00
Band relocation fixed
This commit is contained in:
parent
74341166be
commit
08bfc160b8
@ -569,7 +569,8 @@ void PageItemDesignIntf::bandDeleted(QObject *band)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PageItemDesignIntf::swapBands(BandDesignIntf* band, BandDesignIntf* bandToSwap){
|
void PageItemDesignIntf::swapBands(BandDesignIntf* band, BandDesignIntf* bandToSwap){
|
||||||
int startIndex = std::min(band->minChildIndex(), bandToSwap->minChildIndex());
|
int firstStartIndex = std::min(band->minChildIndex(), bandToSwap->minChildIndex());
|
||||||
|
int secondStartIndex = std::max(band->minChildIndex(), bandToSwap->minChildIndex());
|
||||||
|
|
||||||
// int endIndex = std::max(band->maxChildIndex(), bandToSwap->maxChildIndex());
|
// int endIndex = std::max(band->maxChildIndex(), bandToSwap->maxChildIndex());
|
||||||
// QList<BandDesignIntf*> bandToMove;
|
// QList<BandDesignIntf*> bandToMove;
|
||||||
@ -580,11 +581,11 @@ void PageItemDesignIntf::swapBands(BandDesignIntf* band, BandDesignIntf* bandToS
|
|||||||
|
|
||||||
BandDesignIntf* firstMoveBand = (bandToSwap->bandIndex() > band->bandIndex()) ? bandToSwap: band;
|
BandDesignIntf* firstMoveBand = (bandToSwap->bandIndex() > band->bandIndex()) ? bandToSwap: band;
|
||||||
|
|
||||||
firstMoveBand->changeBandIndex(startIndex, true);
|
firstMoveBand->changeBandIndex(firstStartIndex, true);
|
||||||
if (firstMoveBand == band){
|
if (firstMoveBand == band){
|
||||||
bandToSwap->changeBandIndex(firstMoveBand->maxChildIndex()+1,true);
|
bandToSwap->changeBandIndex(secondStartIndex,true);
|
||||||
} else {
|
} else {
|
||||||
band->changeBandIndex(firstMoveBand->maxChildIndex()+1, true);
|
band->changeBandIndex(secondStartIndex, true);
|
||||||
}
|
}
|
||||||
relocateBands();
|
relocateBands();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user