mirror of
https://github.com/python-LimeReport/LimeReport.git
synced 2024-12-24 12:34:39 +03:00
Finish endless_optimization
This commit is contained in:
parent
8dedda7c9c
commit
d6fe74e29e
@ -1,5 +1,6 @@
|
||||
#include "lritemscontainerdesignitf.h"
|
||||
#include "lritemdesignintf.h"
|
||||
#include "lrbanddesignintf.h"
|
||||
|
||||
namespace LimeReport {
|
||||
|
||||
@ -37,10 +38,14 @@ bool itemSortContainerLessThen(const PItemSortContainer c1, const PItemSortConta
|
||||
else return c1->m_rect.y()<c2->m_rect.y();
|
||||
}
|
||||
|
||||
void ItemsContainerDesignInft::snapshotItemsLayout()
|
||||
void ItemsContainerDesignInft::snapshotItemsLayout(SnapshotType type)
|
||||
{
|
||||
m_containerItems.clear();
|
||||
foreach(BaseDesignIntf *childItem,childBaseItems()){
|
||||
foreach(BaseDesignIntf *childItem, childBaseItems()){
|
||||
if (type == IgnoreBands){
|
||||
if (!dynamic_cast<BandDesignIntf*>(childItem))
|
||||
m_containerItems.append(PItemSortContainer(new ItemSortContainer(childItem)));
|
||||
} else
|
||||
m_containerItems.append(PItemSortContainer(new ItemSortContainer(childItem)));
|
||||
}
|
||||
qSort(m_containerItems.begin(),m_containerItems.end(),itemSortContainerLessThen);
|
||||
|
@ -42,8 +42,9 @@ class ItemsContainerDesignInft : public BookmarkContainerDesignIntf{
|
||||
public:
|
||||
ItemsContainerDesignInft(const QString& xmlTypeName, QObject* owner = 0, QGraphicsItem* parent=0):
|
||||
BookmarkContainerDesignIntf(xmlTypeName, owner, parent){}
|
||||
enum SnapshotType{Full, IgnoreBands};
|
||||
protected:
|
||||
void snapshotItemsLayout();
|
||||
void snapshotItemsLayout(SnapshotType type = Full);
|
||||
void arrangeSubItems(RenderPass pass, DataSourceManager *dataManager, ArrangeType type = AsNeeded);
|
||||
qreal findMaxBottom() const;
|
||||
qreal findMaxHeight() const;
|
||||
|
@ -131,6 +131,7 @@ BaseDesignIntf *PageItemDesignIntf::createSameTypeItem(QObject *owner, QGraphics
|
||||
void PageItemDesignIntf::geometryChangedEvent(QRectF newRect, QRectF)
|
||||
{
|
||||
Q_UNUSED(newRect)
|
||||
if (itemMode() == DesignMode || !endlessHeight())
|
||||
updateMarginRect();
|
||||
PageSize oldSize = m_pageSize;
|
||||
if (!m_sizeChainging && !isLoading())
|
||||
@ -490,8 +491,10 @@ void PageItemDesignIntf::setResetPageNumber(bool resetPageNumber)
|
||||
|
||||
void PageItemDesignIntf::updateSubItemsSize(RenderPass pass, DataSourceManager *dataManager)
|
||||
{
|
||||
snapshotItemsLayout();
|
||||
if (!endlessHeight()){
|
||||
snapshotItemsLayout(IgnoreBands);
|
||||
arrangeSubItems(pass, dataManager);
|
||||
}
|
||||
}
|
||||
|
||||
bool PageItemDesignIntf::oldPrintMode() const
|
||||
|
Loading…
Reference in New Issue
Block a user