You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ca...@apache.org on 2003/12/24 16:25:07 UTC

cvs commit: xml-xerces/c/src/xercesc/framework/psvi XSTypeDefinition.cpp

cargilld    2003/12/24 07:25:07

  Modified:    c/src/xercesc/framework/psvi XSTypeDefinition.cpp
  Log:
  Improved algorithm for finding derivedFrom.
  
  Revision  Changes    Path
  1.9       +9 -12     xml-xerces/c/src/xercesc/framework/psvi/XSTypeDefinition.cpp
  
  Index: XSTypeDefinition.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/framework/psvi/XSTypeDefinition.cpp,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- XSTypeDefinition.cpp	15 Dec 2003 17:23:48 -0000	1.8
  +++ XSTypeDefinition.cpp	24 Dec 2003 15:25:07 -0000	1.9
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.9  2003/12/24 15:25:07  cargilld
  + * Improved algorithm for finding derivedFrom.
  + *
    * Revision 1.8  2003/12/15 17:23:48  cargilld
    * psvi updates; cleanup revisits and bug fixes
    *
  @@ -86,6 +89,7 @@
    */
   
   #include <xercesc/framework/psvi/XSTypeDefinition.hpp>
  +#include <xercesc/framework/psvi/XSModel.hpp>
   #include <xercesc/util/XMLString.hpp>
   
   XERCES_CPP_NAMESPACE_BEGIN
  @@ -123,22 +127,15 @@
   bool XSTypeDefinition::derivedFrom(const XMLCh *typeNamespace, 
                                      const XMLCh *name)
   {    
  -    // REVISIT: review
  -    // look up object... ask Neil...
       if (!name)
           return false;
   
  -    XSTypeDefinition* type = this;
  -
  -    while (type)
  -    {
  -        if (XMLString::equals(type->getName(), name) &&
  -            XMLString::equals(type->getNamespace(), typeNamespace))
  -            return true;
  -        type = type->getBaseType();
  -    }
  +    XSTypeDefinition* type = fXSModel->getTypeDefinition(name, typeNamespace);
  +    
  +    if (!type)
  +        return false;
   
  -    return false;
  +    return derivedFromType(type);
   }
   
   XERCES_CPP_NAMESPACE_END
  
  
  

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