Ignore:
Timestamp:
May 19, 2013, 9:20:51 AM (6 years ago)
Author:
cameron
Message:

Fixes for icXML 0.9

Location:
icXML/icXML-devel/src/xercesc/validators/schema/identity
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • icXML/icXML-devel/src/xercesc/validators/schema/identity/FieldValueMap.cpp

    r2722 r3157  
    120120}
    121121
     122// ---------------------------------------------------------------------------
     123//  FieldValueMap: Setter methods
     124// ---------------------------------------------------------------------------
     125void FieldValueMap::put(IC_Field* const key, DatatypeValidator* const dv, const XMLCh* const value)
     126{
     127    if (!fFields) {
     128        fFields = new (fMemoryManager) ValueVectorOf<IC_Field*>(4, fMemoryManager);
     129        fValidators = new (fMemoryManager) ValueVectorOf<DatatypeValidator*>(4, fMemoryManager);
     130        fValues = new (fMemoryManager) RefArrayVectorOf<XMLCh>(4, true, fMemoryManager);
     131    }
     132
     133    XMLSize_t keyIndex;
     134    if (!indexOf(key, keyIndex))
     135    {
     136        fFields->addElement(key);
     137        fValidators->addElement(dv);
     138        fValues->addElement(XMLString::replicate(value, fMemoryManager));
     139    }
     140    else
     141    {
     142        fValidators->setElementAt(dv, keyIndex);
     143        fValues->setElementAt(XMLString::replicate(value, fMemoryManager), keyIndex);
     144    }
     145}
     146
    122147XERCES_CPP_NAMESPACE_END
    123148
  • icXML/icXML-devel/src/xercesc/validators/schema/identity/FieldValueMap.hpp

    r2722 r3157  
    161161}
    162162
    163 // ---------------------------------------------------------------------------
    164 //  FieldValueMap: Setter methods
    165 // ---------------------------------------------------------------------------
    166 inline void FieldValueMap::put(IC_Field* const key,
    167                                DatatypeValidator* const dv,
    168                                const XMLCh* const value) {
    169 
    170     if (!fFields) {
    171         fFields = new (fMemoryManager) ValueVectorOf<IC_Field*>(4, fMemoryManager);
    172         fValidators = new (fMemoryManager) ValueVectorOf<DatatypeValidator*>(4, fMemoryManager);
    173         fValues = new (fMemoryManager) RefArrayVectorOf<XMLCh>(4, true, fMemoryManager);
    174     }
    175 
    176     XMLSize_t keyIndex;
    177     bool bFound=indexOf(key, keyIndex);
    178 
    179     if (!bFound) {
    180 
    181         fFields->addElement(key);
    182         fValidators->addElement(dv);
    183         fValues->addElement(XMLString::replicate(value, fMemoryManager));
    184     }
    185     else {
    186         fValidators->setElementAt(dv, keyIndex);
    187         fValues->setElementAt(XMLString::replicate(value, fMemoryManager), keyIndex);
    188     }
    189 }
    190 
    191163XERCES_CPP_NAMESPACE_END
    192164
Note: See TracChangeset for help on using the changeset viewer.