ooo-build r11635 - in trunk: . patches/src680



Author: kyoshida
Date: Tue Feb 19 23:59:48 2008
New Revision: 11635
URL: http://svn.gnome.org/viewvc/ooo-build?rev=11635&view=rev

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

	* patches/src680/sc-string-arg.diff: updated to throw an error when 
	attempting to add a number and a string even when the string is given as
	a cell reference.  Previously a cell reference that contains a non-
	numeric string value was considered to have a value of 0.

	* patches/src680/apply: updated the IZ number for this patch.	


Modified:
   trunk/ChangeLog
   trunk/patches/src680/apply
   trunk/patches/src680/sc-string-arg.diff

Modified: trunk/patches/src680/apply
==============================================================================
--- trunk/patches/src680/apply	(original)
+++ trunk/patches/src680/apply	Tue Feb 19 23:59:48 2008
@@ -633,10 +633,8 @@
 # Autofill doesnt fill filtered rows bxc 62499
 sc-filters-fill-fix.diff, jody
 
-# Provision for dynamic range in data pilot bxc 62522
-# Previously sc-dp-database-crash.diff and sc-pv-crasher.diff are now
-# incorporated into this patch since these two patches are improvement to
-# this patch below.
+# Support modification of data source range in DataPilot after table output has
+# been generated.
 sc-datapilot-dynamic-range.diff, i#23658, kohei
 
 # Provision for data-pilot to give autoformat bxc #62162
@@ -662,8 +660,8 @@
 # sc-dp-gridlayout.diff, i#68544 n#190970, jody
 sc-dp-gridlayout.diff, i#68544, n#190970, jody
 
-# compatibility for numbers in string cells (with leading/trailing space) - i#47811
-sc-string-arg.diff, i#47811, muthusub
+# Excel compatibility for handling of "string numbers".
+sc-string-arg.diff, i#5658, kohei
 
 # To make CSV Text Import settings persistent
 sc-preserve-imp-opts.diff, i#3687, muthusub

Modified: trunk/patches/src680/sc-string-arg.diff
==============================================================================
--- trunk/patches/src680/sc-string-arg.diff	(original)
+++ trunk/patches/src680/sc-string-arg.diff	Tue Feb 19 23:59:48 2008
@@ -1,26 +1,28 @@
---- sc/source/core/tool/interpr4.cxx	2005-04-14 09:50:06.000000000 +0530
-+++ sc/source/core/tool/interpr4.cxx	2005-04-19 13:12:20.678272373 +0530
-@@ -257,7 +257,7 @@ double ScInterpreter::GetCellValueOrZero
- 			break;
- 			case  CELLTYPE_STRING:
- 			case  CELLTYPE_EDIT:
--#if 0
-+#if 1 /* JEG : re-enable because compatibility is more important than consistency for this */
- // Xcl does it, but SUM(A1:A2) differs from A1+A2. No good.
- 			{
- 				String aStr;
-@@ -268,7 +268,7 @@ double ScInterpreter::GetCellValueOrZero
- 				sal_uInt32 nFIndex = 0;					// damit default Land/Spr.
- 				if ( !pFormatter->IsNumberFormat( aStr, nFIndex, fValue ) )
- 				{
--					SetError(errNoValue);
-+					SetError(errCellNoValue);	/* CellNoValue is not really an error */
- 					fValue = 0.0;
- 				}
- 			}
---- sc/source/core/tool/interpr1.cxx	2005-04-14 09:50:06.000000000 +0530
-+++ sc/source/core/tool/interpr1.cxx	2005-04-19 12:08:07.486080311 +0530
-@@ -2685,12 +2685,13 @@ double ScInterpreter::IterateParameters(
+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 
+ 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 GetValueCellValue( const ScAddress&, const ScValueCell* );
+ ScBaseCell* GetCell( const ScAddress& 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 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
+@@ -3020,12 +3020,13 @@ double ScInterpreter::IterateParameters(
  	ScRange aRange;
  	for (short i = 0; i < nParamCount; i++)
  	{
@@ -33,27 +35,27 @@
  			case svString:
  			{
 -				if( eFunc == ifCOUNT )
-+				if( eFunc == ifCOUNT && eStackType == svString)
++				if ( eFunc == ifCOUNT && eStackType == svString )
  				{
  					String aStr( PopString() );
  					sal_uInt32 nFIndex = 0;					// damit default Land/Spr.
-@@ -2699,42 +2700,23 @@ double ScInterpreter::IterateParameters(
+@@ -3034,42 +3035,23 @@ double ScInterpreter::IterateParameters(
  				}
  				else
  				{
-+					if ( bTextAsZero && eStackType == svString)
-+					{
-+						Pop();
-+						nCount++;
-+						if ( eFunc == ifPRODUCT )
-+							fRes = 0.0;
-+						fVal = 0;
-+					}
-+					else
-+					{
-+						fVal = GetDouble();
-+						nCount++;
-+					}
++                    if ( bTextAsZero && eStackType == svString )
++                    {
++                        Pop();
++                        nCount++;
++                        if ( eFunc == ifPRODUCT )
++                            fRes = 0.0;
++                        fVal = 0;
++                    }
++                    else
++                    {
++                        fVal = GetDouble();
++                        nCount++;
++                    }
  					switch ( eFunc )
  					{
  						case ifAVERAGE:
@@ -93,7 +95,7 @@
  						if ( bNull && fVal != 0.0 )
  						{
  							bNull = FALSE;
-@@ -2743,12 +2725,16 @@ double ScInterpreter::IterateParameters(
+@@ -3078,12 +3060,15 @@ double ScInterpreter::IterateParameters(
  						else
  							fRes += fVal;
  						break;
@@ -103,8 +105,7 @@
 +						case ifSUMSQ:	fRes += fVal * fVal; break;
 +						case ifPRODUCT:	fRes *= fVal; break;
 +
-+						default:
-+							break;
++						default:;
 +					}
  				}
  				nFuncFmtType = NUMBERFORMAT_NUMBER;
@@ -114,3 +115,174 @@
  			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(
+ }
+ 
+ 
+-double ScInterpreter::GetCellValue( const ScAddress& rPos, const ScBaseCell* pCell )
++double ScInterpreter::GetCellValue( const ScAddress& rPos, const ScBaseCell* pCell, bool bIgnoreNoValueError )
+ {
+ 	USHORT nErr = nGlobalError;
+ 	nGlobalError = 0;
+ 	double nVal = GetCellValueOrZero( rPos, pCell );
+-    if ( !nGlobalError || nGlobalError == errCellNoValue )
++    if ( bIgnoreNoValueError && (!nGlobalError || nGlobalError == errCellNoValue) )
+ 		nGlobalError = nErr;
+ 	return nVal;
+ }
+@@ -260,7 +260,7 @@ double ScInterpreter::GetCellValueOrZero
+ 			break;
+ 			case  CELLTYPE_STRING:
+ 			case  CELLTYPE_EDIT:
+-#if 0
++#if 1 /* JEG : re-enable because compatibility is more important than consistency for this */
+ // Xcl does it, but SUM(A1:A2) differs from A1+A2. No good.
+ 			{
+ 				String aStr;
+@@ -271,7 +271,7 @@ double ScInterpreter::GetCellValueOrZero
+ 				sal_uInt32 nFIndex = 0;					// damit default Land/Spr.
+ 				if ( !pFormatter->IsNumberFormat( aStr, nFIndex, fValue ) )
+ 				{
+-					SetError(errNoValue);
++					SetError(errCellNoValue);	/* CellNoValue is not really an error */
+ 					fValue = 0.0;
+ 				}
+ 			}
+@@ -1440,7 +1440,7 @@ BOOL ScInterpreter::DoubleRefToPosSingle
+ }
+ 
+ 
+-double ScInterpreter::GetDouble()
++double ScInterpreter::GetDouble( bool bIgnoreNoValueError )
+ {
+ 	double nVal;
+ 	switch( GetStackType() )
+@@ -1464,7 +1464,7 @@ double ScInterpreter::GetDouble()
+ 			ScAddress aAdr;
+ 			PopSingleRef( aAdr );
+ 			ScBaseCell* pCell = GetCell( aAdr );
+-			nVal = GetCellValue( aAdr, pCell );
++			nVal = GetCellValue( aAdr, pCell, bIgnoreNoValueError );
+ 		}
+ 		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
+@@ -1522,7 +1522,12 @@ void ScInterpreter::ScAdd()
+ 		pMat2 = GetMatrix();
+ 	else
+ 	{
+-		fVal2 = GetDouble();
++		fVal2 = GetDouble(false);
++        if (nGlobalError)
++        {
++            PushError(nGlobalError);
++            return;
++        }
+ 		switch ( nCurFmtType )
+ 		{
+ 			case NUMBERFORMAT_DATE :
+@@ -1543,7 +1548,12 @@ void ScInterpreter::ScAdd()
+ 		pMat1 = GetMatrix();
+ 	else
+ 	{
+-		fVal1 = GetDouble();
++		fVal1 = GetDouble(false);
++        if (nGlobalError)
++        {
++            PushError(nGlobalError);
++            return;
++        }
+ 		switch ( nCurFmtType )
+ 		{
+ 			case NUMBERFORMAT_DATE :
+@@ -1717,7 +1727,12 @@ void ScInterpreter::ScSub()
+ 		pMat2 = GetMatrix();
+ 	else
+ 	{
+-		fVal2 = GetDouble();
++		fVal2 = GetDouble(false);
++        if (nGlobalError)
++        {
++            PushError(nGlobalError);
++            return;
++        }
+ 		switch ( nCurFmtType )
+ 		{
+ 			case NUMBERFORMAT_DATE :
+@@ -1738,7 +1753,12 @@ void ScInterpreter::ScSub()
+ 		pMat1 = GetMatrix();
+ 	else
+ 	{
+-		fVal1 = GetDouble();
++		fVal1 = GetDouble(false);
++        if (nGlobalError)
++        {
++            PushError(nGlobalError);
++            return;
++        }
+ 		switch ( nCurFmtType )
+ 		{
+ 			case NUMBERFORMAT_DATE :
+@@ -1832,7 +1852,12 @@ void ScInterpreter::ScMul()
+ 		pMat2 = GetMatrix();
+ 	else
+ 	{
+-		fVal2 = GetDouble();
++		fVal2 = GetDouble(false);
++        if (nGlobalError)
++        {
++            PushError(nGlobalError);
++            return;
++        }
+ 		switch ( nCurFmtType )
+ 		{
+ 			case NUMBERFORMAT_CURRENCY :
+@@ -1845,7 +1870,12 @@ void ScInterpreter::ScMul()
+ 		pMat1 = GetMatrix();
+ 	else
+ 	{
+-		fVal1 = GetDouble();
++		fVal1 = GetDouble(false);
++        if (nGlobalError)
++        {
++            PushError(nGlobalError);
++            return;
++        }
+ 		switch ( nCurFmtType )
+ 		{
+ 			case NUMBERFORMAT_CURRENCY :
+@@ -1910,7 +1940,12 @@ void ScInterpreter::ScDiv()
+ 		pMat2 = GetMatrix();
+ 	else
+ 	{
+-		fVal2 = GetDouble();
++		fVal2 = GetDouble(false);
++        if (nGlobalError)
++        {
++            PushError(nGlobalError);
++            return;
++        }
+ 		// hier kein Currency uebernehmen, 123kg/456DM sind nicht DM
+ 		nFmtCurrencyType2 = nCurFmtType;
+ 	}
+@@ -1918,7 +1953,12 @@ void ScInterpreter::ScDiv()
+ 		pMat1 = GetMatrix();
+ 	else
+ 	{
+-		fVal1 = GetDouble();
++		fVal1 = GetDouble(false);
++        if (nGlobalError)
++        {
++            PushError(nGlobalError);
++            return;
++        }
+ 		switch ( nCurFmtType )
+ 		{
+ 			case NUMBERFORMAT_CURRENCY :



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