From 7e4e6684c613955a4ac3a334f9228cce5bac4491 Mon Sep 17 00:00:00 2001 From: turbineyan Date: Sun, 27 Dec 2020 18:51:03 +0800 Subject: [PATCH 1/2] 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/2] 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;