diff --git a/common.pri b/common.pri index 6439752..a37bc09 100644 --- a/common.pri +++ b/common.pri @@ -127,7 +127,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MINOR = 5 -LIMEREPORT_VERSION_RELEASE = 24 +LIMEREPORT_VERSION_RELEASE = 25 LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}' DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\" diff --git a/limereport/items/lrchartitem.cpp b/limereport/items/lrchartitem.cpp index 73565d4..df86704 100644 --- a/limereport/items/lrchartitem.cpp +++ b/limereport/items/lrchartitem.cpp @@ -85,6 +85,8 @@ SeriesItem *SeriesItem::clone() void SeriesItem::fillSeriesData(IDataSource *dataSource) { + m_data.clear(); + if (dataSource){ dataSource->first(); int currentColorIndex = 0; @@ -724,7 +726,7 @@ void VerticalBarChart::paintVerticalBars(QPainter *painter, QRectF barsRect) } barSeriesCount = (m_chartItem->itemMode()==DesignMode) ? seriesCount() : barSeriesCount; - + if (barSeriesCount < 1) return; painter->save(); painter->setRenderHint(QPainter::Antialiasing,false); @@ -770,7 +772,7 @@ void VerticalBarChart::paintSerialLines(QPainter* painter, QRectF barsRect) qreal hStep = (barsRect.width() / valuesCount()); qreal topShift = (delta - (maxValue()-minValue())) * vStep +barsRect.top(); - if (!m_chartItem->series().isEmpty() && !m_chartItem->series().at(0)->data()->labels().isEmpty()){ + if (!m_chartItem->series().isEmpty()){ foreach (SeriesItem* series, m_chartItem->series()) { if (series->preferredType() == SeriesItem::Line){ QPen pen(series->color()); @@ -859,7 +861,7 @@ qreal AbstractSeriesChart::minValue() int AbstractSeriesChart::valuesCount() { if (m_chartItem->itemMode()==DesignMode) return 3; - return (m_chartItem->series().isEmpty())?(0):(m_chartItem->series().at(0)->data()->labels().count()); + return (m_chartItem->series().isEmpty())?(0):(m_chartItem->series().at(0)->data()->values().count()); } int AbstractSeriesChart::seriesCount() diff --git a/limereport/items/lrchartitem.h b/limereport/items/lrchartitem.h index 5af5213..ee38f6b 100644 --- a/limereport/items/lrchartitem.h +++ b/limereport/items/lrchartitem.h @@ -16,6 +16,7 @@ public: QList& values(){ return m_values;} QList& labels(){ return m_labels;} QList& colors() { return m_colors;} + void clear(){ m_values.clear(); m_labels.clear(); m_colors.clear(); } private: QList m_values; QList m_labels; @@ -189,7 +190,7 @@ protected: void paintChartTitle(QPainter* painter, QRectF titleRect); virtual BaseDesignIntf* createSameTypeItem(QObject *owner, QGraphicsItem *parent); //ICollectionContainer - QObject* createElement(const QString& collectionName,const QString& elementType); + QObject* createElement(const QString& collectionName, const QString& elementType); int elementsCount(const QString& collectionName); QObject* elementAt(const QString& collectionName,int index); void collectionLoadFinished(const QString& collectionName){Q_UNUSED(collectionName)} @@ -199,7 +200,6 @@ protected: bool isNeedUpdateSize(RenderPass pass) const; private: QList m_series; -// QList< QPointer > m_series; QString m_datasource; QPixmap m_chartImage; QString m_title; diff --git a/limereport/lrreportrender.cpp b/limereport/lrreportrender.cpp index f0a4c5a..49af8cc 100644 --- a/limereport/lrreportrender.cpp +++ b/limereport/lrreportrender.cpp @@ -1183,7 +1183,7 @@ void ReportRender::updateTOC(BaseDesignIntf* item, int pageNumber){ void ReportRender::secondRenderPass(ReportPages renderedPages) { if (!m_scriptEngineContext->tableOfContents()->isEmpty()){ - for(int i=0; ichildBaseItems()){ @@ -1192,12 +1192,13 @@ void ReportRender::secondRenderPass(ReportPages renderedPages) } } - for(int i=0; isetReportVariable("#PAGE",m_pagesRanges.findPageNumber(i)); m_datasources->setReportVariable("#PAGE_COUNT",m_pagesRanges.findLastPageNumber(i)); foreach(BaseDesignIntf* item, page->childBaseItems()){ - item->updateItemSize(m_datasources, SecondPass); + if (item->isNeedUpdateSize(SecondPass)) + item->updateItemSize(m_datasources, SecondPass); } } }