ooo-build r12254 - in trunk: . patches/dev300 patches/src680



Author: kyoshida
Date: Mon Apr 21 15:41:07 2008
New Revision: 12254
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12254&view=rev

Log:
2008-04-21  Kohei Yoshida  <kyoshida novell com>

	* patches/dev300/apply:
	* patches/src680/sc-string-arg.diff: adjusted for DEV300 codebase.


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

Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply	(original)
+++ trunk/patches/dev300/apply	Mon Apr 21 15:41:07 2008
@@ -623,7 +623,7 @@
 sc-dp-gridlayout.diff, i#68544, n#190970, jody
 
 # Excel compatibility for handling of "string numbers".
-#FIXME dev300: sc-string-arg.diff, i#5658, kohei
+sc-string-arg.diff, i#5658, kohei
 
 # Print_Area/Print_Titles are only relevant for sheet local names, n#191005
 sc-xls-builtin-name-scope.diff, n#191005, n#257422, jonp

Modified: trunk/patches/src680/sc-string-arg.diff
==============================================================================
--- trunk/patches/src680/sc-string-arg.diff	(original)
+++ trunk/patches/src680/sc-string-arg.diff	Mon Apr 21 15:41:07 2008
@@ -1,8 +1,8 @@
 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-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
+--- sc.clean/source/core/inc/interpre.hxx	2008-04-01 12:26:35.000000000 -0400
++++ sc/source/core/inc/interpre.hxx	2008-04-21 11:10:56.000000000 -0400
+@@ -192,8 +192,8 @@ void ReplaceCell( ScAddress& );     // f
+ 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* );
@@ -11,8 +11,8 @@
 +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 );
+     { return pDok->GetCell( rPos ); }
+@@ -332,7 +332,7 @@ StackVar GetStackType( BYTE nParam );
  BYTE GetByte() { return cPar; }
  // generiert aus DoubleRef positionsabhaengige SingleRef
  BOOL DoubleRefToPosSingleRef( const ScRange& rRange, ScAddress& rAdr );
@@ -22,29 +22,29 @@
  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-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++)
- 	{
--		switch (GetStackType())
-+		StackVar eStackType = GetStackType();
-+		switch (eStackType)
- 		{
+--- sc.clean/source/core/tool/interpr1.cxx	2008-04-01 12:26:37.000000000 -0400
++++ sc/source/core/tool/interpr1.cxx	2008-04-21 11:21:35.000000000 -0400
+@@ -3059,12 +3059,13 @@ double ScInterpreter::IterateParameters(
+     size_t nRefInList = 0;
+     while (nParamCount-- > 0)
+     {
+-        switch (GetStackType())
++        StackVar eStackType = GetStackType();
++        switch (eStackType)
+         {
 -
-+			case svDouble:
- 			case svString:
- 			{
--				if( eFunc == ifCOUNT )
-+				if ( eFunc == ifCOUNT && eStackType == svString )
- 				{
- 					String aStr( PopString() );
- 					sal_uInt32 nFIndex = 0;					// damit default Land/Spr.
-@@ -3034,42 +3035,23 @@ double ScInterpreter::IterateParameters(
- 				}
- 				else
- 				{
++            case svDouble:
+             case svString:
+             {
+-                if( eFunc == ifCOUNT )
++                if( eFunc == ifCOUNT && eStackType == svString  )
+                 {
+                     String aStr( PopString() );
+                     sal_uInt32 nFIndex = 0;                 // damit default Land/Spr.
+@@ -3073,42 +3074,23 @@ double ScInterpreter::IterateParameters(
+                 }
+                 else
+                 {
 +                    if ( bTextAsZero && eStackType == svString )
 +                    {
 +                        Pop();
@@ -58,69 +58,69 @@
 +                        fVal = GetDouble();
 +                        nCount++;
 +                    }
- 					switch ( eFunc )
- 					{
- 						case ifAVERAGE:
- 						case ifSUM:
--						case ifSUMSQ:
--						case ifPRODUCT:
--						{
--							if ( bTextAsZero )
--							{
--								Pop();
--								nCount++;
--								if ( eFunc == ifPRODUCT )
--									fRes = 0.0;
--							}
--							else
--							{
--								for ( ; i < nParamCount; i++ )
--									Pop();
--								SetError( errNoValue );
--							}
--						}
--						break;
--						default:
--							Pop();
--							nCount++;
--					}
--				}
--			}
--			break;
--			case svDouble    :
--				fVal = GetDouble();
--				nCount++;
--				switch( eFunc )
--				{
--					case ifAVERAGE:
--					case ifSUM:
- 						if ( bNull && fVal != 0.0 )
- 						{
- 							bNull = FALSE;
-@@ -3078,12 +3060,15 @@ double ScInterpreter::IterateParameters(
- 						else
- 							fRes += fVal;
- 						break;
--					case ifSUMSQ:	fRes += fVal * fVal; break;
--					case ifPRODUCT:	fRes *= fVal; break;
+                     switch ( eFunc )
+                     {
+                         case ifAVERAGE:
+                         case ifSUM:
+-                        case ifSUMSQ:
+-                        case ifPRODUCT:
+-                        {
+-                            if ( bTextAsZero )
+-                            {
+-                                Pop();
+-                                nCount++;
+-                                if ( eFunc == ifPRODUCT )
+-                                    fRes = 0.0;
+-                            }
+-                            else
+-                            {
+-                                while (nParamCount-- > 0)
+-                                    Pop();
+-                                SetError( errNoValue );
+-                            }
+-                        }
+-                        break;
+-                        default:
+-                            Pop();
+-                            nCount++;
+-                    }
+-                }
+-            }
+-            break;
+-            case svDouble    :
+-                fVal = GetDouble();
+-                nCount++;
+-                switch( eFunc )
+-                {
+-                    case ifAVERAGE:
+-                    case ifSUM:
+                         if ( bNull && fVal != 0.0 )
+                         {
+                             bNull = FALSE;
+@@ -3117,12 +3099,15 @@ double ScInterpreter::IterateParameters(
+                         else
+                             fRes += fVal;
+                         break;
+-                    case ifSUMSQ:   fRes += fVal * fVal; break;
+-                    case ifPRODUCT: fRes *= fVal; break;
 -                    default: ; // nothing
-+						case ifSUMSQ:	fRes += fVal * fVal; break;
-+						case ifPRODUCT:	fRes *= fVal; break;
-+
-+						default:;
-+					}
- 				}
- 				nFuncFmtType = NUMBERFORMAT_NUMBER;
--				break;
-+			}
-+			break;
- 			case svSingleRef :
- 			{
- 				PopSingleRef( aAdr );
++                        case ifSUMSQ:   fRes += fVal * fVal; break;
++                        case ifPRODUCT: fRes *= fVal; break;
++ 
++                        default:;
++                    }
+                 }
+                 nFuncFmtType = NUMBERFORMAT_NUMBER;
+-                break;
++            }
++            break;
+             case svSingleRef :
+             {
+                 PopSingleRef( aAdr );
 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-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(
+--- sc.clean/source/core/tool/interpr4.cxx	2008-04-01 12:26:37.000000000 -0400
++++ sc/source/core/tool/interpr4.cxx	2008-04-21 11:26:59.000000000 -0400
+@@ -203,18 +203,19 @@ double ScInterpreter::GetValueCellValue(
  }
  
  
@@ -128,179 +128,178 @@
 +double ScInterpreter::GetCellValue( const ScAddress& rPos, const ScBaseCell* pCell, 
 +                                    bool bNoValueAsError, bool bBlankAsZero )
  {
- 	USHORT nErr = nGlobalError;
- 	nGlobalError = 0;
--	double nVal = GetCellValueOrZero( rPos, pCell );
+     USHORT nErr = nGlobalError;
+     nGlobalError = 0;
+-    double nVal = GetCellValueOrZero( rPos, pCell );
 -    if ( !nGlobalError || nGlobalError == errCellNoValue )
-+	double nVal = GetCellValueOrZero( rPos, pCell, bBlankAsZero );
++    double nVal = GetCellValueOrZero( rPos, pCell, bBlankAsZero );
 +    if ( !nGlobalError || (!bNoValueAsError && nGlobalError == errCellNoValue) )
- 		nGlobalError = nErr;
- 	return nVal;
+         nGlobalError = nErr;
+     return nVal;
  }
  
  
 -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:
+     double fValue;
+     if (pCell)
+@@ -258,7 +259,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,14 +272,15 @@ 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;
- 				}
- 			}
- 			break;
+             {
+                 String aStr;
+@@ -269,14 +270,15 @@ 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;
+                 }
+             }
+             break;
  #endif
- 			default:
+             default:
 -                SetError(errCellNoValue);
 +                if (!bBlankAsZero)
 +                    SetError(errCellNoValue);
- 				fValue = 0.0;
- 		}
- 	}
-@@ -1440,7 +1442,7 @@ BOOL ScInterpreter::DoubleRefToPosSingle
+                 fValue = 0.0;
+         }
+     }
+@@ -1565,7 +1567,7 @@ BOOL ScInterpreter::DoubleRefToPosSingle
  }
  
  
 -double ScInterpreter::GetDouble()
 +double ScInterpreter::GetDouble( bool bNoValueAsError, bool bBlankAsZero )
  {
- 	double nVal;
- 	switch( GetStackType() )
-@@ -1464,7 +1466,7 @@ double ScInterpreter::GetDouble()
- 			ScAddress aAdr;
- 			PopSingleRef( aAdr );
- 			ScBaseCell* pCell = GetCell( aAdr );
--			nVal = GetCellValue( aAdr, pCell );
-+			nVal = GetCellValue( aAdr, pCell, bNoValueAsError, bBlankAsZero );
- 		}
- 		break;
- 		case svDoubleRef:
+     double nVal;
+     switch( GetRawStackType() )
+@@ -1589,7 +1591,7 @@ double ScInterpreter::GetDouble()
+             ScAddress aAdr;
+             PopSingleRef( aAdr );
+             ScBaseCell* pCell = GetCell( aAdr );
+-            nVal = GetCellValue( aAdr, pCell );
++            nVal = GetCellValue( aAdr, pCell, bNoValueAsError, bBlankAsZero );
+         }
+         break;
+         case svDoubleRef:
 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-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(true, true);
+--- sc.clean/source/core/tool/interpr5.cxx	2008-04-01 12:26:37.000000000 -0400
++++ sc/source/core/tool/interpr5.cxx	2008-04-21 11:34:12.000000000 -0400
+@@ -1419,7 +1419,12 @@ void ScInterpreter::ScAdd()
+         pMat2 = GetMatrix();
+     else
+     {
+-        fVal2 = GetDouble();
++        fVal2 = GetDouble(true, true);
 +        if (nGlobalError)
 +        {
 +            PushError(nGlobalError);
 +            return;
 +        }
- 		switch ( nCurFmtType )
- 		{
- 			case NUMBERFORMAT_DATE :
-@@ -1543,7 +1548,12 @@ void ScInterpreter::ScAdd()
- 		pMat1 = GetMatrix();
- 	else
- 	{
--		fVal1 = GetDouble();
-+		fVal1 = GetDouble(true, true);
+         switch ( nCurFmtType )
+         {
+             case NUMBERFORMAT_DATE :
+@@ -1440,7 +1445,12 @@ void ScInterpreter::ScAdd()
+         pMat1 = GetMatrix();
+     else
+     {
+-        fVal1 = GetDouble();
++        fVal1 = GetDouble(true, true);
 +        if (nGlobalError)
 +        {
 +            PushError(nGlobalError);
 +            return;
 +        }
- 		switch ( nCurFmtType )
- 		{
- 			case NUMBERFORMAT_DATE :
-@@ -1717,7 +1727,12 @@ void ScInterpreter::ScSub()
- 		pMat2 = GetMatrix();
- 	else
- 	{
--		fVal2 = GetDouble();
-+		fVal2 = GetDouble(true, true);
+         switch ( nCurFmtType )
+         {
+             case NUMBERFORMAT_DATE :
+@@ -1614,7 +1624,11 @@ void ScInterpreter::ScSub()
+         pMat2 = GetMatrix();
+     else
+     {
+-        fVal2 = GetDouble();
 +        if (nGlobalError)
 +        {
 +            PushError(nGlobalError);
 +            return;
 +        }
- 		switch ( nCurFmtType )
- 		{
- 			case NUMBERFORMAT_DATE :
-@@ -1738,7 +1753,12 @@ void ScInterpreter::ScSub()
- 		pMat1 = GetMatrix();
- 	else
- 	{
--		fVal1 = GetDouble();
-+		fVal1 = GetDouble(true, true);
+         switch ( nCurFmtType )
+         {
+             case NUMBERFORMAT_DATE :
+@@ -1635,7 +1649,12 @@ void ScInterpreter::ScSub()
+         pMat1 = GetMatrix();
+     else
+     {
+-        fVal1 = GetDouble();
++        fVal1 = GetDouble(true, true);
 +        if (nGlobalError)
 +        {
 +            PushError(nGlobalError);
 +            return;
 +        }
- 		switch ( nCurFmtType )
- 		{
- 			case NUMBERFORMAT_DATE :
-@@ -1832,7 +1852,12 @@ void ScInterpreter::ScMul()
- 		pMat2 = GetMatrix();
- 	else
- 	{
--		fVal2 = GetDouble();
-+		fVal2 = GetDouble(true, true);
+         switch ( nCurFmtType )
+         {
+             case NUMBERFORMAT_DATE :
+@@ -1729,7 +1748,12 @@ void ScInterpreter::ScMul()
+         pMat2 = GetMatrix();
+     else
+     {
+-        fVal2 = GetDouble();
++        fVal2 = GetDouble(true, true);
 +        if (nGlobalError)
 +        {
 +            PushError(nGlobalError);
 +            return;
 +        }
- 		switch ( nCurFmtType )
- 		{
- 			case NUMBERFORMAT_CURRENCY :
-@@ -1845,7 +1870,12 @@ void ScInterpreter::ScMul()
- 		pMat1 = GetMatrix();
- 	else
- 	{
--		fVal1 = GetDouble();
-+		fVal1 = GetDouble(true, true);
+         switch ( nCurFmtType )
+         {
+             case NUMBERFORMAT_CURRENCY :
+@@ -1742,7 +1766,12 @@ void ScInterpreter::ScMul()
+         pMat1 = GetMatrix();
+     else
+     {
+-        fVal1 = GetDouble();
++        fVal1 = GetDouble(true, true);
 +        if (nGlobalError)
 +        {
 +            PushError(nGlobalError);
 +            return;
 +        }
- 		switch ( nCurFmtType )
- 		{
- 			case NUMBERFORMAT_CURRENCY :
-@@ -1910,7 +1940,12 @@ void ScInterpreter::ScDiv()
- 		pMat2 = GetMatrix();
- 	else
- 	{
--		fVal2 = GetDouble();
-+		fVal2 = GetDouble(true, true);
+         switch ( nCurFmtType )
+         {
+             case NUMBERFORMAT_CURRENCY :
+@@ -1807,7 +1836,12 @@ void ScInterpreter::ScDiv()
+         pMat2 = GetMatrix();
+     else
+     {
+-        fVal2 = GetDouble();
++        fVal2 = GetDouble(true, true);
 +        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(true, true);
+         // hier kein Currency uebernehmen, 123kg/456DM sind nicht DM
+         nFmtCurrencyType2 = nCurFmtType;
+     }
+@@ -1815,7 +1849,12 @@ void ScInterpreter::ScDiv()
+         pMat1 = GetMatrix();
+     else
+     {
+-        fVal1 = GetDouble();
++        fVal1 = GetDouble(true, true);
 +        if (nGlobalError)
 +        {
 +            PushError(nGlobalError);
 +            return;
 +        }
- 		switch ( nCurFmtType )
- 		{
- 			case NUMBERFORMAT_CURRENCY :
+         switch ( nCurFmtType )
+         {
+             case NUMBERFORMAT_CURRENCY :



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