From 457b5e1d4368db3aead4592ad2b254bc47949f51 Mon Sep 17 00:00:00 2001 From: mpv Date: Tue, 16 Aug 2016 15:23:21 +0300 Subject: [PATCH] Improve the copy feature: make initialized attributes and internal content due in accordance with the attributes stored in the data tree --- src/Model/Model_Data.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/Model/Model_Data.cpp b/src/Model/Model_Data.cpp index 60714f8be..7fb08b88d 100644 --- a/src/Model/Model_Data.cpp +++ b/src/Model/Model_Data.cpp @@ -638,15 +638,10 @@ void Model_Data::copyTo(std::shared_ptr theTarget) { TDF_Label aTargetRoot = std::dynamic_pointer_cast(theTarget)->label(); copyAttrs(myLab, aTargetRoot); - // make initialized the initialized attributes - std::map >::iterator aMyIter = myAttrs.begin(); - for(; aMyIter != myAttrs.end(); aMyIter++) { - if (aMyIter->second->isInitialized()) { - AttributePtr aTargetAttr = theTarget->attribute(aMyIter->first); - if (aTargetAttr) - aTargetAttr->setInitialized(); - } - } + // reinitialize Model_Attributes by TDF_Attributes set + std::shared_ptr aTData = std::dynamic_pointer_cast(theTarget); + aTData->myAttrs.clear(); + theTarget->owner()->initAttributes(); // reinit feature attributes } bool Model_Data::isInHistory() -- 2.39.2