From 7e4e6684c613955a4ac3a334f9228cce5bac4491 Mon Sep 17 00:00:00 2001 From: turbineyan Date: Sun, 27 Dec 2020 18:51:03 +0800 Subject: [PATCH 1/3] to fix the crash issue. due to extractAcceptableValue() function was return an empty list --- limereport/items/lralignpropitem.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/limereport/items/lralignpropitem.cpp b/limereport/items/lralignpropitem.cpp index a91c243..990b9ec 100644 --- a/limereport/items/lralignpropitem.cpp +++ b/limereport/items/lralignpropitem.cpp @@ -32,6 +32,8 @@ #include "objectinspector/editors/lrcomboboxeditor.h" #include "lrtextitem.h" +#include + namespace{ LimeReport::ObjectPropItem * createAlignItem( QObject *object, LimeReport::ObjectPropItem::ObjectsList* objects, const QString& name, const QString& displayName, const QVariant& data, LimeReport::ObjectPropItem* parent, bool readonly @@ -160,7 +162,12 @@ QString AlignmentItemEditor::displayValue() const void AlignmentItemEditor::setPropertyValue(QVariant value) { - ObjectPropItem::setPropertyValue(extractAcceptableValue(value.toInt())[0]); + //ObjectPropItem::setPropertyValue(extractAcceptableValue(value.toInt())[0]); + qDebug()<<"value "< _accpepttableValueList= extractAcceptableValue(value.toInt()); + if(_accpepttableValueList.isEmpty()) return; + + ObjectPropItem::setPropertyValue(_accpepttableValueList[0]); } } From e28f4666188595e9633aa3b356beb7db282b9579 Mon Sep 17 00:00:00 2001 From: turbineyan Date: Fri, 1 Jan 2021 23:47:17 +0800 Subject: [PATCH 2/3] to follow the requirement of repo owner, to remove the no use comment and the declaration for including the header file, named qtdebug --- limereport/items/lralignpropitem.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/limereport/items/lralignpropitem.cpp b/limereport/items/lralignpropitem.cpp index 990b9ec..1321b4f 100644 --- a/limereport/items/lralignpropitem.cpp +++ b/limereport/items/lralignpropitem.cpp @@ -32,8 +32,6 @@ #include "objectinspector/editors/lrcomboboxeditor.h" #include "lrtextitem.h" -#include - namespace{ LimeReport::ObjectPropItem * createAlignItem( QObject *object, LimeReport::ObjectPropItem::ObjectsList* objects, const QString& name, const QString& displayName, const QVariant& data, LimeReport::ObjectPropItem* parent, bool readonly @@ -162,8 +160,6 @@ QString AlignmentItemEditor::displayValue() const void AlignmentItemEditor::setPropertyValue(QVariant value) { - //ObjectPropItem::setPropertyValue(extractAcceptableValue(value.toInt())[0]); - qDebug()<<"value "< _accpepttableValueList= extractAcceptableValue(value.toInt()); if(_accpepttableValueList.isEmpty()) return; From 06969990d682482eafe102437e536538e3498743 Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Sun, 10 Jan 2021 23:28:16 +0300 Subject: [PATCH 3/3] Render process signals emitting have been fixed --- common.pri | 2 +- limereport/lrbanddesignintf.h | 4 ++-- limereport/lrbasedesignintf.h | 4 ++-- limereport/lrreportrender.cpp | 9 +++++---- limereport/lrreportrender.h | 2 +- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/common.pri b/common.pri index a27590b..dd4bb53 100644 --- a/common.pri +++ b/common.pri @@ -133,7 +133,7 @@ RCC_DIR = $${ARCH_DIR}/$${BUILD_TYPE}/rcc LIMEREPORT_VERSION_MAJOR = 1 LIMEREPORT_VERSION_MINOR = 5 -LIMEREPORT_VERSION_RELEASE = 76 +LIMEREPORT_VERSION_RELEASE = 78 LIMEREPORT_VERSION = '$${LIMEREPORT_VERSION_MAJOR}.$${LIMEREPORT_VERSION_MINOR}.$${LIMEREPORT_VERSION_RELEASE}' DEFINES *= LIMEREPORT_VERSION_STR=\\\"$${LIMEREPORT_VERSION}\\\" diff --git a/limereport/lrbanddesignintf.h b/limereport/lrbanddesignintf.h index 3ee6e42..59bec04 100644 --- a/limereport/lrbanddesignintf.h +++ b/limereport/lrbanddesignintf.h @@ -274,8 +274,8 @@ public: bool isNeedUpdateSize(RenderPass) const; void copyBandAttributes(BandDesignIntf* source); signals: - void bandRendered(LimeReport::BandDesignIntf* band); - void bandReRendered(LimeReport::BandDesignIntf* oldBand, LimeReport::BandDesignIntf* newBand); + void bandRendered(BandDesignIntf* band); + void bandReRendered(BandDesignIntf* oldBand, BandDesignIntf* newBand); void preparedForRender(); void bandRegistred(); protected: diff --git a/limereport/lrbasedesignintf.h b/limereport/lrbasedesignintf.h index 1b419a4..8592c0b 100644 --- a/limereport/lrbasedesignintf.h +++ b/limereport/lrbasedesignintf.h @@ -480,8 +480,8 @@ signals: void propertyChanged(const QString& propertName, const QVariant& oldValue,const QVariant& newValue); void propertyObjectNameChanged(const QString& oldValue, const QString& newValue); void propertyesChanged(QVector propertyNames); - void itemAlignChanged(LimeReport::BaseDesignIntf* item, const LimeReport::BaseDesignIntf::ItemAlign& oldValue, const LimeReport::BaseDesignIntf::ItemAlign& newValue); - void itemVisibleHasChanged(LimeReport::BaseDesignIntf* item); + void itemAlignChanged(BaseDesignIntf* item, const BaseDesignIntf::ItemAlign& oldValue, const BaseDesignIntf::ItemAlign& newValue); + void itemVisibleHasChanged(BaseDesignIntf* item); void beforeRender(); void afterData(); void afterRender(); diff --git a/limereport/lrreportrender.cpp b/limereport/lrreportrender.cpp index 052fdba..0f02a73 100644 --- a/limereport/lrreportrender.cpp +++ b/limereport/lrreportrender.cpp @@ -505,7 +505,6 @@ BandDesignIntf* ReportRender::renderBand(BandDesignIntf *patternBand, BandDesign bandClone->setBackgroundColor(makeBackgroundColor(patternBand)); patternBand->emitBandRendered(bandClone); m_scriptEngineContext->setCurrentBand(bandClone); - emit(patternBand->afterRender()); if ( isLast && bandClone->keepFooterTogether() && bandClone->sliceLastRow() ){ if (m_maxHeightByColumn[m_currentColumn] < (bandClone->height()+m_reportFooterHeight)) @@ -549,7 +548,7 @@ BandDesignIntf* ReportRender::renderBand(BandDesignIntf *patternBand, BandDesign savePage(); startNewPage(); if (!bandIsSliced){ - BandDesignIntf* t = renderData(patternBand); + BandDesignIntf* t = renderData(patternBand, false); t->copyBandAttributes(bandClone); patternBand->emitBandReRendered(bandClone, t); delete bandClone; @@ -577,6 +576,7 @@ BandDesignIntf* ReportRender::renderBand(BandDesignIntf *patternBand, BandDesign if (patternBand->isFooter()) datasources()->clearGroupFunctionValues(patternBand->objectName()); + emit(patternBand->afterRender()); return bandClone; } return 0; @@ -1259,13 +1259,14 @@ BandDesignIntf *ReportRender::saveUppperPartReturnBottom(BandDesignIntf *band, i return bottomBandPart; } -BandDesignIntf *ReportRender::renderData(BandDesignIntf *patternBand) +BandDesignIntf *ReportRender::renderData(BandDesignIntf *patternBand, bool emitBeforeRender) { BandDesignIntf* bandClone = dynamic_cast(patternBand->cloneItem(PreviewMode)); m_scriptEngineContext->baseDesignIntfToScript(patternBand->parent()->objectName(), bandClone); m_scriptEngineContext->setCurrentBand(bandClone); - emit(patternBand->beforeRender()); + if (emitBeforeRender) + emit(patternBand->beforeRender()); if (patternBand->isFooter()){ replaceGroupsFunction(bandClone); diff --git a/limereport/lrreportrender.h b/limereport/lrreportrender.h index 104f8c2..46a35d0 100644 --- a/limereport/lrreportrender.h +++ b/limereport/lrreportrender.h @@ -169,7 +169,7 @@ private: BandDesignIntf *sliceBand(BandDesignIntf* band, BandDesignIntf *patternBand, bool isLast); BandDesignIntf* saveUppperPartReturnBottom(BandDesignIntf *band, int height, BandDesignIntf *patternBand); - BandDesignIntf* renderData(BandDesignIntf* patternBand); + BandDesignIntf* renderData(BandDesignIntf* patternBand, bool emitBeforeRender = true); void startNewColumn(); void startNewPage(bool isFirst = false); void resetPageNumber(ResetPageNuberType resetType);