Ignore:
Timestamp:
10/30/15 16:33:48 (6 years ago)
Author:
rlacroix
Message:

Field: Handle more correctly the output name for the fields with a field_ref.

If the field has an explicitly defined name (which might be inherited) then it is used as the output name.
If no name was defined but an id was set, the id is used as the output name.
If no name was defined and the id was automatically generated, the id of the field directly referenced is used as the output name.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/node/file.cpp

    r757 r770  
    956956   void CFile::sendEnabledFields() 
    957957   { 
    958      int size = this->enabledFields.size(); 
    959      CField* fieldPtr(0); 
    960      for (int i = 0; i < size; ++i) 
     958     size_t size = this->enabledFields.size(); 
     959     for (size_t i = 0; i < size; ++i) 
    961960     { 
    962        fieldPtr = this->enabledFields[i]; 
    963        if (fieldPtr->name.isEmpty()) fieldPtr->name.setValue(fieldPtr->getBaseFieldReference()->getId()); 
    964        this->sendAddField(fieldPtr->getId()); 
    965        fieldPtr->sendAllAttributesToServer(); 
    966        fieldPtr->sendAddAllVariables(); 
     961       CField* field = this->enabledFields[i]; 
     962       this->sendAddField(field->getId()); 
     963       field->sendAllAttributesToServer(); 
     964       field->sendAddAllVariables(); 
    967965     } 
    968966   } 
Note: See TracChangeset for help on using the changeset viewer.