You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by db...@apache.org on 2001/06/06 23:45:12 UTC

cvs commit: xml-xalan/c/src/XercesParserLiaison XercesDocumentBridge.cpp XercesDocumentBridge.hpp

dbertoni    01/06/06 14:45:12

  Modified:    c/src/XercesParserLiaison XercesDocumentBridge.cpp
                        XercesDocumentBridge.hpp
  Log:
  Made some fixes so the bridge nodes can always be rebuilt.
  
  Revision  Changes    Path
  1.17      +32 -14    xml-xalan/c/src/XercesParserLiaison/XercesDocumentBridge.cpp
  
  Index: XercesDocumentBridge.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XercesParserLiaison/XercesDocumentBridge.cpp,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- XercesDocumentBridge.cpp	2001/04/30 18:09:01	1.16
  +++ XercesDocumentBridge.cpp	2001/06/06 21:45:11	1.17
  @@ -108,12 +108,12 @@
   	XalanDocument(),
   	m_xercesDocument(theXercesDocument),
   	m_documentElement(0),
  -	m_children(theXercesDocument.getChildNodes(),
  -			   m_navigator),
   	m_nodeMap(),
   	m_domImplementation(new XercesDOMImplementationBridge(theXercesDocument.getImplementation())),
   	m_navigators(1, XercesBridgeNavigator(this, threadSafe == true ? false : !buildBridge)),
  -	m_navigator(m_navigators.front()),
  +	m_navigator(&m_navigators.front()),
  +	m_children(theXercesDocument.getChildNodes(),
  +			   *m_navigator),
   	m_nodes(),
   	m_doctype(0),
   	m_mappingMode(threadSafe == true ? false : !buildBridge),
  @@ -130,7 +130,7 @@
   	if (m_mappingMode == false)
   	{
   		// The document index is always 1...
  -		m_navigator.setIndex(1);
  +		m_navigator->setIndex(1);
   
   		// OK, let's build the nodes.  This makes things
   		// thread-safe, so the document can be shared...
  @@ -295,6 +295,8 @@
   	// Clear out all of the navigators, except ours...
   	m_navigators.erase(m_navigators.begin() + 1, m_navigators.end());
   
  +	m_navigator = &m_navigators.front();
  +
   	// Clear the node map...
   	m_nodeMap.clear();
   
  @@ -1000,7 +1002,9 @@
   XalanNode*
   XercesDocumentBridge::getFirstChild() const
   {
  -	return m_navigator.getFirstChild(m_xercesDocument);
  +	assert(m_navigator != 0);
  +
  +	return m_navigator->getFirstChild(m_xercesDocument);
   }
   
   
  @@ -1008,7 +1012,9 @@
   XalanNode*
   XercesDocumentBridge::getLastChild() const
   {
  -	return m_navigator.getLastChild(m_xercesDocument);
  +	assert(m_navigator != 0);
  +
  +	return m_navigator->getLastChild(m_xercesDocument);
   }
   
   
  @@ -1080,7 +1086,9 @@
   			XalanNode*	newChild,
   			XalanNode*	refChild)
   {
  -	return m_navigator.insertBefore(m_xercesDocument, newChild, refChild);
  +	assert(m_navigator != 0);
  +
  +	return m_navigator->insertBefore(m_xercesDocument, newChild, refChild);
   }
   
   
  @@ -1090,7 +1098,9 @@
   			XalanNode*	newChild,
   			XalanNode*	oldChild)
   {
  -	return m_navigator.replaceChild(m_xercesDocument, newChild, oldChild);
  +	assert(m_navigator != 0);
  +
  +	return m_navigator->replaceChild(m_xercesDocument, newChild, oldChild);
   }
   
   
  @@ -1098,7 +1108,9 @@
   XalanNode*
   XercesDocumentBridge::removeChild(XalanNode*	 oldChild)
   {
  -	return m_navigator.removeChild(m_xercesDocument, oldChild);
  +	assert(m_navigator != 0);
  +
  +	return m_navigator->removeChild(m_xercesDocument, oldChild);
   }
   
   
  @@ -1106,7 +1118,9 @@
   XalanNode*
   XercesDocumentBridge::appendChild(XalanNode*	newChild)
   {
  -	return m_navigator.appendChild(m_xercesDocument, newChild);
  +	assert(m_navigator != 0);
  +
  +	return m_navigator->appendChild(m_xercesDocument, newChild);
   }
   
   
  @@ -1189,9 +1203,10 @@
   unsigned long
   XercesDocumentBridge::getIndex() const
   {
  -	assert(m_navigator.getIndex() == 1);
  +	assert(m_navigator != 0);
  +	assert(m_navigator->getIndex() == 1);
   
  -	return m_navigator.getIndex();
  +	return m_navigator->getIndex();
   }
   
   
  @@ -1533,9 +1548,12 @@
   
   	if (theStartChild.isNull() == false)
   	{
  -		assert(m_navigators.back().getIndex() == 1);
  +		assert(m_navigator != 0);
   		assert(m_navigators.size() == 1);
   
  +		m_navigator->setIndex(1);
  +		m_navigator->setFirstChild(0);
  +
   		BuildBridgeTreeWalker	theTreeWalker(
   				this,
   				&m_navigators.back(),
  @@ -1546,7 +1564,7 @@
   	}
   
   	// OK, now set m_documentElement...
  -	XalanNode*	theChild = m_navigator.getFirstChild();
  +	XalanNode*	theChild = m_navigator->getFirstChild();
   
   	while(theChild != 0 && theChild->getNodeType() != XalanNode::ELEMENT_NODE)
   	{
  
  
  
  1.14      +3 -3      xml-xalan/c/src/XercesParserLiaison/XercesDocumentBridge.hpp
  
  Index: XercesDocumentBridge.hpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XercesParserLiaison/XercesDocumentBridge.hpp,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- XercesDocumentBridge.hpp	2000/12/07 17:03:32	1.13
  +++ XercesDocumentBridge.hpp	2001/06/06 21:45:11	1.14
  @@ -562,8 +562,6 @@
   
   	XalanElement*							m_documentElement;
   
  -	XercesNodeListBridge					m_children;
  -
   	mutable XercesToXalanNodeMap			m_nodeMap;
   
   	XalanAutoPtr<XalanDOMImplementation>	m_domImplementation;
  @@ -572,7 +570,9 @@
   
   	// Our navigator will be the first entry in m_navigators,
   	// but we'll cache this so access is faster...
  -	XercesBridgeNavigator&					m_navigator;
  +	XercesBridgeNavigator*					m_navigator;
  +
  +	XercesNodeListBridge					m_children;
   
   	mutable NodeVectorType					m_nodes;
   
  
  
  

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