diff options
author | Winfried Donkers <winfrieddonkers@libreoffice.org> | 2017-03-07 17:24:41 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-03-07 17:12:00 +0000 |
commit | 94509163e8690351f47bb32eaff6ace14b1b808a (patch) | |
tree | 675fe46ff38ef5ce85d6c39c4e50744b65528e74 /sc/source | |
parent | 04c7d5013b9b87709b913e26190fb347a4916566 (diff) |
Follow up of commit 055c8cc676921176e2b9df76bd0e09bacab1d80b
Change type of error from #NUM! to #DIV/0! in case of TimeLength being 0.
Change-Id: I09abde85badb08afc1c688452b33ee0b5c39859b
Reviewed-on: https://gerrit.libreoffice.org/34954
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/core/tool/interpr2.cxx | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx index a25da2993368..9f6894868e8f 100644 --- a/sc/source/core/tool/interpr2.cxx +++ b/sc/source/core/tool/interpr2.cxx @@ -1896,14 +1896,9 @@ void ScInterpreter::ScSLN() if ( MustHaveParamCount( GetByte(), 3 ) ) { double fTimeLength = GetDouble(); - if ( fTimeLength == 0.0 ) - PushIllegalArgument(); - else - { - double fRest = GetDouble(); - double fValue = GetDouble(); - PushDouble((fValue - fRest) / fTimeLength); - } + double fRest = GetDouble(); + double fValue = GetDouble(); + PushDouble( div( fValue - fRest, fTimeLength ) ); } } |