[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sc/source

Andras Timar andras.timar at collabora.com
Thu Dec 4 06:25:09 PST 2014


 sc/source/filter/lotus/lotform.cxx |   40 +++++++++++++++++++++++++++++++------
 1 file changed, 34 insertions(+), 6 deletions(-)

New commits:
commit 48801843d65ffa3e31196cabb36c597ff81c6d07
Author: Andras Timar <andras.timar at collabora.com>
Date:   Mon Nov 24 16:04:20 2014 +0100

    import @TERM and @CTERM functions from Lotus 1-2-3 files (related: fdo#86241)
    
    (cherry picked from commit 70ae5bb4182a99c17da8eb32b36baec3e7a48723)
    
    Conflicts:
    	sc/source/filter/lotus/lotform.cxx
    
    Change-Id: I864ad87aa0455c323a5235fa1230d3f2ac3ffbb4
    Reviewed-on: https://gerrit.libreoffice.org/13105
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/sc/source/filter/lotus/lotform.cxx b/sc/source/filter/lotus/lotform.cxx
index aeeff6e..c567db9 100644
--- a/sc/source/filter/lotus/lotform.cxx
+++ b/sc/source/filter/lotus/lotform.cxx
@@ -138,6 +138,30 @@ void LotusToSc::DoFunc( DefTokenId eOc, sal_uInt8 nAnz, const sal_Char* pExtStri
             eParam[ 2 ] = n0Token;      //    -> 2. as Default
         }
             break;
+        case ocZZR:
+        {
+            OSL_ENSURE( nAnz == 3,
+                "*LotusToSc::DoFunc(): TERM() or CTERM() need 3 parameters!" );
+            nAnz = 4;
+            if ( OString(pExtString) == "TERM" )
+            {
+                // @TERM(pmt,int,fv) -> NPER(int,-pmt,pv=0,fv)
+                NegToken( eParam[ 2 ] );
+                eParam[ 3 ] = eParam[ 1 ];
+                eParam[ 1 ] = aPool.Store( 0.0 );
+            }
+            else //CTERM()
+            {
+                // @CTERM(int,fv,pv) -> NPER(int,pmt=0,-pv,fv)
+                NegToken( eParam[ 0 ] );
+                nMerk0 = eParam[ 1 ];
+                eParam[ 1 ] = eParam[ 0 ];
+                eParam[ 0 ] = nMerk0;
+                eParam[ 3 ] = eParam[ 2 ];
+                eParam[ 2 ] = aPool.Store( 0.0 );
+            }
+        }
+            break;
         default:;
     }
 
@@ -747,8 +771,8 @@ FUNC_TYPE LotusToSc::IndexToType( sal_uInt8 nIndex )
         FT_NotImpl,         //  114 Call()
         FT_FuncFix1,        //  115 @@()
         FT_FuncFix3,        //  116 Rate()
-        FT_FuncFix1,        //  117 Term()
-        FT_FuncFix1,        //  118 Cterm()
+        FT_FuncFix3,        //  117 Term()
+        FT_FuncFix3,        //  118 Cterm()
         FT_FuncFix3,        //  119 Sln()
         FT_FuncFix4,        //  120 Syd(), Soy()
         FT_FuncFix4,        //  121 Ddb()
@@ -1278,8 +1302,8 @@ FUNC_TYPE LotusToSc::IndexToTypeWK123( sal_uInt8 nIndex )
         FT_NotImpl,         //  114 App                  <- change in Bez.
         FT_FuncFix1,        //  115 @@()                 <- new
         FT_FuncFix3,        //  116 Rate()               <- new
-        FT_FuncFix3,        //  117 Term()               <- change in Anz.
-        FT_FuncFix3,        //  118 Cterm()              <- change in Anz.
+        FT_FuncFix3,        //  117 Term()
+        FT_FuncFix3,        //  118 Cterm()
         FT_FuncFix3,        //  119 Sln()                <- new
         FT_FuncFix4,        //  120 Syd()                <- new
         FT_FuncFix4,        //  121 Ddb()                <- new
@@ -1809,8 +1833,8 @@ const sal_Char* GetAddInName( const sal_uInt8 n )
         NULL,                       //  114 Call()
         NULL,                       //  115 @@()
         NULL,                       //  116 Rate()
-        "ANN",                      //  117 Term()
-        NULL,                       //  118 Cterm()
+        "TERM",                     //  117 Term()
+        "CTERM",                    //  118 Cterm()
         NULL,                       //  119 Sln()
         NULL,                       //  120 Syd(), Soy()
         NULL,                       //  121 Ddb()
@@ -2024,6 +2048,10 @@ static DefTokenId lcl_KnownAddIn( const OString& rTest )
             eId=ocNormDist;
     else if (rTest == "CRITBINOMIAL")
             eId=ocKritBinom;
+    else if (rTest == "TERM")
+            eId=ocZZR;
+    else if (rTest == "CTERM")
+            eId=ocZZR;
     return eId;
 }
 


More information about the Libreoffice-commits mailing list