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



Author: kyoshida
Date: Wed Jan 28 15:57:47 2009
New Revision: 15212
URL: http://svn.gnome.org/viewvc/ooo-build?rev=15212&view=rev

Log:
2009-01-28  Kohei Yoshida  <kyoshida novell com>

	* patches/dev300/calc-grammar-xls-english-sc-m39.diff:
	* patches/dev300/calc-grammar-xls-english-sc.diff:
	* patches/dev300/apply: adjusted for dev300-m40.



Added:
   trunk/patches/dev300/calc-grammar-xls-english-sc-m39.diff   (props changed)
      - copied unchanged from r15209, /trunk/patches/dev300/calc-grammar-xls-english-sc.diff
Modified:
   trunk/ChangeLog
   trunk/patches/dev300/apply
   trunk/patches/dev300/calc-grammar-xls-english-sc.diff

Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply	(original)
+++ trunk/patches/dev300/apply	Wed Jan 28 15:57:47 2009
@@ -2268,8 +2268,14 @@
 [ CalcFixes ]
 # Support Excel English grammar needed for VBA and (probably) for xlsx filter.
 calc-grammar-xls-english-offapi.diff, kohei
+
+[ CalcFixes <= dev300-m39 ]
+calc-grammar-xls-english-sc-m39.diff, kohei
+
+[ CalcFixes > dev300-m39 ]
 calc-grammar-xls-english-sc.diff, kohei
 
+[ CalcFixes ]
 # fix assertions to prevent them from being incorrectly triggered.
 chart-odf-export-assert-removal.diff, i#97563, kohei
 

Modified: trunk/patches/dev300/calc-grammar-xls-english-sc.diff
==============================================================================
--- trunk/patches/dev300/calc-grammar-xls-english-sc.diff	(original)
+++ trunk/patches/dev300/calc-grammar-xls-english-sc.diff	Wed Jan 28 15:57:47 2009
@@ -1,30 +1,30 @@
-diff --git sc/inc/compiler.hxx sc/inc/compiler.hxx
-index 7f95858..bfbe244 100644
---- sc/inc/compiler.hxx
-+++ sc/inc/compiler.hxx
-@@ -398,6 +398,7 @@ private:
-     static NonConstOpCodeMapPtr  mxSymbolsPODF;                          // ODF 1.1 symbols
-     static NonConstOpCodeMapPtr  mxSymbolsNative;                        // native symbols
-     static NonConstOpCodeMapPtr  mxSymbolsEnglish;                       // English symbols
-+    static NonConstOpCodeMapPtr  mxSymbolsEnglishXL;                     // English Excel symbols (for VBA formula parsing)
-     static CharClass            *pCharClassEnglish;                      // character classification for en_US locale
-     static const Convention     *pConventions[ ScAddress::CONV_LAST ];
+diff --git formula/inc/formula/FormulaCompiler.hxx formula/inc/formula/FormulaCompiler.hxx
+index 6df4898..8327237 100644
+--- formula/inc/formula/FormulaCompiler.hxx
++++ formula/inc/formula/FormulaCompiler.hxx
+@@ -315,6 +315,7 @@ private:
+     void InitSymbolsEnglish() const;   /// only SymbolsEnglish, maybe later
+     void InitSymbolsPODF() const;      /// only SymbolsPODF, on demand
+     void InitSymbolsODFF() const;      /// only SymbolsODFF, on demand
++    void InitSymbolsEnglishXL() const; /// only SymbolsEnglishXL, on demand
  
-@@ -519,6 +520,7 @@ public:
- private:
-     static void InitSymbolsPODF();      /// only SymbolsPODF, on demand
-     static void InitSymbolsODFF();      /// only SymbolsODFF, on demand
-+    static void InitSymbolsEnglishXL(); /// only SymbolsEnglishXL, on demand
-     static void fillFromAddInMap( NonConstOpCodeMapPtr xMap, size_t nSymbolOffset );
-     static void fillFromAddInCollectionUpperName( NonConstOpCodeMapPtr xMap );
-     static void fillFromAddInCollectionEnglishName( NonConstOpCodeMapPtr xMap );
-diff --git sc/inc/grammar.hxx sc/inc/grammar.hxx
-index 91df652..d6dddfa 100644
---- sc/inc/grammar.hxx
-+++ sc/inc/grammar.hxx
-@@ -112,6 +112,16 @@ public:
+     void loadSymbols(USHORT _nSymbols,FormulaGrammar::Grammar _eGrammar,NonConstOpCodeMapPtr& _xMap) const;
+ 
+@@ -368,6 +369,7 @@ private:
+     mutable NonConstOpCodeMapPtr  mxSymbolsPODF;                          // ODF 1.1 symbols
+     mutable NonConstOpCodeMapPtr  mxSymbolsNative;                        // native symbols
+     mutable NonConstOpCodeMapPtr  mxSymbolsEnglish;                       // English symbols
++    mutable NonConstOpCodeMapPtr  mxSymbolsEnglishXL;                     // English Excel symbols (for VBA formula parsing)
+ };
+ // =============================================================================
+ } // formula
+diff --git formula/inc/formula/grammar.hxx formula/inc/formula/grammar.hxx
+index 74520da..3da926f 100644
+--- formula/inc/formula/grammar.hxx
++++ formula/inc/formula/grammar.hxx
+@@ -130,6 +130,16 @@ public:
          GRAM_NATIVE_XL_R1C1 = ::com::sun::star::sheet::FormulaLanguage::NATIVE  |
-                                 ((ScAddress::CONV_XL_R1C1       +
+                                 ((CONV_XL_R1C1       +
                                    kConventionOffset) << kConventionShift),
 +        /// English with Excel A1 reference style.
 +        GRAM_ENGLISH_XL_A1   = ::com::sun::star::sheet::FormulaLanguage::XL_ENGLISH  |
@@ -39,7 +39,7 @@
          /// Central definition of the default grammar to be used.
          GRAM_DEFAULT        = GRAM_NATIVE_UI,
  
-@@ -162,6 +172,8 @@ public:
+@@ -180,6 +190,8 @@ public:
              case GRAM_NATIVE_ODF     :
              case GRAM_NATIVE_XL_A1   :
              case GRAM_NATIVE_XL_R1C1 :
@@ -48,46 +48,11 @@
                  return true;
              default:
                  return extractFormulaLanguage( eGrammar) == GRAM_EXTERNAL;
-diff --git sc/source/core/tool/compiler.cxx sc/source/core/tool/compiler.cxx
-index 8ccb188..ccc9f2f 100644
---- sc/source/core/tool/compiler.cxx
-+++ sc/source/core/tool/compiler.cxx
-@@ -109,6 +109,7 @@ ScCompiler::NonConstOpCodeMapPtr    ScCompiler::mxSymbolsODFF;
- ScCompiler::NonConstOpCodeMapPtr    ScCompiler::mxSymbolsPODF;
- ScCompiler::NonConstOpCodeMapPtr    ScCompiler::mxSymbolsNative;
- ScCompiler::NonConstOpCodeMapPtr    ScCompiler::mxSymbolsEnglish;
-+ScCompiler::NonConstOpCodeMapPtr    ScCompiler::mxSymbolsEnglishXL;
- CharClass*                          ScCompiler::pCharClassEnglish = NULL;
- const ScCompiler::Convention*       ScCompiler::pConventions[ ]   = { NULL, NULL, NULL, NULL, NULL, NULL };
- 
-@@ -474,6 +475,26 @@ void ScCompiler::InitSymbolsODFF()
-     fillFromAddInCollectionUpperName( mxSymbolsODFF);
- }
- 
-+void ScCompiler::InitSymbolsEnglishXL()
-+{
-+    if (mxSymbolsEnglishXL.get())
-+        return;
-+
-+    // Not core
-+    mxSymbolsEnglishXL.reset( new OpCodeMap( SC_OPCODE_LAST_OPCODE_ID + 1,
-+                false, ScGrammar::GRAM_ENGLISH));
-+    ScOpCodeList aOpCodeList( RID_SC_FUNCTION_NAMES_ENGLISH, mxSymbolsEnglishXL );
-+
-+    fillFromAddInMap( mxSymbolsEnglishXL, offsetof( AddInMap, pEnglish));
-+    // Fill from collection for AddIns not already present.
-+    fillFromAddInCollectionEnglishName( mxSymbolsEnglishXL);
-+
-+    // For now, just replace the separators to the Excel English variants.
-+    mxSymbolsEnglishXL->putOpCode(sal_Unicode(','), ocSep);
-+    mxSymbolsEnglishXL->putOpCode(sal_Unicode(','), ocArrayColSep);
-+    mxSymbolsEnglishXL->putOpCode(sal_Unicode(';'), ocArrayRowSep);
-+}
-+
- #ifdef erGENERATEMAPPING
- // Run in en-US UI by calling from within gdb, edit pODFF entries afterwards.
- void dbg_call_generateMappingODFF()
-@@ -686,6 +707,11 @@ ScCompiler::OpCodeMapPtr ScCompiler::GetOpCodeMap( const sal_Int32 nLanguage )
+diff --git formula/source/core/api/FormulaCompiler.cxx formula/source/core/api/FormulaCompiler.cxx
+index 5834e9e..af541e5 100644
+--- formula/source/core/api/FormulaCompiler.cxx
++++ formula/source/core/api/FormulaCompiler.cxx
+@@ -571,6 +571,11 @@ FormulaCompiler::OpCodeMapPtr FormulaCompiler::GetOpCodeMap( const sal_Int32 nLa
                  InitSymbolsNative();
              xMap = mxSymbolsNative;
              break;
@@ -99,3 +64,26 @@
          default:
              ;   // nothing, NULL map returned
      }
+@@ -684,6 +689,22 @@ void FormulaCompiler::InitSymbolsODFF() const
+ 	mxSymbolsODFF = s_sSymbol;
+ }
+ // -----------------------------------------------------------------------------
++void FormulaCompiler::InitSymbolsEnglishXL() const
++{
++	static NonConstOpCodeMapPtr s_sSymbol;
++	if ( !s_sSymbol.get() )
++    	loadSymbols(RID_STRLIST_FUNCTION_NAMES_ENGLISH,FormulaGrammar::GRAM_ENGLISH,s_sSymbol);
++	mxSymbolsEnglishXL = s_sSymbol;
++
++    // TODO: For now, just replace the separators to the Excel English
++    // variants. Later, if we want to properly map Excel functions with Calc
++    // functions, we'll need to do a little more work here.
++    mxSymbolsEnglishXL->putOpCode(sal_Unicode(','), ocSep);
++    mxSymbolsEnglishXL->putOpCode(sal_Unicode(','), ocArrayColSep);
++    mxSymbolsEnglishXL->putOpCode(sal_Unicode(';'), ocArrayRowSep);
++}
++
++// -----------------------------------------------------------------------------
+ void FormulaCompiler::loadSymbols(USHORT _nSymbols,FormulaGrammar::Grammar _eGrammar,NonConstOpCodeMapPtr& _xMap) const
+ {
+     if ( !_xMap.get() )



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