sc/qa/unit/data/functions/mathematical/fods/mod.fods | 8 ++++---- sc/source/core/tool/interpr2.cxx | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-)
New commits: commit 992242a15c3f6cc6aed55fa2a4177d80d33a7277 Author: Takeshi Abe <t...@fixedpoint.jp> AuthorDate: Thu Jul 26 16:42:31 2018 +0900 Commit: Eike Rathke <er...@redhat.com> CommitDate: Wed Aug 15 13:11:17 2018 +0200 sc: Report #DIV/0! when MOD()'s divisor is 0 as Excel does [1], while ODF 1.2 does not specify which kind of error should be assigned for that case. [1] https://support.office.com/en-us/article/mod-function-9b6cd169-b6ee-406a-a97b-edf2a9dc24f3 Change-Id: Id6ebf790ac407f2a8b8769fc0518f136a1271a3d Reviewed-on: https://gerrit.libreoffice.org/58351 Tested-by: Jenkins Reviewed-by: Eike Rathke <er...@redhat.com> diff --git a/sc/qa/unit/data/functions/mathematical/fods/mod.fods b/sc/qa/unit/data/functions/mathematical/fods/mod.fods index 7148b59df4b7..262f4fff02f9 100644 --- a/sc/qa/unit/data/functions/mathematical/fods/mod.fods +++ b/sc/qa/unit/data/functions/mathematical/fods/mod.fods @@ -3220,12 +3220,12 @@ </table:table-row> <table:table-row table:style-name="ro5"> <table:table-cell table:formula="of:=MOD(25.4;0)" office:value-type="string" office:string-value="" calcext:value-type="error"> - <text:p>Err:502</text:p> + <text:p>#DIV/0!</text:p> </table:table-cell> - <table:table-cell office:value-type="string" calcext:value-type="string"> - <text:p>Err502</text:p> + <table:table-cell table:formula="of:#DIV/0!" office:value-type="string" office:string-value="" calcext:value-type="error"> + <text:p>#DIV/0!</text:p> </table:table-cell> - <table:table-cell table:style-name="ce66" table:formula="of:=ISERROR([.A36])" office:value-type="boolean" office:boolean-value="true" calcext:value-type="boolean"> + <table:table-cell table:style-name="ce66" table:formula="of:=ERROR.TYPE([.A36])=2" 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="ce21" table:formula="of:=FORMULA([Sheet2.A36])" office:value-type="string" office:string-value="=MOD(25.4,0)" calcext:value-type="string"> diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx index f6560dcb95ab..c185ecfe9223 100644 --- a/sc/source/core/tool/interpr2.cxx +++ b/sc/source/core/tool/interpr2.cxx @@ -2368,7 +2368,7 @@ void ScInterpreter::ScMod() double fDenom = GetDouble(); // Denominator if ( fDenom == 0.0 ) { - PushIllegalArgument(); + PushError(FormulaError::DivisionByZero); return; } double fNum = GetDouble(); // Numerator _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits