[ooo-build-commit] .: patches/dev300

Kohei Yoshida kohei at kemper.freedesktop.org
Tue Feb 2 13:40:15 PST 2010


 patches/dev300/calc-english-func-names-formula.diff |   49 +++++++++++++++-----
 1 file changed, 38 insertions(+), 11 deletions(-)

New commits:
commit fc857c92022d78aecc0f2f9eaabb096978217faa
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Tue Feb 2 16:39:09 2010 -0500

    A slight change in how opcode map is copied.
    
    * patches/dev300/calc-english-func-names-formula.diff:

diff --git a/patches/dev300/calc-english-func-names-formula.diff b/patches/dev300/calc-english-func-names-formula.diff
index 986a98e..a13ad5b 100644
--- a/patches/dev300/calc-english-func-names-formula.diff
+++ b/patches/dev300/calc-english-func-names-formula.diff
@@ -1,8 +1,18 @@
 diff --git formula/inc/formula/FormulaCompiler.hxx formula/inc/formula/FormulaCompiler.hxx
-index 8710847..f897238 100644
+index 8710847..75af9c3 100644
 --- formula/inc/formula/FormulaCompiler.hxx
 +++ formula/inc/formula/FormulaCompiler.hxx
-@@ -248,7 +248,8 @@ public:
+@@ -124,7 +124,8 @@ public:
+             mbEnglish = FormulaGrammar::isEnglish( meGrammar);
+         }
+         virtual ~OpCodeMap();
+-        
++    
++        void copyFrom( const OpCodeMap& r );    
+ 
+         /// Get the symbol String -> OpCode hash map for finds.
+         inline const OpCodeHashMap* getHashMap() const { return mpHashMap; }
+@@ -248,7 +249,8 @@ public:
      inline  FormulaGrammar::Grammar   GetGrammar() const { return meGrammar; }
  
      static void UpdateSeparatorsNative( const rtl::OUString& rSep, const rtl::OUString& rArrayColSep, const rtl::OUString& rArrayRowSep );
@@ -13,7 +23,7 @@ index 8710847..f897238 100644
      virtual String FindAddInFunction( const String& rUpperName, BOOL bLocalFirst ) const;
      virtual void fillFromAddInCollectionUpperName( NonConstOpCodeMapPtr xMap ) const;
 diff --git formula/source/core/api/FormulaCompiler.cxx formula/source/core/api/FormulaCompiler.cxx
-index 8df7933..a5f0e8a 100644
+index 8df7933..c292c91 100644
 --- formula/source/core/api/FormulaCompiler.cxx
 +++ formula/source/core/api/FormulaCompiler.cxx
 @@ -645,6 +645,7 @@ const String& FormulaCompiler::GetNativeSymbol( OpCode eOp )
@@ -38,7 +48,30 @@ index 8df7933..a5f0e8a 100644
  }
  // -----------------------------------------------------------------------------
  void FormulaCompiler::InitSymbolsEnglish() const
-@@ -1725,6 +1725,26 @@ void FormulaCompiler::UpdateSeparatorsNative(
+@@ -823,6 +823,22 @@ FormulaCompiler::OpCodeMap::~OpCodeMap()
+     delete mpHashMap;
+ }
+ // -----------------------------------------------------------------------------
++void FormulaCompiler::OpCodeMap::copyFrom( const OpCodeMap& r )
++{
++    delete mpHashMap;
++    mpHashMap = new OpCodeHashMap(mnSymbols);
++
++    USHORT n = r.getSymbolCount();
++    for (USHORT i = 0; i < n; ++i)
++    {
++        OpCode eOp = OpCode(i);
++        const String& rSymbol = r.getSymbol(eOp);
++        putOpCode(rSymbol, eOp);
++    }
++
++    // TODO: maybe copy the external maps too?
++}
++// -----------------------------------------------------------------------------
+ sal_Int32 FormulaCompiler::OpCodeMap::getOpCodeUnknown()
+ {
+     static const sal_Int32 kOpCodeUnknown = -1;
+@@ -1725,6 +1741,20 @@ void FormulaCompiler::UpdateSeparatorsNative(
      xSymbolsNative->putOpCode(rArrayRowSep, ocArrayRowSep);
  }
  
@@ -53,13 +86,7 @@ index 8df7933..a5f0e8a 100644
 +{
 +    NonConstOpCodeMapPtr xSymbolsNative;
 +    lcl_fillNativeSymbols(xSymbolsNative);
-+    USHORT n = xMap->getSymbolCount();
-+    for (USHORT i = 0; i < n; ++i)
-+    {
-+        OpCode eOp = OpCode(i);
-+        const String& rSymbol = xMap->getSymbol(eOp);
-+        xSymbolsNative->putOpCode(rSymbol, eOp);
-+    }
++    xSymbolsNative->copyFrom(*xMap);
 +}
 +
  // -----------------------------------------------------------------------------


More information about the ooo-build-commit mailing list