diff options
author | Winfried Donkers <winfrieddonkers@libreoffice.org> | 2017-02-27 15:05:32 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-03-06 15:50:38 +0000 |
commit | 9a7b5d86aceb97fc9f3d36bee817d3d0fc976254 (patch) | |
tree | da3b4c8915d700393de6f4a89d1352ea0dfa670f /sc | |
parent | 57b9875fc09bdcbf3a5ee121accbcedfaf67dea7 (diff) |
tdf#106210 Apply correct constraint for calc function EFFECTIVE.
(= ODFF formula EFFECT)
Change-Id: Ib9adeece3d2f1331b80ce8eae74831420e6c2e6b
Reviewed-on: https://gerrit.libreoffice.org/34682
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/tool/interpr2.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx index 55cc78865b48..b9dd7381c1ee 100644 --- a/sc/source/core/tool/interpr2.cxx +++ b/sc/source/core/tool/interpr2.cxx @@ -2331,8 +2331,10 @@ void ScInterpreter::ScEffect() { double fPeriods = GetDouble(); double fNominal = GetDouble(); - if (fPeriods < 1.0 || fNominal <= 0.0) + if (fPeriods < 1.0 || fNominal < 0.0) PushIllegalArgument(); + else if ( fNominal == 0.0 ) + PushDouble( 0.0 ); else { fPeriods = ::rtl::math::approxFloor(fPeriods); |