xml-xalan-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dbert...@apache.org
Subject cvs commit: xml-xalan/c/src/xalanc/XalanEXSLT XalanEXSLTMath.cpp
Date Thu, 23 Oct 2003 23:13:55 GMT
dbertoni    2003/10/23 16:13:55

  Modified:    c/src/xalanc/XalanEXSLT XalanEXSLTMath.cpp
  Log:
  Fixed bugs with clearing temp string, and with handling NaN edge cases.
  
  Revision  Changes    Path
  1.3       +26 -23    xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTMath.cpp
  
  Index: XalanEXSLTMath.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/xalanc/XalanEXSLT/XalanEXSLTMath.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XalanEXSLTMath.cpp	19 Sep 2003 21:05:33 -0000	1.2
  +++ XalanEXSLTMath.cpp	23 Oct 2003 23:13:55 -0000	1.3
  @@ -103,41 +103,44 @@
   		XalanNode*			theCurrentNode = theNodeSet.item(0);
   		assert(theCurrentNode != 0);
   
  -		theNodes->addNode(theCurrentNode);
  -
   		DOMServices::getNodeData(*theCurrentNode, theStringValue);
   
   		double	theNumericValue = DOMStringToDouble(theStringValue);
   
  -		for (NodeRefListBase::size_type i = 1; i < theLength; ++i)
  +		if (DoubleSupport::isNaN(theNumericValue) == false)
   		{
  -			theCurrentNode = theNodeSet.item(i);
  -			assert(theCurrentNode != 0);
  +			theNodes->addNode(theCurrentNode);
   
  -			DOMServices::getNodeData(*theCurrentNode, theStringValue);
  +			for (NodeRefListBase::size_type i = 1; i < theLength; ++i)
  +			{
  +				theCurrentNode = theNodeSet.item(i);
  +				assert(theCurrentNode != 0);
   
  -			const double	theCurrent = DOMStringToDouble(theStringValue);
  +				theStringValue.clear();
   
  -			if (DoubleSupport::isNaN(theCurrent) == true)
  -			{
  -				theNodes->clear();
  +				DOMServices::getNodeData(*theCurrentNode, theStringValue);
   
  -				break;
  -			}
  -			else if (DoubleSupport::equal(theCurrent, theNumericValue) == true)
  -			{
  -				theNodes->addNodeInDocOrder(theCurrentNode, executionContext);
  -			}
  -			else if (theCompareFunction(theCurrent, theNumericValue) == true)
  -			{
  -				theNodes->clear();
  +				const double	theCurrent = DOMStringToDouble(theStringValue);
   
  -				theNodes->addNode(theCurrentNode);
  +				if (DoubleSupport::isNaN(theCurrent) == true)
  +				{
  +					theNodes->clear();
   
  -				theNumericValue = theCurrent;
  -			}
  +					break;
  +				}
  +				else if (DoubleSupport::equal(theCurrent, theNumericValue) == true)
  +				{
  +					theNodes->addNodeInDocOrder(theCurrentNode, executionContext);
  +				}
  +				else if (theCompareFunction(theCurrent, theNumericValue) == true)
  +				{
  +					theNodes->clear();
   
  -			theStringValue.clear();
  +					theNodes->addNode(theCurrentNode);
  +
  +					theNumericValue = theCurrent;
  +				}
  +			}
   		}
   	}
   
  
  
  

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


Mime
View raw message