You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by kn...@apache.org on 2001/08/28 01:04:02 UTC

cvs commit: xml-xerces/c/src/validators/schema ComplexTypeInfo.hpp ComplexTypeInfo.cpp

knoaman     01/08/27 16:04:02

  Modified:    c/src/validators/schema ComplexTypeInfo.hpp
                        ComplexTypeInfo.cpp
  Log:
  Handle deletion of spec node tree created during UPA checking.
  
  Revision  Changes    Path
  1.9       +4 -2      xml-xerces/c/src/validators/schema/ComplexTypeInfo.hpp
  
  Index: ComplexTypeInfo.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/validators/schema/ComplexTypeInfo.hpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ComplexTypeInfo.hpp	2001/08/27 20:14:42	1.8
  +++ ComplexTypeInfo.hpp	2001/08/27 23:04:02	1.9
  @@ -55,7 +55,7 @@
    */
   
   /*
  - * $Id: ComplexTypeInfo.hpp,v 1.8 2001/08/27 20:14:42 knoaman Exp $
  + * $Id: ComplexTypeInfo.hpp,v 1.9 2001/08/27 23:04:02 knoaman Exp $
    */
   
   #if !defined(COMPLEXTYPEINFO_HPP)
  @@ -74,6 +74,7 @@
   #include <util/XMLString.hpp>
   #include <util/RefHash2KeysTableOf.hpp>
   #include <util/RefVectorOf.hpp>
  +#include <util/Janitor.hpp>
   #include <framework/XMLElementDecl.hpp>
   #include <framework/XMLContentModel.hpp>
   #include <validators/schema/SchemaAttDef.hpp>
  @@ -182,7 +183,8 @@
       // -----------------------------------------------------------------------
       void faultInAttDefList() const;
       XMLContentModel* createChildModel(ContentSpecNode* specNode, const bool isMixed);
  -    XMLContentModel* makeContentModel(const bool checkUPA = false, ContentSpecNode* specNode = 0);
  +    XMLContentModel* makeContentModel(const bool checkUPA = false, ContentSpecNode* specNode = 0,
  +                                      Janitor<ContentSpecNode>* const janSpecNode = 0);
       XMLCh* formatContentModel () const ;
       ContentSpecNode* expandContentModel(ContentSpecNode* const curNode, const int minOccurs, const int maxOccurs, const bool toAdoptSpecNode = true);
       ContentSpecNode* convertContentSpecTree(ContentSpecNode* const curNode, const bool toAdoptSpecNode = true, const bool checkUPA = false);
  
  
  
  1.15      +11 -4     xml-xerces/c/src/validators/schema/ComplexTypeInfo.cpp
  
  Index: ComplexTypeInfo.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/validators/schema/ComplexTypeInfo.cpp,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- ComplexTypeInfo.cpp	2001/08/27 20:48:45	1.14
  +++ ComplexTypeInfo.cpp	2001/08/27 23:04:02	1.15
  @@ -56,6 +56,9 @@
   
   /*
    * $Log: ComplexTypeInfo.cpp,v $
  + * Revision 1.15  2001/08/27 23:04:02  knoaman
  + * Handle deletion of spec node tree created during UPA checking.
  + *
    * Revision 1.14  2001/08/27 20:48:45  knoaman
    * Make the UPA rename before the content model expansion.
    *
  @@ -284,14 +287,13 @@
   {
       if (fContentSpec) {
           ContentSpecNode* specNode = new ContentSpecNode(*fContentSpec);
  -        XMLContentModel* cm = makeContentModel(true, specNode);
  +        Janitor<ContentSpecNode> janSpecNode(0);
  +        XMLContentModel* cm = makeContentModel(true, specNode, &janSpecNode);
   
           if (cm) {
               cm->checkUniqueParticleAttribution(pGrammarResolver, pStringPool, pValidator, fContentSpecOrgURI);
               delete cm;
           }
  -
  -        delete specNode;
       }
   }
   
  @@ -336,12 +338,17 @@
       return newValue;
   }
   
  -XMLContentModel* ComplexTypeInfo::makeContentModel(const bool checkUPA, ContentSpecNode* specNode)
  +XMLContentModel* ComplexTypeInfo::makeContentModel(const bool checkUPA, ContentSpecNode* specNode,
  +                                                   Janitor<ContentSpecNode>* const janSpecNode)
   {
       // expand the content spec first
       fContentSpecOrgURI = new unsigned int[fContentSpecOrgURISize];
       if (specNode) {
           specNode = convertContentSpecTree(specNode, true, checkUPA);
  +
  +        if (janSpecNode) {
  +            janSpecNode->reset(specNode);
  +        }
       }
       else {
           specNode = convertContentSpecTree(fContentSpec, fAdoptContentSpec, checkUPA);
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org