From 380a448dd1bef80f444d7f4a0cbb7f4d887393ad Mon Sep 17 00:00:00 2001 From: wmayer Date: Fri, 17 Jul 2020 23:07:06 +0200 Subject: [PATCH] PVS: V560 A part of conditional expression is always true --- src/Gui/propertyeditor/PropertyItem.cpp | 30 ++++++++++++++++--------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/src/Gui/propertyeditor/PropertyItem.cpp b/src/Gui/propertyeditor/PropertyItem.cpp index cfc620bbc8..8c793c1e21 100644 --- a/src/Gui/propertyeditor/PropertyItem.cpp +++ b/src/Gui/propertyeditor/PropertyItem.cpp @@ -344,46 +344,54 @@ QVariant PropertyItem::decoration(const QVariant&) const QVariant PropertyItem::toString(const QVariant& prop) const { - if(prop != QVariant() || propertyItems.size()!=1) + if (prop != QVariant() || propertyItems.size()!=1) return prop; + Base::PyGILStateLocker lock; - Py::Object pyobj(propertyItems[0]->getPyObject(),true); + Py::Object pyobj(propertyItems[0]->getPyObject(), true); std::ostringstream ss; - if(pyobj.isNone()) + if (pyobj.isNone()) { ss << ""; + } else if(pyobj.isSequence()) { ss << '['; Py::Sequence seq(pyobj); bool first = true; size_t i=0; - for(i=0;i<2 && i