From c42d87b1463c7cb19c05e7e3a1d541a07ecc68bc Mon Sep 17 00:00:00 2001 From: Arin Alex Date: Sat, 28 Oct 2017 01:19:39 +0300 Subject: [PATCH] enndlessHeight added --- limereport/lrpageitemdesignintf.cpp | 13 ++++++++++++- limereport/lrpageitemdesignintf.h | 6 ++++++ limereport/lrreportrender.cpp | 10 ++++++++-- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/limereport/lrpageitemdesignintf.cpp b/limereport/lrpageitemdesignintf.cpp index 269244e..f1e654b 100644 --- a/limereport/lrpageitemdesignintf.cpp +++ b/limereport/lrpageitemdesignintf.cpp @@ -63,7 +63,8 @@ PageItemDesignIntf::PageItemDesignIntf(const PageSize pageSize, const QRectF &re m_topMargin(0), m_bottomMargin(0), m_leftMargin(0), m_rightMargin(0), m_pageOrientaion(Portrait), m_pageSize(pageSize), m_sizeChainging(false), m_fullPage(false), m_oldPrintMode(false), m_resetPageNumber(false), - m_isExtendedInDesignMode(false), m_extendedHeight(1000), m_isTOC(false) + m_isExtendedInDesignMode(false), m_extendedHeight(1000), m_isTOC(false), + m_endlessHeight(false) { setFixedPos(true); setPossibleResizeDirectionFlags(Fixed); @@ -331,6 +332,16 @@ void PageItemDesignIntf::initColumnsPos(QVector &posByColumns, qreal pos, } } +bool PageItemDesignIntf::endlessHeight() const +{ + return m_endlessHeight; +} + +void PageItemDesignIntf::setEndlessHeight(bool endlessPage) +{ + m_endlessHeight = endlessPage; +} + bool PageItemDesignIntf::getSetPageSizeToPrinter() const { return m_setPageSizeToPrinter; diff --git a/limereport/lrpageitemdesignintf.h b/limereport/lrpageitemdesignintf.h index af023cc..93df860 100644 --- a/limereport/lrpageitemdesignintf.h +++ b/limereport/lrpageitemdesignintf.h @@ -57,6 +57,8 @@ class PageItemDesignIntf : public LimeReport::ItemsContainerDesignInft Q_PROPERTY(int extendedHeight READ extendedHeight WRITE setExtendedHeight) Q_PROPERTY(bool pageIsTOC READ isTOC WRITE setIsTOC) Q_PROPERTY(bool setPageSizeToPrinter READ getSetPageSizeToPrinter WRITE setSetPageSizeToPrinter ) + Q_PROPERTY(bool endlessHeight READ endlessHeight WRITE setEndlessHeight) + friend class ReportRender; public: enum Orientation { Portrait, Landscape }; @@ -133,6 +135,9 @@ public: bool getSetPageSizeToPrinter() const; void setSetPageSizeToPrinter(bool setPageSizeToPrinter); + bool endlessHeight() const; + void setEndlessHeight(bool endlessHeight); + signals: void beforeFirstPageRendered(); void afterLastPageRendered(); @@ -169,6 +174,7 @@ private: int m_extendedHeight; bool m_isTOC; bool m_setPageSizeToPrinter; + bool m_endlessHeight; }; typedef QList ReportPages; diff --git a/limereport/lrreportrender.cpp b/limereport/lrreportrender.cpp index 4e8be0f..906f72f 100644 --- a/limereport/lrreportrender.cpp +++ b/limereport/lrreportrender.cpp @@ -949,7 +949,7 @@ bool ReportRender::registerBand(BandDesignIntf *band, bool registerInChildren) } - if (band->height() <= m_maxHeightByColumn[m_currentColumn]){ + if (band->height() <= m_maxHeightByColumn[m_currentColumn] || m_patternPageItem->endlessHeight()){ if (band->bandType()==BandDesignIntf::PageFooter){ for (int i=0;isetCurrentPage(m_renderPageItem); emit m_patternPageItem->afterRender(); if (isLast) emit m_patternPageItem->afterLastPageRendered(); - + if (isLast && m_patternPageItem->endlessHeight()){ + qreal pageHeight = 0; + foreach (BandDesignIntf* band, m_renderPageItem->bands()) { + pageHeight += band->height(); + } + m_renderPageItem->setHeight(pageHeight+10+(m_patternPageItem->topMargin()+m_patternPageItem->bottomMargin())*Const::mmFACTOR); + } } QString ReportRender::toString()