Ignore:
Timestamp:
May 17, 2013, 5:41:20 AM (6 years ago)
Author:
cameron
Message:

Updates for various icxercesc modified files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icXML/icXML-devel/src/icxercesc/validators/common/MixedContentModel.cpp

    r3104 r3150  
    3232#include <icxercesc/validators/common/Grammar.hpp>
    3333#include <icxercesc/validators/schema/SubstitutionGroupComparator.hpp>
     34#include <icxmlc/XMLConfig.hpp>
    3435
    3536XERCES_CPP_NAMESPACE_BEGIN
     
    5051{
    5152        //
    52         //  Create a vector of unsigned ints that will be filled in with the
    53         //  ids of the child nodes. It will be expanded as needed but we give
    54         //  it an initial capacity of 64 which should be more than enough for
    55         //  99% of the scenarios.
    56         //
    57         ValueVectorOf<QName*> children(64, fMemoryManager);
    58         ValueVectorOf<ContentSpecNode::NodeTypes> childTypes(64, fMemoryManager);
    59 
    60         //
    6153        //  Get the parent element's content spec. This is the head of the tree
    6254        //  of nodes that describes the content model. We will iterate this
     
    6759                ThrowXMLwithMemMgr(RuntimeException, XMLExcepts::CM_NoParentCSN, fMemoryManager);
    6860
     61    //
     62    //  Create a vector of unsigned ints that will be filled in with the
     63    //  ids of the child nodes. It will be expanded as needed but we give
     64    //  it an initial capacity of 64 which should be more than enough for
     65    //  99% of the scenarios.
     66    //
     67    ValueVectorOf<QName*> children(64, fMemoryManager);
     68    ValueVectorOf<ContentSpecNode::NodeTypes> childTypes(64, fMemoryManager);
     69
    6970        // And now call the private recursive method that iterates the tree
    7071        buildChildList(curNode, children, childTypes);
     
    7576        //
    7677        fCount = children.size();
    77         fChildren = (QName**) fMemoryManager->allocate(fCount * sizeof(QName*)); //new QName*[fCount];
    78         fChildTypes = (ContentSpecNode::NodeTypes*) fMemoryManager->allocate
    79         (
    80                 fCount * sizeof(ContentSpecNode::NodeTypes)
    81         ); //new ContentSpecNode::NodeTypes[fCount];
    82         for (XMLSize_t index = 0; index < fCount; index++) {
    83                 fChildren[index] = new (fMemoryManager) QName(*children.elementAt(index));
     78    fChildren = (QName**)fMemoryManager->allocate(fCount * sizeof(QName*));
     79    fChildTypes = (ContentSpecNode::NodeTypes*)fMemoryManager->allocate(fCount * sizeof(ContentSpecNode::NodeTypes));
     80    for (XMLSize_t index = 0; index < fCount; index++)
     81    {
     82        fChildren[index] = new QName(*children.elementAt(index));
    8483                fChildTypes[index] = childTypes.elementAt(index);
    8584        }
     
    8887MixedContentModel::~MixedContentModel()
    8988{
    90         for (XMLSize_t index = 0; index < fCount; index++) {
    91                 delete fChildren[index];
    92         }
    93         fMemoryManager->deallocate(fChildren); //delete [] fChildren;
    94         fMemoryManager->deallocate(fChildTypes); //delete [] fChildTypes;
     89    for (XMLSize_t index = 0; index < fCount; index++)
     90    {
     91        delete fChildren[index];
     92    }
     93    fMemoryManager->deallocate(fChildren);
     94    fMemoryManager->deallocate(fChildTypes);
    9595}
    9696
     
    463463
    464464        // And recurse according to the type of node
    465         if (((curType & 0x0f) == ContentSpecNode::Choice)
    466         ||  ((curType & 0x0f) == ContentSpecNode::Sequence))
     465    if (((curType & 0x0f) == ContentSpecNode::Choice) || ((curType & 0x0f) == ContentSpecNode::Sequence))
    467466        {
    468467                // Recurse on the left and right nodes
Note: See TracChangeset for help on using the changeset viewer.