diff options
author | Winfried Donkers <winfrieddonkers@libreoffice.org> | 2016-10-18 16:30:19 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-10-26 11:13:09 +0000 |
commit | 1276e95193a714391c78120aadb0d347432eb35f (patch) | |
tree | a6184da3a12d2beb4532c50c1791a0c1d2d71aec /formula/source | |
parent | 532847746f7151905ad3a78baf6e175030b6a8ff (diff) |
tdf#103088, improve interoperability with Excel for LOGNORMDIST().
Change-Id: I5f4ccbb54b212247a3ff8b13ff012c930d18a86c
Reviewed-on: https://gerrit.libreoffice.org/30020
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'formula/source')
-rw-r--r-- | formula/source/core/api/token.cxx | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx index 409c4179c704..f910d7163c35 100644 --- a/formula/source/core/api/token.cxx +++ b/formula/source/core/api/token.cxx @@ -1525,14 +1525,30 @@ FormulaTokenArray * FormulaTokenArray::RewriteMissing( const MissingConvention & } if (bAdd) { - if ( ( pCur->GetOpCode() == ocCeil || pCur->GetOpCode() == ocFloor ) && + OpCode eOp = pCur->GetOpCode(); + if ( ( eOp == ocCeil || eOp == ocFloor || + ( eOp == ocLogNormDist && pCur->GetByte() == 4 ) ) && rConv.getConvention() == MissingConvention::FORMULA_MISSING_CONVENTION_OOXML ) { - FormulaToken *pToken = new FormulaToken( svByte, - ( pCur->GetOpCode() == ocCeil ? ocCeil_Math : ocFloor_Math ) ); + switch ( eOp ) + { + case ocCeil : + eOp = ocCeil_Math; + break; + case ocFloor : + eOp = ocFloor_Math; + break; + case ocLogNormDist : + eOp = ocLogNormDist_MS; + break; + default : + eOp = ocNone; + break; + } + FormulaToken *pToken = new FormulaToken( svByte, eOp ); pNewArr->Add( pToken ); } - else if ( pCur->GetOpCode() == ocHypGeomDist && + else if ( eOp == ocHypGeomDist && rConv.getConvention() == MissingConvention::FORMULA_MISSING_CONVENTION_OOXML ) { FormulaToken *pToken = new FormulaToken( svByte, ocHypGeomDist_MS ); |