X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModel%2FModel_AttributeSelectionList.cpp;h=07e62e2bcf45bcad212b5e9c1995413d16e13bf7;hb=77b93142eb8ba33bfb9a42040c2fd8926ffea5c8;hp=1d4725c2279bf61389136e007d5ed532a5636fd0;hpb=54af887c1203416f38576cbdbcde6e539142a079;p=modules%2Fshaper.git diff --git a/src/Model/Model_AttributeSelectionList.cpp b/src/Model/Model_AttributeSelectionList.cpp index 1d4725c22..07e62e2bc 100644 --- a/src/Model/Model_AttributeSelectionList.cpp +++ b/src/Model/Model_AttributeSelectionList.cpp @@ -43,6 +43,10 @@ void Model_AttributeSelectionList::append( aNewAttr->setID(id()); mySize->Set(aNewTag); aNewAttr->setValue(theContext, theSubShape, theTemporarily); + if (theTemporarily) + myTmpAttr = aNewAttr; + else + myTmpAttr.reset(); owner()->data()->sendAttributeUpdated(this); } @@ -72,6 +76,7 @@ void Model_AttributeSelectionList::removeLast() aOldAttr->setObject(owner()); REMOVE_BACK_REF(aOldAttr->context()); aLab.ForgetAllAttributes(Standard_True); + myTmpAttr.reset(); owner()->data()->sendAttributeUpdated(this); } } @@ -94,6 +99,9 @@ void Model_AttributeSelectionList::setSelectionType(const std::string& theType) std::shared_ptr Model_AttributeSelectionList::value(const int theIndex) { + if (myTmpAttr.get() && theIndex == size() - 1) { + return myTmpAttr; + } TDF_Label aLabel = mySize->Label().FindChild(theIndex + 1); // create a new attribute each time, by demand // supporting of old attributes is too slow (synch each time) and buggy on redo @@ -110,6 +118,7 @@ void Model_AttributeSelectionList::clear() { if (mySize->Get() != 0) { mySize->Set(0); + myTmpAttr.reset(); TDF_ChildIterator aSubIter(mySize->Label()); for(; aSubIter.More(); aSubIter.Next()) { TDF_Label aLab = aSubIter.Value();