diff options
author | Andras Timar <andras.timar@collabora.com> | 2014-11-24 16:04:20 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2014-12-13 16:00:56 +0100 |
commit | 18263befac0ad0376c938f167dfbdc15f1b3cf1b (patch) | |
tree | b6f211138394d2cfe77bdea5e0da3f2ce42d5d9f /sc/source/filter | |
parent | 2ec12d234dbc7401951553672ef06b3547a71025 (diff) |
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@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc/source/filter')
-rw-r--r-- | sc/source/filter/lotus/lotform.cxx | 40 |
1 files changed, 34 insertions, 6 deletions
diff --git a/sc/source/filter/lotus/lotform.cxx b/sc/source/filter/lotus/lotform.cxx index aeeff6e27aa5..c567db9e863d 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; } |