append/remove fields now preserves ID
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user