xerces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peiyo...@apache.org
Subject cvs commit: xml-xerces/c/src/xercesc/dom/impl DOMNodeImpl.cpp
Date Thu, 03 Apr 2003 19:25:51 GMT
peiyongz    2003/04/03 11:25:50

  Modified:    c/src/xercesc/dom/impl DOMNodeImpl.cpp
  Log:
  Using castToNodeImpl()
  
  Revision  Changes    Path
  1.24      +5 -40     xml-xerces/c/src/xercesc/dom/impl/DOMNodeImpl.cpp
  
  Index: DOMNodeImpl.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/dom/impl/DOMNodeImpl.cpp,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- DOMNodeImpl.cpp	3 Apr 2003 00:01:34 -0000	1.23
  +++ DOMNodeImpl.cpp	3 Apr 2003 19:25:50 -0000	1.24
  @@ -63,18 +63,11 @@
   // The ParentNode subclass overrides this behavior.
   
   
  +#include "DOMCasts.hpp"
  +
   #include "DOMDocumentTypeImpl.hpp"
   #include "DOMElementImpl.hpp"
   #include "DOMAttrImpl.hpp"
  -#include "DOMCasts.hpp"
  -#include "DOMDocumentImpl.hpp"
  -#include "DOMCDATASectionImpl.hpp"
  -#include "DOMEntityReferenceImpl.hpp"
  -#include "DOMEntityImpl.hpp"
  -#include "DOMProcessingInstructionImpl.hpp"
  -#include "DOMCommentImpl.hpp"
  -#include "DOMDocumentFragmentImpl.hpp"
  -#include "DOMNotationImpl.hpp"
   
   #include <xercesc/dom/DOMImplementation.hpp>
   #include <xercesc/dom/DOMException.hpp>
  @@ -989,52 +982,24 @@
       case DOMNode::DOCUMENT_FRAGMENT_NODE:
       {
   		DOMNode* current = thisNode->getFirstChild();
  -		DOMNodeImpl* nodeImpl;
   
   		while (current != NULL) 
   		{
   			if (current->getNodeType() != DOMNode::COMMENT_NODE &&
   				current->getNodeType() != DOMNode::PROCESSING_INSTRUCTION_NODE)
   			{
  -				switch (current->getNodeType())
  -				{
  -				case DOMNode::ELEMENT_NODE:
  -					nodeImpl = &(((DOMElementImpl*)current)->fNode);
  -				case DOMNode::ATTRIBUTE_NODE:       
  -					nodeImpl = &(((DOMAttrImpl*)current)->fNode);
  -				case DOMNode::TEXT_NODE:        
  -					nodeImpl = &(((DOMTextImpl*)current)->fNode);
  -				case DOMNode::CDATA_SECTION_NODE:
  -					nodeImpl = &(((DOMCDATASectionImpl*)current)->fNode);
  -				case DOMNode::ENTITY_REFERENCE_NODE:
  -					nodeImpl = &(((DOMEntityReferenceImpl*)current)->fNode);
  -				case DOMNode::ENTITY_NODE:
  -					nodeImpl = &(((DOMEntityImpl*)current)->fNode);
  -				case DOMNode::PROCESSING_INSTRUCTION_NODE:
  -					nodeImpl = &(((DOMProcessingInstructionImpl*)current)->fNode);
  -				case DOMNode::COMMENT_NODE:
  -					nodeImpl = &(((DOMCommentImpl*)current)->fNode);
  -				case DOMNode::DOCUMENT_NODE:        
  -					nodeImpl = &(((DOMDocumentImpl*)current)->fNode);
  -				case DOMNode::DOCUMENT_TYPE_NODE:
  -					nodeImpl = &(((DOMDocumentTypeImpl*)current)->fNode);
  -				case DOMNode::DOCUMENT_FRAGMENT_NODE:
  -					nodeImpl = &(((DOMDocumentFragmentImpl*)current)->fNode);
  -				case DOMNode::NOTATION_NODE:
  -					nodeImpl = &(((DOMNotationImpl*)current)->fNode);
  -				}
   
   				if (pzBuffer)
   				{
   					unsigned int nContentLength = nRemainingBuffer;
  -					nodeImpl->getTextContent(pzBuffer + rnBufferLength, nContentLength);
  +					castToNodeImpl(current)->getTextContent(pzBuffer + rnBufferLength, nContentLength);
   					rnBufferLength += nContentLength;
   					nRemainingBuffer -= nContentLength;
   				}
   				else 
   				{
   					unsigned int nContentLength = 0;
  -					nodeImpl->getTextContent(NULL, nContentLength);
  +					castToNodeImpl(current)->getTextContent(NULL, nContentLength);
   					rnBufferLength += nContentLength;
   				}
   			}
  
  
  

---------------------------------------------------------------------
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