peiyongz    2003/10/08 14:34:59

  Modified:    c/src/xercesc/internal IGXMLScanner2.cpp SGXMLScanner.cpp
  Log:
  Fix compilation error on MSVC.
  
  Revision  Changes    Path
  1.34      +19 -4     xml-xerces/c/src/xercesc/internal/IGXMLScanner2.cpp
  
  Index: IGXMLScanner2.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/IGXMLScanner2.cpp,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- IGXMLScanner2.cpp 5 Oct 2003 03:20:50 -0000       1.33
  +++ IGXMLScanner2.cpp 8 Oct 2003 21:34:59 -0000       1.34
  @@ -94,6 +94,10 @@
   
   XERCES_CPP_NAMESPACE_BEGIN
   
  +static XMLAttDefList& getAttDefList(bool              isSchemaGrammar
  +                                  , ComplexTypeInfo*  currType
  +                                  , XMLElementDecl*   elemDecl);
  +
   // ---------------------------------------------------------------------------
   //  IGXMLScanner: Private helper methods
   // ---------------------------------------------------------------------------
  @@ -534,9 +538,10 @@
           // Check after all specified attrs are scanned
           // (1) report error for REQUIRED attrs that are missing (V_TAGc)
           // (2) add default attrs if missing (FIXED and NOT_FIXED)
  -        XMLAttDefList &attDefList = (fGrammarType == Grammar::SchemaGrammarType && 
currType)
  -                ? (currType->getAttDefList())
  -                : (elemDecl->getAttDefList());
  +
  +
  +        XMLAttDefList &attDefList = getAttDefList(fGrammarType == 
Grammar::SchemaGrammarType, currType, elemDecl);
  +
           while (attDefList.hasMoreElements())
           {
               // Get the current att def, for convenience and its def type
  @@ -2900,6 +2905,16 @@
               pszSrc++;
           }
       }
  +}
  +
  +inline XMLAttDefList& getAttDefList(bool              isSchemaGrammar
  +                                  , ComplexTypeInfo*  currType
  +                                  , XMLElementDecl*   elemDecl)
  +{
  +    if (isSchemaGrammar && currType)
  +        return currType->getAttDefList();
  +    else
  +        return elemDecl->getAttDefList();
   }
   
   XERCES_CPP_NAMESPACE_END
  
  
  
  1.40      +13 -4     xml-xerces/c/src/xercesc/internal/SGXMLScanner.cpp
  
  Index: SGXMLScanner.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/internal/SGXMLScanner.cpp,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- SGXMLScanner.cpp  5 Oct 2003 03:20:50 -0000       1.39
  +++ SGXMLScanner.cpp  8 Oct 2003 21:34:59 -0000       1.40
  @@ -88,6 +88,8 @@
   
   XERCES_CPP_NAMESPACE_BEGIN
   
  +static XMLAttDefList& getAttDefList(ComplexTypeInfo* currType, XMLElementDecl* 
elemDecl);
  +
   // ---------------------------------------------------------------------------
   //  SGXMLScanner: Constructors and Destructor
   // ---------------------------------------------------------------------------
  @@ -2404,9 +2406,9 @@
           // Check after all specified attrs are scanned
           // (1) report error for REQUIRED attrs that are missing (V_TAGc)
           // (2) add default attrs if missing (FIXED and NOT_FIXED)
  -        XMLAttDefList& attDefList = (currType)
  -                ? currType->getAttDefList()
  -                : elemDecl->getAttDefList();
  +
  +        XMLAttDefList& attDefList = getAttDefList(currType, elemDecl);
  +
           while (attDefList.hasMoreElements())
           {
               // Get the current att def, for convenience and its def type
  @@ -4300,5 +4302,12 @@
       }
   }
   
  +inline XMLAttDefList& getAttDefList(ComplexTypeInfo* currType, XMLElementDecl* 
elemDecl)
  +{
  +    if (currType)
  +        return currType->getAttDefList();
  +    else
  +        return elemDecl->getAttDefList();
  +}
   
   XERCES_CPP_NAMESPACE_END
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to