summaryrefslogtreecommitdiff
path: root/formula
diff options
context:
space:
mode:
authorWinfried Donkers <winfrieddonkers@libreoffice.org>2016-10-13 13:49:18 +0200
committerEike Rathke <erack@redhat.com>2016-10-14 15:23:57 +0000
commitcf43ff5262a111f9fbebe58d254b704ec057cbf6 (patch)
tree27031e4e71f7e7f3bfc49a053808e3758715b1a9 /formula
parentd4ddc8cb005887e4b2810006425cccf12937347f (diff)
tdf#102948 Make HYPGEOMDIST ODFF1.2 compliant.
Also reduce duplicate code. On Export to OOXML, HYPGEOMDIST is converted to HYPGEOM.DIST. Change-Id: I70a70ee6b5c542e272ef574073ebcd1924f31083 Reviewed-on: https://gerrit.libreoffice.org/29767 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'formula')
-rw-r--r--formula/source/core/api/token.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx
index 7d5528c40c73..a9abdd0ef133 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -1111,10 +1111,12 @@ inline bool MissingConventionOOXML::isRewriteNeeded( OpCode eOp )
case ocPoissonDist:
case ocNormDist:
case ocLogNormDist:
+ case ocHypGeomDist:
case ocDBCount:
case ocDBCount2:
return true;
+
default:
return false;
}
@@ -1244,6 +1246,14 @@ void FormulaMissingContext::AddMoreArgs( FormulaTokenArray *pNewArr, const Missi
}
break;
+ case ocHypGeomDist:
+ if ( mnCurArg == 3 )
+ {
+ pNewArr->AddOpCode( ocSep );
+ pNewArr->AddDouble( 0.0 ); // 5th, Cumulative = false()
+ }
+ break;
+
case ocRound:
case ocRoundUp:
case ocRoundDown:
@@ -1515,6 +1525,12 @@ FormulaTokenArray * FormulaTokenArray::RewriteMissing( const MissingConvention &
( pCur->GetOpCode() == ocCeil ? ocCeil_Math : ocFloor_Math ) );
pNewArr->Add( pToken );
}
+ else if ( pCur->GetOpCode() == ocHypGeomDist &&
+ rConv.getConvention() == MissingConvention::FORMULA_MISSING_CONVENTION_OOXML )
+ {
+ FormulaToken *pToken = new FormulaToken( svByte, ocHypGeomDist_MS );
+ pNewArr->Add( pToken );
+ }
else
pNewArr->AddToken( *pCur );
}