append/remove fields now preserves ID

This commit is contained in:
Matej Sekoranja
2012-08-20 09:22:27 +02:00
parent 156a05079e
commit 05be6e6729
2 changed files with 3 additions and 3 deletions

View File

@@ -362,7 +362,7 @@ StructureConstPtr FieldCreate::appendField(
}
newNames[oldLen] = fieldName;
newFields[oldLen] = field;
return createStructure(newNames,newFields);
return createStructure(structure->getID(),newNames,newFields);
}
StructureConstPtr FieldCreate::appendFields(
@@ -384,7 +384,7 @@ StructureConstPtr FieldCreate::appendFields(
newNames[oldLen +i] = fieldNames[i];
newFields[oldLen +i] = fields[i];
}
return createStructure(newNames,newFields);
return createStructure(structure->getID(),newNames,newFields);
}

View File

@@ -193,7 +193,7 @@ void PVStructure::removePVField(String fieldName)
}
PVFieldPtrArray * xxx = const_cast<PVFieldPtrArray *>(&pvFields);
xxx->swap(newPVFields);
FieldConstPtr field = getFieldCreate()->createStructure(newFieldNames,fields);
FieldConstPtr field = getFieldCreate()->createStructure(structurePtr->getID(),newFieldNames,fields);
replaceField(field);
structurePtr = static_pointer_cast<const Structure>(field);
StringArray fieldNames = structurePtr->getFieldNames();