From 564cd05d147db7d0de6e9ca0e935328e04a6139c Mon Sep 17 00:00:00 2001 From: azv Date: Wed, 18 Mar 2015 15:14:40 +0300 Subject: [PATCH] Fix by MPV --- src/Model/Model_Data.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Model/Model_Data.cpp b/src/Model/Model_Data.cpp index 477bf0e83..82cc25918 100644 --- a/src/Model/Model_Data.cpp +++ b/src/Model/Model_Data.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include @@ -317,7 +318,7 @@ static void copyAttrs(TDF_Label theSource, TDF_Label theDestination) { aTargetAttr = anAttrIter.Value()->NewEmpty(); theDestination.AddAttribute(aTargetAttr); } - Handle(TDF_RelocationTable) aRelocTable; // no relocation, empty map + Handle(TDF_RelocationTable) aRelocTable = new TDF_RelocationTable(); // no relocation, empty map anAttrIter.Value()->Paste(aTargetAttr, aRelocTable); } // copy the sub-labels content @@ -331,4 +332,11 @@ 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()) { + theTarget->attribute(aMyIter->first)->setInitialized(); + } + } } -- 2.39.2