#5310 Fix wrong use of new path id.

Used last used instead of first unused
This commit is contained in:
Jacob Støren
2020-01-08 09:35:14 +01:00
parent 45a3225ec8
commit e9086005d4
2 changed files with 12 additions and 10 deletions

View File

@@ -193,7 +193,7 @@ protected:
private:
template <typename T>
void fieldContentsByType( caf::PdmObjectHandle* object, std::vector<T*>& typedFields );
void fieldContentsByType( caf::PdmObjectHandle* object, std::vector<T*>& fieldContents );
void transferPathsToGlobalPathList();
void distributePathsFromGlobalPathList();
@@ -225,7 +225,7 @@ private:
///
//--------------------------------------------------------------------------------------------------
template <typename T>
void RimProject::fieldContentsByType( caf::PdmObjectHandle* object, std::vector<T*>& typedFields )
void RimProject::fieldContentsByType( caf::PdmObjectHandle* object, std::vector<T*>& fieldContents )
{
if ( !object ) return;
@@ -237,14 +237,14 @@ void RimProject::fieldContentsByType( caf::PdmObjectHandle* object, std::vector<
for ( const auto& field : allFieldsInObject )
{
caf::PdmField<T>* typedField = dynamic_cast<caf::PdmField<T>*>( field );
if ( typedField ) typedFields.push_back( &typedField->v() );
if ( typedField ) fieldContents.push_back( &typedField->v() );
caf::PdmField<std::vector<T>>* typedFieldInVector = dynamic_cast<caf::PdmField<std::vector<T>>*>( field );
if ( typedFieldInVector )
{
for ( T& typedFieldFromVector : typedFieldInVector->v() )
{
typedFields.push_back( &typedFieldFromVector );
fieldContents.push_back( &typedFieldFromVector );
}
}
@@ -253,6 +253,6 @@ void RimProject::fieldContentsByType( caf::PdmObjectHandle* object, std::vector<
for ( const auto& child : children )
{
fieldContentsByType( child, typedFields );
fieldContentsByType( child, fieldContents );
}
}