[Libreoffice-commits] core.git: sc/qa sc/source
Winfried Donkers
winfrieddonkers at libreoffice.org
Tue Mar 7 17:12:40 UTC 2017
sc/qa/unit/data/functions/financial/fods/sln.fods | 6 +++---
sc/source/core/tool/interpr2.cxx | 11 +++--------
2 files changed, 6 insertions(+), 11 deletions(-)
New commits:
commit 94509163e8690351f47bb32eaff6ace14b1b808a
Author: Winfried Donkers <winfrieddonkers at libreoffice.org>
Date: Tue Mar 7 17:24:41 2017 +0100
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 at redhat.com>
Tested-by: Jenkins <ci at libreoffice.org>
diff --git a/sc/qa/unit/data/functions/financial/fods/sln.fods b/sc/qa/unit/data/functions/financial/fods/sln.fods
index 05a85c3..2e97a9e 100644
--- a/sc/qa/unit/data/functions/financial/fods/sln.fods
+++ b/sc/qa/unit/data/functions/financial/fods/sln.fods
@@ -2529,10 +2529,10 @@
<table:table-cell table:formula="of:=SLN(100;10;0)" office:value-type="string" office:string-value="" calcext:value-type="error">
<text:p>Err:502</text:p>
</table:table-cell>
- <table:table-cell table:formula="of:#ERR502!" office:value-type="string" office:string-value="" calcext:value-type="error">
+ <table:table-cell table:formula="of:#DIV/0!" office:value-type="string" office:string-value="" calcext:value-type="error">
<text:p>Err:502</text:p>
</table:table-cell>
- <table:table-cell table:style-name="ce71" table:formula="of:=ORG.OPENOFFICE.ERRORTYPE([.A12])=502" office:value-type="boolean" office:boolean-value="true" calcext:value-type="boolean">
+ <table:table-cell table:style-name="ce71" table:formula="of:=ISERROR([.A12])" office:value-type="boolean" office:boolean-value="true" calcext:value-type="boolean">
<text:p>TRUE</text:p>
</table:table-cell>
<table:table-cell table:style-name="ce26" table:formula="of:=FORMULA([.A12])" office:value-type="string" office:string-value="=SLN(100,10,0)" calcext:value-type="string">
@@ -2879,4 +2879,4 @@
</table:named-expressions>
</office:spreadsheet>
</office:body>
-</office:document>
\ No newline at end of file
+</office:document>
diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index a25da29..9f68948 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 ) );
}
}
More information about the Libreoffice-commits
mailing list