ooo-build r11726 - in trunk: . patches/src680 test/excel



Author: kyoshida
Date: Thu Feb 28 01:11:32 2008
New Revision: 11726
URL: http://svn.gnome.org/viewvc/ooo-build?rev=11726&view=rev

Log:
2008-02-27  Kohei Yoshida  <kyoshida novell com>

	* test/excel/textNumberTest.xls: added a test file for text number 
	arithmetics & iterative functions.
	
	* patches/src680/sc-string-arg.diff: fixed a regression that caused a 
	reference to a blank cell to trigger Err:529.  A blank cell is 
	interpreted to have a value of 0.


Added:
   trunk/test/excel/textNumberTest.xls   (contents, props changed)
Modified:
   trunk/ChangeLog
   trunk/patches/src680/sc-string-arg.diff

Modified: trunk/patches/src680/sc-string-arg.diff
==============================================================================
--- trunk/patches/src680/sc-string-arg.diff	(original)
+++ trunk/patches/src680/sc-string-arg.diff	Thu Feb 28 01:11:32 2008
@@ -1,27 +1,29 @@
 diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sc.vpj sc.clean/source/core/inc/interpre.hxx sc/source/core/inc/interpre.hxx
---- sc.clean/source/core/inc/interpre.hxx	2008-02-05 11:16:58.000000000 -0500
-+++ sc/source/core/inc/interpre.hxx	2008-02-19 17:25:44.000000000 -0500
-@@ -206,7 +206,7 @@ void ReplaceCell( ScAddress& );		// for 
+--- sc.clean/source/core/inc/interpre.hxx	2008-02-27 16:20:14.000000000 -0500
++++ sc/source/core/inc/interpre.hxx	2008-02-27 17:51:41.000000000 -0500
+@@ -206,8 +206,8 @@ void ReplaceCell( ScAddress& );		// for 
  void ReplaceCell( SCCOL& rCol, SCROW& rRow, SCTAB& rTab );	// for TableOp
  BOOL IsTableOpInRange( const ScRange& );
  ULONG GetCellNumberFormat( const ScAddress&, const ScBaseCell* );
 -double GetCellValue( const ScAddress&, const ScBaseCell* );
-+double GetCellValue( const ScAddress&, const ScBaseCell*, bool bIgnoreNoValueError = true );
- double GetCellValueOrZero( const ScAddress&, const ScBaseCell* );
+-double GetCellValueOrZero( const ScAddress&, const ScBaseCell* );
++double GetCellValue( const ScAddress&, const ScBaseCell*, bool bNoValueAsError = false, bool bBlankAsZero = false );
++double GetCellValueOrZero( const ScAddress&, const ScBaseCell*, bool bBlankAsZero );
  double GetValueCellValue( const ScAddress&, const ScValueCell* );
  ScBaseCell* GetCell( const ScAddress& rPos )
+ 	{ return pDok->GetCell( rPos ); }
 @@ -273,7 +273,7 @@ StackVar GetStackType( BYTE nParam );
  BYTE GetByte() { return cPar; }
  // generiert aus DoubleRef positionsabhaengige SingleRef
  BOOL DoubleRefToPosSingleRef( const ScRange& rRange, ScAddress& rAdr );
 -double GetDouble();
-+double GetDouble( bool bIgnoreNoValueError = true );
++double GetDouble( bool bNoValueAsError = false, bool bBlankAsZero = false );
  double GetDoubleWithDefault(double nDefault);
  BOOL IsMissing();
  BOOL GetBool() { return GetDouble() != 0.0; }
 diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sc.vpj sc.clean/source/core/tool/interpr1.cxx sc/source/core/tool/interpr1.cxx
---- sc.clean/source/core/tool/interpr1.cxx	2008-02-05 11:16:59.000000000 -0500
-+++ sc/source/core/tool/interpr1.cxx	2008-02-19 18:02:52.000000000 -0500
+--- sc.clean/source/core/tool/interpr1.cxx	2008-02-27 16:20:14.000000000 -0500
++++ sc/source/core/tool/interpr1.cxx	2008-02-27 16:27:51.000000000 -0500
 @@ -3020,12 +3020,13 @@ double ScInterpreter::IterateParameters(
  	ScRange aRange;
  	for (short i = 0; i < nParamCount; i++)
@@ -115,26 +117,34 @@
  			case svSingleRef :
  			{
  				PopSingleRef( aAdr );
-Only in sc/source/core/tool: interpr1.cxx.orig
 diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sc.vpj sc.clean/source/core/tool/interpr4.cxx sc/source/core/tool/interpr4.cxx
---- sc.clean/source/core/tool/interpr4.cxx	2008-02-05 11:16:59.000000000 -0500
-+++ sc/source/core/tool/interpr4.cxx	2008-02-19 17:57:49.000000000 -0500
-@@ -205,12 +205,12 @@ double ScInterpreter::GetValueCellValue(
+--- sc.clean/source/core/tool/interpr4.cxx	2008-02-27 16:20:14.000000000 -0500
++++ sc/source/core/tool/interpr4.cxx	2008-02-27 17:56:52.000000000 -0500
+@@ -205,18 +205,19 @@ double ScInterpreter::GetValueCellValue(
  }
  
  
 -double ScInterpreter::GetCellValue( const ScAddress& rPos, const ScBaseCell* pCell )
-+double ScInterpreter::GetCellValue( const ScAddress& rPos, const ScBaseCell* pCell, bool bIgnoreNoValueError )
++double ScInterpreter::GetCellValue( const ScAddress& rPos, const ScBaseCell* pCell, 
++                                    bool bNoValueAsError, bool bBlankAsZero )
  {
  	USHORT nErr = nGlobalError;
  	nGlobalError = 0;
- 	double nVal = GetCellValueOrZero( rPos, pCell );
+-	double nVal = GetCellValueOrZero( rPos, pCell );
 -    if ( !nGlobalError || nGlobalError == errCellNoValue )
-+    if ( bIgnoreNoValueError && (!nGlobalError || nGlobalError == errCellNoValue) )
++	double nVal = GetCellValueOrZero( rPos, pCell, bBlankAsZero );
++    if ( !nGlobalError || (!bNoValueAsError && nGlobalError == errCellNoValue) )
  		nGlobalError = nErr;
  	return nVal;
  }
-@@ -260,7 +260,7 @@ double ScInterpreter::GetCellValueOrZero
+ 
+ 
+-double ScInterpreter::GetCellValueOrZero( const ScAddress& rPos, const ScBaseCell* pCell )
++double ScInterpreter::GetCellValueOrZero( const ScAddress& rPos, const ScBaseCell* pCell, bool bBlankAsZero )
+ {
+ 	double fValue;
+ 	if (pCell)
+@@ -260,7 +261,7 @@ double ScInterpreter::GetCellValueOrZero
  			break;
  			case  CELLTYPE_STRING:
  			case  CELLTYPE_EDIT:
@@ -143,7 +153,7 @@
  // Xcl does it, but SUM(A1:A2) differs from A1+A2. No good.
  			{
  				String aStr;
-@@ -271,7 +271,7 @@ double ScInterpreter::GetCellValueOrZero
+@@ -271,14 +272,15 @@ double ScInterpreter::GetCellValueOrZero
  				sal_uInt32 nFIndex = 0;					// damit default Land/Spr.
  				if ( !pFormatter->IsNumberFormat( aStr, nFIndex, fValue ) )
  				{
@@ -152,34 +162,42 @@
  					fValue = 0.0;
  				}
  			}
-@@ -1440,7 +1440,7 @@ BOOL ScInterpreter::DoubleRefToPosSingle
+ 			break;
+ #endif
+ 			default:
+-                SetError(errCellNoValue);
++                if (!bBlankAsZero)
++                    SetError(errCellNoValue);
+ 				fValue = 0.0;
+ 		}
+ 	}
+@@ -1440,7 +1442,7 @@ BOOL ScInterpreter::DoubleRefToPosSingle
  }
  
  
 -double ScInterpreter::GetDouble()
-+double ScInterpreter::GetDouble( bool bIgnoreNoValueError )
++double ScInterpreter::GetDouble( bool bNoValueAsError, bool bBlankAsZero )
  {
  	double nVal;
  	switch( GetStackType() )
-@@ -1464,7 +1464,7 @@ double ScInterpreter::GetDouble()
+@@ -1464,7 +1466,7 @@ double ScInterpreter::GetDouble()
  			ScAddress aAdr;
  			PopSingleRef( aAdr );
  			ScBaseCell* pCell = GetCell( aAdr );
 -			nVal = GetCellValue( aAdr, pCell );
-+			nVal = GetCellValue( aAdr, pCell, bIgnoreNoValueError );
++			nVal = GetCellValue( aAdr, pCell, bNoValueAsError, bBlankAsZero );
  		}
  		break;
  		case svDoubleRef:
-Only in sc/source/core/tool: interpr4.cxx.orig
 diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sc.vpj sc.clean/source/core/tool/interpr5.cxx sc/source/core/tool/interpr5.cxx
---- sc.clean/source/core/tool/interpr5.cxx	2008-02-05 11:16:59.000000000 -0500
-+++ sc/source/core/tool/interpr5.cxx	2008-02-19 18:37:05.000000000 -0500
+--- sc.clean/source/core/tool/interpr5.cxx	2008-02-27 16:20:14.000000000 -0500
++++ sc/source/core/tool/interpr5.cxx	2008-02-27 17:50:51.000000000 -0500
 @@ -1522,7 +1522,12 @@ void ScInterpreter::ScAdd()
  		pMat2 = GetMatrix();
  	else
  	{
 -		fVal2 = GetDouble();
-+		fVal2 = GetDouble(false);
++		fVal2 = GetDouble(true, true);
 +        if (nGlobalError)
 +        {
 +            PushError(nGlobalError);
@@ -193,7 +211,7 @@
  	else
  	{
 -		fVal1 = GetDouble();
-+		fVal1 = GetDouble(false);
++		fVal1 = GetDouble(true, true);
 +        if (nGlobalError)
 +        {
 +            PushError(nGlobalError);
@@ -207,7 +225,7 @@
  	else
  	{
 -		fVal2 = GetDouble();
-+		fVal2 = GetDouble(false);
++		fVal2 = GetDouble(true, true);
 +        if (nGlobalError)
 +        {
 +            PushError(nGlobalError);
@@ -221,7 +239,7 @@
  	else
  	{
 -		fVal1 = GetDouble();
-+		fVal1 = GetDouble(false);
++		fVal1 = GetDouble(true, true);
 +        if (nGlobalError)
 +        {
 +            PushError(nGlobalError);
@@ -235,7 +253,7 @@
  	else
  	{
 -		fVal2 = GetDouble();
-+		fVal2 = GetDouble(false);
++		fVal2 = GetDouble(true, true);
 +        if (nGlobalError)
 +        {
 +            PushError(nGlobalError);
@@ -249,7 +267,7 @@
  	else
  	{
 -		fVal1 = GetDouble();
-+		fVal1 = GetDouble(false);
++		fVal1 = GetDouble(true, true);
 +        if (nGlobalError)
 +        {
 +            PushError(nGlobalError);
@@ -263,7 +281,7 @@
  	else
  	{
 -		fVal2 = GetDouble();
-+		fVal2 = GetDouble(false);
++		fVal2 = GetDouble(true, true);
 +        if (nGlobalError)
 +        {
 +            PushError(nGlobalError);
@@ -277,7 +295,7 @@
  	else
  	{
 -		fVal1 = GetDouble();
-+		fVal1 = GetDouble(false);
++		fVal1 = GetDouble(true, true);
 +        if (nGlobalError)
 +        {
 +            PushError(nGlobalError);

Added: trunk/test/excel/textNumberTest.xls
==============================================================================
Binary file. No diff available.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]