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



Author: kyoshida
Date: Tue Mar  4 05:53:41 2008
New Revision: 11795
URL: http://svn.gnome.org/viewvc/ooo-build?rev=11795&view=rev

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

	* patches/src680/sc-localized-arg-separator.diff: fixed incorrect matrix
	expression parsing in the formula wizard dialog.


Modified:
   trunk/ChangeLog
   trunk/patches/src680/sc-localized-arg-separator.diff

Modified: trunk/patches/src680/sc-localized-arg-separator.diff
==============================================================================
--- trunk/patches/src680/sc-localized-arg-separator.diff	(original)
+++ trunk/patches/src680/sc-localized-arg-separator.diff	Tue Mar  4 05:53:41 2008
@@ -191,18 +191,6 @@
  };
  
  //==================================================================
-diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sc.vpj sc.clean/source/core/data/cell2.cxx sc/source/core/data/cell2.cxx
---- sc.clean/source/core/data/cell2.cxx	2008-03-03 11:24:50.000000000 -0500
-+++ sc/source/core/data/cell2.cxx	2008-03-03 14:41:43.000000000 -0500
-@@ -36,7 +36,7 @@
- // MARKER(update_precomp.py): autogen include statement, do not remove
- #include "precompiled_sc.hxx"
- 
--
-+#include <stdio.h>
- 
- // INCLUDE ---------------------------------------------------------------
- 
 diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sc.vpj sc.clean/source/core/data/documen3.cxx sc/source/core/data/documen3.cxx
 --- sc.clean/source/core/data/documen3.cxx	2008-03-03 11:24:50.000000000 -0500
 +++ sc/source/core/data/documen3.cxx	2008-03-03 11:33:34.000000000 -0500
@@ -219,7 +207,7 @@
  const ScViewOptions& ScDocument::GetViewOptions() const
 diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sc.vpj sc.clean/source/core/data/global.cxx sc/source/core/data/global.cxx
 --- sc.clean/source/core/data/global.cxx	2008-03-03 11:24:50.000000000 -0500
-+++ sc/source/core/data/global.cxx	2008-03-03 12:29:18.000000000 -0500
++++ sc/source/core/data/global.cxx	2008-03-04 00:34:14.000000000 -0500
 @@ -1061,6 +1061,7 @@ const ScFuncDesc* ScFormulaUtil::GetDefa
  
  BOOL ScFormulaUtil::GetNextFunc( const String&	rFormula,
@@ -307,11 +295,11 @@
  xub_StrLen ScFormulaUtil::GetFunctionStart( const String&	rFormula,
  										xub_StrLen		nStart,
  										BOOL			bBack,
-+                                        ScAddress::Convention eConv,
++                                        ScAddress::Convention /*eConv*/,
  										String*			pFuncName )
  {
  	xub_StrLen nStrLen = rFormula.Len();
-@@ -1265,8 +1269,10 @@ xub_StrLen ScFormulaUtil::GetFunctionSta
+@@ -1265,14 +1269,23 @@ xub_StrLen ScFormulaUtil::GetFunctionSta
  
  //------------------------------------------------------------------------
  
@@ -319,20 +307,56 @@
 +xub_StrLen	ScFormulaUtil::GetFunctionEnd( const String& rStr, xub_StrLen nStart,
 +                                           ScAddress::Convention eConv )
  {
-+    const sal_Unicode sep = ScCompiler::GetStringFromOpCode(ocSep, false, eConv).GetChar(0);
  	xub_StrLen nStrLen = rStr.Len();
  
  	if ( nStrLen < nStart )
-@@ -1298,7 +1304,7 @@ xub_StrLen	ScFormulaUtil::GetFunctionEnd
+ 		return nStart;
+ 
++    // We assume the following tokens are single-character tokens.
++    const sal_Unicode open       = ScCompiler::GetStringFromOpCode(ocOpen,  false, eConv).GetChar(0);
++    const sal_Unicode close      = ScCompiler::GetStringFromOpCode(ocClose, false, eConv).GetChar(0);
++    const sal_Unicode sep        = ScCompiler::GetStringFromOpCode(ocSep, false, eConv).GetChar(0);
++    const sal_Unicode arrayOpen  = ScCompiler::GetStringFromOpCode(ocArrayOpen,  false, eConv).GetChar(0);
++    const sal_Unicode arrayClose = ScCompiler::GetStringFromOpCode(ocArrayClose, false, eConv).GetChar(0);
++
+ 	short	nParCount = 0;
++    bool    bInArray = false;
+ 	BOOL	bFound = FALSE;
+ 
+ 	while ( !bFound && (nStart < nStrLen) )
+@@ -1285,9 +1298,9 @@ xub_StrLen	ScFormulaUtil::GetFunctionEnd
+ 			while ( (nStart < nStrLen) && rStr.GetChar(nStart) != '"' )
+ 				nStart++;
+ 		}
+-		else if ( c == '(' )
++		else if ( c == open )
+ 			nParCount++;
+-		else if ( c == ')' )
++		else if ( c == close )
+ 		{
+ 			nParCount--;
+ 			if ( nParCount == 0 )
+@@ -1298,9 +1311,17 @@ xub_StrLen	ScFormulaUtil::GetFunctionEnd
  				nStart--;	// einen zu weit gelesen
  			}
  		}
 -		else if ( c == ';' )
++        else if ( c == arrayOpen )
++        {
++            bInArray = true;
++        }
++        else if ( c == arrayClose )
++        {
++            bInArray = false;
++        }
 +		else if ( c == sep )
  		{
- 			if ( nParCount == 0 )
+-			if ( nParCount == 0 )
++			if ( !bInArray && nParCount == 0 )
  			{
-@@ -1314,8 +1320,11 @@ xub_StrLen	ScFormulaUtil::GetFunctionEnd
+ 				bFound = TRUE;
+ 				nStart--;	// einen zu weit gelesen
+@@ -1314,14 +1335,23 @@ xub_StrLen	ScFormulaUtil::GetFunctionEnd
  
  //------------------------------------------------------------------
  
@@ -340,21 +364,56 @@
 +xub_StrLen ScFormulaUtil::GetArgStart( const String& rStr, xub_StrLen nStart, USHORT nArg,
 +                                       ScAddress::Convention eConv )
  {
-+    const sal_Unicode sep = ScCompiler::GetStringFromOpCode(ocSep, false, eConv).GetChar(0);
-+
  	xub_StrLen nStrLen = rStr.Len();
  
  	if ( nStrLen < nStart )
-@@ -1344,7 +1353,7 @@ xub_StrLen ScFormulaUtil::GetArgStart( c
+ 		return nStart;
+ 
++    // We assume the following tokens are single-character tokens.
++    const sal_Unicode open       = ScCompiler::GetStringFromOpCode(ocOpen,  false, eConv).GetChar(0);
++    const sal_Unicode close      = ScCompiler::GetStringFromOpCode(ocClose, false, eConv).GetChar(0);
++    const sal_Unicode sep        = ScCompiler::GetStringFromOpCode(ocSep, false, eConv).GetChar(0);
++    const sal_Unicode arrayOpen  = ScCompiler::GetStringFromOpCode(ocArrayOpen,  false, eConv).GetChar(0);
++    const sal_Unicode arrayClose = ScCompiler::GetStringFromOpCode(ocArrayClose, false, eConv).GetChar(0);
++
+ 	short	nParCount	= 0;
++    bool    bInArray    = false;
+ 	BOOL	bFound		= FALSE;
+ 
+ 	while ( !bFound && (nStart < nStrLen) )
+@@ -1334,19 +1364,27 @@ xub_StrLen ScFormulaUtil::GetArgStart( c
+ 			while ( (nStart < nStrLen) && rStr.GetChar(nStart) != '"' )
+ 				nStart++;
+ 		}
+-		else if ( c == '(' )
++		else if ( c == open )
+ 		{
+ 			bFound = ( nArg == 0 );
+ 			nParCount++;
+ 		}
+-		else if ( c == ')' )
++		else if ( c == close )
+ 		{
  			nParCount--;
  			bFound = ( nParCount == 0 );
  		}
 -		else if ( c == ';' )
++        else if ( c == arrayOpen )
++        {
++            bInArray = true;
++        }
++        else if ( c == arrayClose )
++        {
++            bInArray = false;
++        }
 +		else if ( c == sep )
  		{
- 			if ( nParCount == 1 )
+-			if ( nParCount == 1 )
++			if ( !bInArray && nParCount == 1 )
  			{
-@@ -1702,8 +1711,10 @@ void ScFuncDesc::InitArgumentInfo() cons
+ 				nArg--;
+ 				bFound = ( nArg == 0  );
+@@ -1702,8 +1740,10 @@ void ScFuncDesc::InitArgumentInfo() cons
  
  //------------------------------------------------------------------------
  
@@ -366,7 +425,7 @@
      String aSig;
  
      if ( nArgCount > 0 )
-@@ -1714,7 +1725,10 @@ String ScFuncDesc::GetParamList() const
+@@ -1714,7 +1754,10 @@ String ScFuncDesc::GetParamList() const
              {
                  aSig += *(aDefArgNames[i]);
                  if ( i != nArgCount-1 )
@@ -378,7 +437,7 @@
              }
          }
          else
-@@ -1723,14 +1737,17 @@ String ScFuncDesc::GetParamList() const
+@@ -1723,14 +1766,17 @@ String ScFuncDesc::GetParamList() const
              for ( USHORT nArg = 0; nArg < nFix; nArg++ )
              {
                  aSig += *(aDefArgNames[nArg]);
@@ -399,7 +458,7 @@
          }
      }
  
-@@ -1739,7 +1756,7 @@ String ScFuncDesc::GetParamList() const
+@@ -1739,7 +1785,7 @@ String ScFuncDesc::GetParamList() const
  
  //------------------------------------------------------------------------
  
@@ -408,7 +467,7 @@
  {
  	String aSig;
  
-@@ -1747,7 +1764,7 @@ String ScFuncDesc::GetSignature() const
+@@ -1747,7 +1793,7 @@ String ScFuncDesc::GetSignature() const
  	{
  		aSig = *pFuncName;
  
@@ -417,20 +476,19 @@
          if( aParamList.Len() )
          {
  			aSig.AppendAscii(RTL_CONSTASCII_STRINGPARAM( "( " ));
-@@ -1763,8 +1780,11 @@ String ScFuncDesc::GetSignature() const
+@@ -1763,8 +1809,10 @@ String ScFuncDesc::GetSignature() const
  
  //------------------------------------------------------------------------
  
 -String ScFuncDesc::GetFormulaString( String** aArgArr ) const
 +String ScFuncDesc::GetFormulaString( String** aArgArr, ScAddress::Convention eConv ) const
  {
-+    fprintf(stdout, "ScFuncDesc::GetFormulaString: --begin\n");fflush(stdout);
 +    const String& sep = ScCompiler::GetStringFromOpCode(ocSep, false, eConv);
 +
  	String aFormula;
  
  	if(pFuncName)
-@@ -1787,7 +1807,7 @@ String ScFuncDesc::GetFormulaString( Str
+@@ -1787,7 +1835,7 @@ String ScFuncDesc::GetFormulaString( Str
  					{
  						bLastArg = !( aArgArr[i+1]->Len() > 0 );
  						if ( !bLastArg )
@@ -439,17 +497,9 @@
  					}
  				}
  			}
-@@ -1795,6 +1815,7 @@ String ScFuncDesc::GetFormulaString( Str
- 
- 		aFormula += ')';
- 	}
-+    fprintf(stdout, "ScFuncDesc::GetFormulaString: --end\n");fflush(stdout);
- 	return aFormula;
- }
- 
 diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sc.vpj sc.clean/source/core/tool/compiler.cxx sc/source/core/tool/compiler.cxx
 --- sc.clean/source/core/tool/compiler.cxx	2008-03-03 11:24:50.000000000 -0500
-+++ sc/source/core/tool/compiler.cxx	2008-03-03 16:30:05.000000000 -0500
++++ sc/source/core/tool/compiler.cxx	2008-03-04 00:30:30.000000000 -0500
 @@ -439,6 +439,7 @@ void ScCompiler::SetCompileEnglish( BOOL
          if (!pCharClassEnglish)
              InitCharClassEnglish();
@@ -499,7 +549,7 @@
      static bool GetDocAndTab( const ScCompiler& rComp,
                                const SingleRefData& rRef,
                                String& rDocName,
-@@ -1314,8 +1333,53 @@ struct ConventionXL
+@@ -1314,8 +1333,50 @@ struct ConventionXL
              rBuf.append( sal_Unicode( '!' ) );
          }
      }
@@ -511,19 +561,16 @@
 +        {
 +            if (rName.Equals(ConventionXL::maArrayRowSep))
 +            {
-+                fprintf(stdout, "ConventionXL_A1::GetOpCode:   ocArrayRowSep\n");fflush(stdout);
 +                return ocArrayRowSep;
 +            }
 +            else if (rName.Equals(ConventionXL::maArrayColSep))
 +            {
-+                fprintf(stdout, "ConventionXL_A1::GetOpCode:   ocArrayColSep\n");fflush(stdout);
 +                return ocArrayColSep;
 +            }       
 +        }
 +
 +        if (rName.Equals(ConventionXL::maSep))
 +        {
-+            fprintf(stdout, "ConventionXL_A1::GetOpCode:   ocSep\n");fflush(stdout);
 +            return ocSep;
 +        }
 +
@@ -553,7 +600,7 @@
  struct ConventionXL_A1 : public Convention_A1, public ConventionXL
  {
      ConventionXL_A1() : Convention_A1( ScAddress::CONV_XL_A1 ) { }
-@@ -1389,6 +1453,25 @@ struct ConventionXL_A1 : public Conventi
+@@ -1389,6 +1450,25 @@ struct ConventionXL_A1 : public Conventi
              MakeRowStr( rBuf, aRef.Ref2.nRow );
          }
      }
@@ -579,7 +626,7 @@
  };
  
  static const ConventionXL_A1 ConvXL_A1;
-@@ -1508,6 +1591,21 @@ struct ConventionXL_R1C1 : public ScComp
+@@ -1508,6 +1588,21 @@ struct ConventionXL_R1C1 : public ScComp
          return pCharClass->parseAnyToken( rFormula,
                  nSrcPos, nStartFlags, aAddAllowed, nContFlags, aAddAllowed );
      }
@@ -601,7 +648,7 @@
  };
  
  static const ConventionXL_R1C1 ConvXL_R1C1;
-@@ -1968,15 +2066,16 @@ xub_StrLen ScCompiler::NextSymbol()
+@@ -1968,15 +2063,16 @@ xub_StrLen ScCompiler::NextSymbol()
  // Convert symbol to token
  //---------------------------------------------------------------------------
  
@@ -623,7 +670,7 @@
      }
      else
      {
-@@ -2776,8 +2875,9 @@ void ScCompiler::AutoCorrectParsedSymbol
+@@ -2776,8 +2872,9 @@ void ScCompiler::AutoCorrectParsedSymbol
      }
  }
  
@@ -634,7 +681,7 @@
      xub_StrLen nSpaces = NextSymbol();
  
  #if 0
-@@ -2836,7 +2936,7 @@ BOOL ScCompiler::NextNewToken( bool bAll
+@@ -2836,7 +2933,7 @@ BOOL ScCompiler::NextNewToken( bool bAll
              // IsReference().
              // IsBoolean before isValue to catch inline bools without the kludge
              //    for inline arrays.
@@ -643,28 +690,7 @@
                && !IsReference( aOrg )
                && !(bAllowBooleans && IsBoolean( aUpper ))
                && !IsValue( aUpper )
-@@ -2872,6 +2972,8 @@ BOOL ScCompiler::NextNewToken( bool bAll
- ScTokenArray* ScCompiler::CompileString( const String& rFormula,
-                                          ScAddress::Convention eConv )
- {
-+    fprintf(stdout, "ScCompiler::CompileString: formula = '%s'\n",
-+            rtl::OUStringToOString(rFormula, RTL_TEXTENCODING_UTF8).getStr());fflush(stdout);
- #if 0
-     fprintf( stderr, "CompileString '%s'\n",
-              rtl::OUStringToOString( rFormula, RTL_TEXTENCODING_UTF8 ).getStr() );
-@@ -2970,6 +3072,7 @@ ScTokenArray* ScCompiler::CompileString(
-         }
-         if( !pArr->Add( pRawToken->CreateToken() ) )
-         {
-+            fprintf(stdout, "ScCompiler::CompileString:   errCodeOverflow\n");fflush(stdout);
-             SetError(errCodeOverflow); break;
-         }
-         eLastOp = pRawToken->GetOpCode();
-@@ -2985,10 +3088,11 @@ ScTokenArray* ScCompiler::CompileString(
-             ScByteToken aToken( ocArrayClose );
-             if( !pArr->AddToken( aToken ) )
-             {
-+                fprintf(stdout, "ScCompiler::CompileString:   errCodeOverflow\n");fflush(stdout);
+@@ -2988,7 +3085,7 @@ ScTokenArray* ScCompiler::CompileString(
                  SetError(errCodeOverflow);
              }
              else if ( bAutoCorrect )
@@ -673,11 +699,7 @@
          }
  
          ScByteToken aToken( ocClose );
-@@ -2996,15 +3100,17 @@ ScTokenArray* ScCompiler::CompileString(
-         {
-             if( !pArr->AddToken( aToken ) )
-             {
-+                fprintf(stdout, "ScCompiler::CompileString:   errCodeOverflow\n");fflush(stdout);
+@@ -2999,7 +3096,7 @@ ScTokenArray* ScCompiler::CompileString(
                  SetError(errCodeOverflow); break;
              }
              if ( bAutoCorrect )
@@ -686,13 +708,7 @@
          }
      }
      if ( nForced >= 2 )
-         pArr->SetRecalcModeForced();
-     // remember pArr, in case a subsequent CompileTokenArray() is executed.
-+    fprintf(stdout, "ScCompiler::CompileString: --end\n");fflush(stdout);
-     return pArr = new ScTokenArray( aArr );
- }
- 
-@@ -5001,9 +5107,17 @@ ScRangeData* ScCompiler::UpdateMoveTab( 
+@@ -5001,9 +5098,17 @@ ScRangeData* ScCompiler::UpdateMoveTab( 
  }
  
  
@@ -712,7 +728,7 @@
  }
  
  ScToken* ScCompiler::CreateStringFromToken( String& rFormula, ScToken* pTokenP,
-@@ -5046,7 +5160,7 @@ ScToken* ScCompiler::CreateStringFromTok
+@@ -5046,7 +5151,7 @@ ScToken* ScCompiler::CreateStringFromTok
      else if( eOp >= ocInternalBegin && eOp <= ocInternalEnd )
          rBuffer.appendAscii( pInternal[ eOp - ocInternalBegin ] );
      else if( (USHORT) eOp < mxSymbolsNative->getSymbolCount())        // Keyword:
@@ -721,7 +737,7 @@
      else
      {
          DBG_ERROR("Unbekannter OpCode");
-@@ -5175,20 +5289,19 @@ void ScCompiler::CreateStringFromScMatri
+@@ -5175,20 +5280,19 @@ void ScCompiler::CreateStringFromScMatri
      SCSIZE nC, nMaxC, nR, nMaxR;
  
      pMatrix->GetDimensions( nMaxC, nMaxR);
@@ -745,7 +761,7 @@
              }
  
              if( pMatrix->IsValue( nC, nR ) )
-@@ -5213,7 +5326,7 @@ void ScCompiler::CreateStringFromScMatri
+@@ -5213,7 +5317,7 @@ void ScCompiler::CreateStringFromScMatri
                  AppendString( rBuffer, pMatrix->GetString( nC, nR ) );
          }
      }
@@ -754,22 +770,6 @@
  }
  
  void ScCompiler::AppendBoolean( rtl::OUStringBuffer& rBuffer, bool bVal )
-@@ -5272,6 +5385,7 @@ void ScCompiler::CreateStringFromTokenAr
- 
- void ScCompiler::CreateStringFromTokenArray( rtl::OUStringBuffer& rBuffer )
- {
-+    fprintf(stdout, "ScCompiler::CreateStringFromTokenArray: --begin\n");fflush(stdout);
-     rBuffer.setLength(0);
-     if( !pArr->GetLen() )
-         return;
-@@ -5284,6 +5398,7 @@ void ScCompiler::CreateStringFromTokenAr
-     ScToken* t = pArr->First();
-     while( t )
-         t = CreateStringFromToken( rBuffer, t, TRUE );
-+    fprintf(stdout, "ScCompiler::CreateStringFromTokenArray: --end\n");fflush(stdout);
- }
- 
- // Put quotes around string if non-alphanumeric characters are contained,
 diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sc.vpj sc.clean/source/core/tool/docoptio.cxx sc/source/core/tool/docoptio.cxx
 --- sc.clean/source/core/tool/docoptio.cxx	2008-03-03 11:24:50.000000000 -0500
 +++ sc/source/core/tool/docoptio.cxx	2008-03-03 11:33:34.000000000 -0500
@@ -844,6 +844,7 @@
  		}
  	}
  	aCalcItem.PutProperties(aNames, aValues);
+diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sc.vpj sc.clean/source/ui/app/scmod.cxx sc/source/ui/app/scmod.cxx
 --- sc.clean/source/ui/app/scmod.cxx	2008-03-03 11:24:45.000000000 -0500
 +++ sc/source/ui/app/scmod.cxx	2008-03-03 11:33:34.000000000 -0500
 @@ -1253,6 +1253,7 @@ void ScModule::ModifyOptions( const SfxI
@@ -856,7 +857,7 @@
  			pDocSh->SetDocumentModified();
 diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=sc.vpj sc.clean/source/ui/formdlg/formula.cxx sc/source/ui/formdlg/formula.cxx
 --- sc.clean/source/ui/formdlg/formula.cxx	2008-03-03 11:24:49.000000000 -0500
-+++ sc/source/ui/formdlg/formula.cxx	2008-03-03 11:33:34.000000000 -0500
++++ sc/source/ui/formdlg/formula.cxx	2008-03-04 00:32:04.000000000 -0500
 @@ -306,7 +306,7 @@ ScFormulaDlg::ScFormulaDlg( SfxBindings*
  
  			xub_StrLen nFStart = 0;



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