ooo-build r13429 - in trunk: . patches/dev300



Author: kyoshida
Date: Tue Jul 29 16:45:58 2008
New Revision: 13429
URL: http://svn.gnome.org/viewvc/ooo-build?rev=13429&view=rev

Log:
2008-07-29  Kohei Yoshida  <kyoshida novell com>

	* patches/dev300/calc-formula-variable-separators-sc.diff: added 
	special case for de_CH locale, and a little code cleanup.


Modified:
   trunk/ChangeLog
   trunk/patches/dev300/calc-formula-variable-separators-sc.diff

Modified: trunk/patches/dev300/calc-formula-variable-separators-sc.diff
==============================================================================
--- trunk/patches/dev300/calc-formula-variable-separators-sc.diff	(original)
+++ trunk/patches/dev300/calc-formula-variable-separators-sc.diff	Tue Jul 29 16:45:58 2008
@@ -24,7 +24,7 @@
      BOOL IsString();
      BOOL IsReference( const String& );
 diff --git sc/source/core/tool/compiler.cxx sc/source/core/tool/compiler.cxx
-index d1ceb26..00c93e0 100644
+index a47a64f..084f533 100644
 --- sc/source/core/tool/compiler.cxx
 +++ sc/source/core/tool/compiler.cxx
 @@ -42,6 +42,7 @@
@@ -59,7 +59,7 @@
  {
      init(xMap->getGrammar());
  
-@@ -244,21 +245,59 @@ ScOpCodeList::ScOpCodeList( USHORT nRID, ScCompiler::NonConstOpCodeMapPtr xMap )
+@@ -244,21 +245,69 @@ ScOpCodeList::ScOpCodeList( USHORT nRID, ScCompiler::NonConstOpCodeMapPtr xMap )
      FreeResource();
  }
  
@@ -86,6 +86,7 @@
 +        return;
 +
 +    const LocaleDataWrapper& rLocaleData = *ScGlobal::pLocaleData;
++    const lang::Locale& rLocale = *ScGlobal::pLocale;
 +    const i18n::LocaleDataItem& aItem = rLocaleData.getLocaleItem();
 +    const String& rDecSep  = rLocaleData.getNumDecimalSep();
 +    const String& rListSep = rLocaleData.getListSep();
@@ -96,12 +97,17 @@
 +    sal_Unicode cDecSep  = rDecSep.GetChar(0);
 +    sal_Unicode cListSep = rListSep.GetChar(0);
 +
-+    // TODO: for some reason the list separator for 'en' on Linux is ';'. It's
-+    // supposed to be ','.  Work around it for now, and find out later why
-+    // it's set to ';'.
++    // TODO: Excel by default uses system's list separator as the parameter 
++    // separator, which in English locales is a comma.  However, OOo's list
++    // separator value is set to ';' for all English locales.  Because of this
++    // discrepancy, we will hardcode the separator value here, for now.
 +    if (cDecSep == sal_Unicode('.'))
 +        cListSep = sal_Unicode(',');
 +
++    // Special case for de_CH locale.
++    if (rLocale.Language.equalsAsciiL("de", 2) && rLocale.Country.equalsAsciiL("CH", 2))
++        cListSep = sal_Unicode(';');
++
 +    // by default, the parameter separator equals the locale-specific
 +    // list separator.
 +    mcParamSep = cListSep;
@@ -123,6 +129,10 @@
 +    // I don't think we have to go that far to emulate that odd behavior,
 +    // so for now we just stop here.
 +#if 0
++    fprintf(stdout, "ScOpCodeList::init:   language = '%s'; country = '%s'\n", 
++            rtl::OUStringToOString(rLocale.Language, RTL_TEXTENCODING_UTF8).getStr(),
++            rtl::OUStringToOString(rLocale.Country, RTL_TEXTENCODING_UTF8).getStr());
++    
 +    fprintf(stdout, "ScOpCodeList::init:   arg sep = '%s'; array col sep = '%s'; array row sep = '%s'\n",
 +            rtl::OUStringToOString(String(mcParamSep), RTL_TEXTENCODING_UTF8).getStr(),
 +            rtl::OUStringToOString(String(mcArrayColSep), RTL_TEXTENCODING_UTF8).getStr(),
@@ -130,7 +140,7 @@
  #endif
  }
  
-@@ -266,50 +305,16 @@ bool ScOpCodeList::getOpCodeString( String& rStr, USHORT nOp )
+@@ -266,50 +315,16 @@ bool ScOpCodeList::getOpCodeString( String& rStr, USHORT nOp )
  {
      switch (nOp)
      {
@@ -190,7 +200,7 @@
      return false;
  }
  
-@@ -1864,7 +1869,7 @@ sal_Unicode* lcl_UnicodeStrNCpy( sal_Unicode* pDst, const sal_Unicode* pSrc, xub
+@@ -1881,7 +1896,7 @@ sal_Unicode* lcl_UnicodeStrNCpy( sal_Unicode* pDst, const sal_Unicode* pSrc, xub
  //               | Sonst             | Symbol=Symbol+Zeichen | GetString
  //---------------+-------------------+-----------------------+---------------
  
@@ -199,7 +209,7 @@
  {
      cSymbol[MAXSTRLEN-1] = 0;       // Stopper
      sal_Unicode* pSym = cSymbol;
-@@ -1877,6 +1882,8 @@ xub_StrLen ScCompiler::NextSymbol()
+@@ -1894,6 +1909,8 @@ xub_StrLen ScCompiler::NextSymbol()
      ScanState eState = ssGetChar;
      xub_StrLen nSpaces = 0;
      sal_Unicode cSep = mxSymbols->getSymbol( ocSep).GetChar(0);
@@ -208,7 +218,7 @@
      sal_Unicode cDecSep = (mxSymbols->isEnglish() ? '.' :
              ScGlobal::pLocaleData->getNumDecimalSep().GetChar(0));
  
-@@ -1893,9 +1900,9 @@ xub_StrLen ScCompiler::NextSymbol()
+@@ -1910,9 +1927,9 @@ xub_StrLen ScCompiler::NextSymbol()
      {
          pSrc++;
          ULONG nMask = GetCharTableFlags( c );
@@ -221,7 +231,7 @@
          {
              switch (eState)
              {
-@@ -2270,14 +2277,22 @@ xub_StrLen ScCompiler::NextSymbol()
+@@ -2287,14 +2304,22 @@ xub_StrLen ScCompiler::NextSymbol()
  // Convert symbol to token
  //---------------------------------------------------------------------------
  
@@ -246,7 +256,7 @@
          pRawToken = aToken.Clone();
      }
      else
-@@ -3146,9 +3161,10 @@ void ScCompiler::AutoCorrectParsedSymbol()
+@@ -3163,9 +3188,10 @@ void ScCompiler::AutoCorrectParsedSymbol()
      }
  }
  
@@ -259,7 +269,7 @@
  
  #if 0
      fprintf( stderr, "NextNewToken '%s' (spaces = %d)\n",
-@@ -3229,7 +3245,7 @@ BOOL ScCompiler::NextNewToken( bool bAllowBooleans )
+@@ -3246,7 +3272,7 @@ BOOL ScCompiler::NextNewToken( bool bAllowBooleans )
              // IsReference().
              // IsBoolean before isValue to catch inline bools without the kludge
              //    for inline arrays.



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