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>
This commit is contained in:
Winfried Donkers 2016-10-18 16:30:19 +02:00 committed by Eike Rathke
parent 532847746f
commit 1276e95193

View file

@ -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 );