make sure only one record field has pointer to the master field; fix code indents to 4 spaces
This commit is contained in:
@ -481,27 +481,30 @@ void PVRecordStructure::init()
|
|||||||
for(size_t i=0; i<numFields; i++) {
|
for(size_t i=0; i<numFields; i++) {
|
||||||
PVFieldPtr pvField = pvFields[i];
|
PVFieldPtr pvField = pvFields[i];
|
||||||
if(pvField->getField()->getType()==structure) {
|
if(pvField->getField()->getType()==structure) {
|
||||||
PVStructurePtr xxx = static_pointer_cast<PVStructure>(pvField);
|
PVStructurePtr xxx = static_pointer_cast<PVStructure>(pvField);
|
||||||
PVRecordStructurePtr pvRecordStructure(
|
PVRecordStructurePtr pvRecordStructure(
|
||||||
new PVRecordStructure(xxx,self,pvRecord));
|
new PVRecordStructure(xxx,self,pvRecord));
|
||||||
pvRecordFields->push_back(pvRecordStructure);
|
pvRecordFields->push_back(pvRecordStructure);
|
||||||
pvRecordStructure->init();
|
pvRecordStructure->init();
|
||||||
} else {
|
} else {
|
||||||
PVRecordFieldPtr pvRecordField(
|
PVRecordFieldPtr pvRecordField(
|
||||||
new PVRecordField(pvField,self,pvRecord));
|
new PVRecordField(pvField,self,pvRecord));
|
||||||
pvRecordFields->push_back(pvRecordField);
|
pvRecordFields->push_back(pvRecordField);
|
||||||
pvRecordField->init();
|
pvRecordField->init();
|
||||||
// Master field listeners will be called before
|
// Master field listeners will be called before
|
||||||
// calling listeners for the first subfield
|
// calling listeners for the first subfield
|
||||||
if (!masterFieldCallbackSet) {
|
if (!masterFieldCallbackSet) {
|
||||||
masterFieldCallbackSet = true;
|
masterFieldCallbackSet = true;
|
||||||
// Find master field
|
// Find master field
|
||||||
PVRecordStructurePtr p = pvRecordField->parent.lock();
|
PVRecordStructurePtr p = pvRecordField->parent.lock();
|
||||||
while (p) {
|
while (p) {
|
||||||
pvRecordField->master = p;
|
PVRecordStructurePtr p2 = p->parent.lock();
|
||||||
p = p->parent.lock();
|
if (!p2) {
|
||||||
}
|
pvRecordField->master = p;
|
||||||
}
|
}
|
||||||
|
p = p2;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user