xerces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cargi...@apache.org
Subject cvs commit: xml-xerces/c/src/xercesc/internal XSObjectFactory.cpp
Date Thu, 05 Feb 2004 18:09:53 GMT
cargilld    2004/02/05 10:09:53

  Modified:    c/src/xercesc/framework/psvi XSModel.cpp
               c/src/xercesc/internal XSObjectFactory.cpp
  Log:
  Fix a seg fault with PSVI and set basetype of anysimpletype to be anytype.
  
  Revision  Changes    Path
  1.20      +7 -4      xml-xerces/c/src/xercesc/framework/psvi/XSModel.cpp
  
  Index: XSModel.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/psvi/XSModel.cpp,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- XSModel.cpp	29 Jan 2004 11:46:30 -0000	1.19
  +++ XSModel.cpp	5 Feb 2004 18:09:53 -0000	1.20
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.20  2004/02/05 18:09:53  cargilld
  + * Fix a seg fault with PSVI and set basetype of anysimpletype to be anytype.
  + *
    * Revision 1.19  2004/01/29 11:46:30  cargilld
    * Code cleanup changes to get rid of various compiler diagnostic messages.
    *
  @@ -244,11 +247,11 @@
       dvFactory.expandRegistryToFullSchemaSet();
       addS4SToXSModel
       (
  -        getNamespaceItem(SchemaSymbols::fgURI_SCHEMAFORSCHEMA)
  +        namespaceItem
           , dvFactory.getBuiltInRegistry()
       );
  -
  -    unsigned int numberOfNamespaces = fXSNamespaceItemList->size();
  +    // don't include  S4S (thus the -1)
  +    unsigned int numberOfNamespaces = fXSNamespaceItemList->size() -1;
       for (unsigned int j = 0; j < numberOfNamespaces; j++)
           addGrammarToXSModel(fXSNamespaceItemList->elementAt(j));
   }
  @@ -416,7 +419,7 @@
           fDeleteNamespace->addElement(namespaceItem);
           addS4SToXSModel
           (
  -            getNamespaceItem(SchemaSymbols::fgURI_SCHEMAFORSCHEMA)
  +            namespaceItem
               , dvFactory.getBuiltInRegistry()
           );
       }
  
  
  
  1.20      +12 -4     xml-xerces/c/src/xercesc/internal/XSObjectFactory.cpp
  
  Index: XSObjectFactory.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/XSObjectFactory.cpp,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- XSObjectFactory.cpp	7 Jan 2004 02:33:56 -0000	1.19
  +++ XSObjectFactory.cpp	5 Feb 2004 18:09:53 -0000	1.20
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.20  2004/02/05 18:09:53  cargilld
  + * Fix a seg fault with PSVI and set basetype of anysimpletype to be anytype.
  + *
    * Revision 1.19  2004/01/07 02:33:56  knoaman
    * PSVI: inherit facets from base type
    *
  @@ -396,7 +399,7 @@
       XSSimpleTypeDefinition* xsObj = (XSSimpleTypeDefinition*) xsModel->getXSObject(validator);
       if (!xsObj)
       {
  -        XSSimpleTypeDefinition* baseType = 0;
  +        XSTypeDefinition* baseType = 0;
           XSSimpleTypeDefinitionList* memberTypes = 0;
           XSSimpleTypeDefinition* primitiveOrItemType = 0;
           XSSimpleTypeDefinition::VARIETY typeVariety = XSSimpleTypeDefinition::VARIETY_ATOMIC;
  @@ -438,7 +441,7 @@
               if (baseDV->getType() == DatatypeValidator::List)
               {
                   baseType = addOrFind(baseDV, xsModel);
  -                primitiveOrItemType = baseType->getItemType();
  +                primitiveOrItemType = ((XSSimpleTypeDefinition*) baseType)->getItemType();
               }
               else
               {
  @@ -455,7 +458,7 @@
               if (baseDV)
               {
                   baseType = addOrFind(baseDV, xsModel);
  -                primitiveOrItemType = baseType->getPrimitiveType();
  +                primitiveOrItemType = ((XSSimpleTypeDefinition*) baseType)->getPrimitiveType();
               }
               else // built-in
               {
  @@ -467,6 +470,10 @@
                   primitiveTypeSelf = true;
               }
           }
  +        else
  +        {
  +            baseType = xsModel->getTypeDefinition(SchemaSymbols::fgATTVAL_ANYTYPE, SchemaSymbols::fgURI_SCHEMAFORSCHEMA);
           
  +        }
   
           xsObj = new (fMemoryManager) XSSimpleTypeDefinition
           (
  @@ -1061,7 +1068,8 @@
       }
   
       // inherit facets from base
  -    if (xsST->getBaseType())
  +
  +    if (xsST->getBaseType() && xsST->getBaseType()->getTypeCategory()
== XSTypeDefinition::SIMPLE_TYPE)
       {
           XSSimpleTypeDefinition* baseST = (XSSimpleTypeDefinition*) xsST->getBaseType();
           XSFacetList* baseFacets = baseST->getFacets();
  
  
  

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


Mime
View raw message