From: vsv Date: Mon, 10 Aug 2020 14:06:38 +0000 (+0300) Subject: bos #19890: Fix wrong initialized type of symmetry operation in property panel X-Git-Tag: V9_6_0a1~21 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b920c09959b52a2f62c387764131606a2ca2cd11;p=modules%2Fshaper.git bos #19890: Fix wrong initialized type of symmetry operation in property panel --- diff --git a/src/ModuleBase/ModuleBase_PagedContainer.cpp b/src/ModuleBase/ModuleBase_PagedContainer.cpp index f821c793f..d96a7c70a 100644 --- a/src/ModuleBase/ModuleBase_PagedContainer.cpp +++ b/src/ModuleBase/ModuleBase_PagedContainer.cpp @@ -34,7 +34,7 @@ static QMap defaultValues; ModuleBase_PagedContainer::ModuleBase_PagedContainer(QWidget* theParent, const Config_WidgetAPI* theData) : ModuleBase_ModelWidget(theParent, theData), - myRemeberChoice(true), myIsFocusOnCurrentPage(false), myIsFirst(true) + myRemeberChoice(true), myIsFocusOnCurrentPage(false) { // it is not obligatory to be ignored when property panel tries to activate next active widget // but if focus is moved to this control, it can accept it. @@ -107,7 +107,7 @@ bool ModuleBase_PagedContainer::restoreValueCustom() aCaseId = QString::fromStdString(aStringAttr->value()); else aCaseId = QString::fromStdString(aDefVal.empty() ? aStringAttr->value() : aDefVal); - if (myIsFirst) + if (!aStringAttr->isInitialized()) storeValueCustom(); int idx = myCaseIds.indexOf(aCaseId); if (idx == -1) @@ -140,7 +140,7 @@ bool ModuleBase_PagedContainer::storeValueCustom() AttributeStringPtr aStringAttr = aData->string(attributeID()); std::string aWidgetValue; - if (myIsFirst) + if (!aStringAttr->isInitialized()) aWidgetValue = myDefValue.empty()? myCaseIds.at(currentPageIndex()).toStdString() : myDefValue; else @@ -148,8 +148,6 @@ bool ModuleBase_PagedContainer::storeValueCustom() myDefValue = aWidgetValue; aStringAttr->setValue(aWidgetValue); - myIsFirst = false; - updateObject(myFeature); // for preview return true; } diff --git a/src/ModuleBase/ModuleBase_PagedContainer.h b/src/ModuleBase/ModuleBase_PagedContainer.h index 9e60263de..0227e4b2f 100644 --- a/src/ModuleBase/ModuleBase_PagedContainer.h +++ b/src/ModuleBase/ModuleBase_PagedContainer.h @@ -92,7 +92,6 @@ class MODULEBASE_EXPORT ModuleBase_PagedContainer : public ModuleBase_ModelWidge bool myIsFocusOnCurrentPage; QStringList myCaseIds; QList myPages; - bool myIsFirst; std::string myDefValue; };