From 05be6e6729cacaf540b5b70132b2fe3c75e4f86c Mon Sep 17 00:00:00 2001 From: Matej Sekoranja Date: Mon, 20 Aug 2012 09:22:27 +0200 Subject: [PATCH] append/remove fields now preserves ID --- pvDataApp/factory/FieldCreateFactory.cpp | 4 ++-- pvDataApp/factory/PVStructure.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pvDataApp/factory/FieldCreateFactory.cpp b/pvDataApp/factory/FieldCreateFactory.cpp index 4bc020f..d1c205e 100644 --- a/pvDataApp/factory/FieldCreateFactory.cpp +++ b/pvDataApp/factory/FieldCreateFactory.cpp @@ -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); } diff --git a/pvDataApp/factory/PVStructure.cpp b/pvDataApp/factory/PVStructure.cpp index 1f4c534..9e6b084 100644 --- a/pvDataApp/factory/PVStructure.cpp +++ b/pvDataApp/factory/PVStructure.cpp @@ -193,7 +193,7 @@ void PVStructure::removePVField(String fieldName) } PVFieldPtrArray * xxx = const_cast(&pvFields); xxx->swap(newPVFields); - FieldConstPtr field = getFieldCreate()->createStructure(newFieldNames,fields); + FieldConstPtr field = getFieldCreate()->createStructure(structurePtr->getID(),newFieldNames,fields); replaceField(field); structurePtr = static_pointer_cast(field); StringArray fieldNames = structurePtr->getFieldNames();