From 84c2428dc10cc1699fe2ca94ec09ec9c2f704132 Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Fri, 20 Jul 2018 14:04:53 +0300 Subject: [PATCH] Vertical columns headers fixed --- common.pri | 2 +- limereport/lrreportrender.cpp | 16 +++++++++++----- limereport/lrreportrender.h | 1 + 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/common.pri b/common.pri index 4c68ba1..59b0769 100644 --- a/common.pri +++ b/common.pri @@ -62,7 +62,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MINOR = 4 -LIMEREPORT_VERSION_RELEASE = 94 +LIMEREPORT_VERSION_RELEASE = 95 LIMEREPORT_VERSION = '\\"$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}\\"' DEFINES += LIMEREPORT_VERSION_STR=\"$${LIMEREPORT_VERSION}\" diff --git a/limereport/lrreportrender.cpp b/limereport/lrreportrender.cpp index 28e9882..7084498 100644 --- a/limereport/lrreportrender.cpp +++ b/limereport/lrreportrender.cpp @@ -89,11 +89,11 @@ void ReportRender::rearrangeColumnsItems() { if (isNeedToRearrangeColumnsItems()){ qreal startHeight = columnHeigth(0); - int avg = m_columnedBandItems.size()/m_columnedBandItems[0]->columnsCount(); - for (int i=1;icolumnsCount();++i){ - if (columnItemsCount(i)columnsCount(); + for (int i = 1; i < m_columnedBandItems[0]->columnsCount(); ++i){ + if (columnItemsCount(i) < avg){ int getCount = avg * (m_columnedBandItems[0]->columnsCount()-i) - columnItemsCount(i); - for (int j=0;jsetPos(band->pos().x()+band->width(),m_columnedBandItems[0]->pos().y()); band->setColumnIndex(i); @@ -149,7 +149,7 @@ void ReportRender::renameChildItems(BaseDesignIntf *item){ ReportRender::ReportRender(QObject *parent) :QObject(parent), m_renderPageItem(0), m_pageCount(0), - m_lastDataBand(0), m_lastRenderedFooter(0), m_currentColumn(0), m_newPageStarted(false) + m_lastRenderedHeader(0), m_lastDataBand(0), m_lastRenderedFooter(0), m_currentColumn(0), m_newPageStarted(false) { initColumns(); } @@ -417,6 +417,9 @@ BandDesignIntf* ReportRender::renderBand(BandDesignIntf *patternBand, BandDesign QApplication::processEvents(); if (patternBand){ + if (patternBand->isHeader()) + m_lastRenderedHeader = patternBand; + BandDesignIntf* bandClone = 0; if (bandData){ @@ -473,6 +476,9 @@ BandDesignIntf* ReportRender::renderBand(BandDesignIntf *patternBand, BandDesign bandClone->columnsFillDirection()==BandDesignIntf::VerticalUniform)) { startNewColumn(); + if (patternBand->bandHeader() && patternBand->bandHeader()->columnsCount()>1){ + renderBand(patternBand->bandHeader(), 0, mode); + } } else { savePage(); startNewPage(); diff --git a/limereport/lrreportrender.h b/limereport/lrreportrender.h index a207723..7f3bcef 100644 --- a/limereport/lrreportrender.h +++ b/limereport/lrreportrender.h @@ -178,6 +178,7 @@ private: qreal m_dataAreaSize; qreal m_reportFooterHeight; int m_renderedDataBandCount; + BandDesignIntf* m_lastRenderedHeader; BandDesignIntf* m_lastDataBand; BandDesignIntf* m_lastRenderedFooter; bool m_renderCanceled;