summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2018-08-30 17:18:18 +0200
committerEike Rathke <erack@redhat.com>2018-08-31 13:57:00 +0200
commit0b84398784dfffca807965d678aeee5c2c302b66 (patch)
tree6ebc94419bfd9ed86616fddd6987aace14733c6b
parent5321ac6c3d925e6f8e380fa3c60e99237a6b5c82 (diff)
tdf#73078 Let 'Type()' return '1' for empty cells
Quote from tdf#73078: > The function TYPE is specified with the Syntax: > TYPE( Any value ) and the rule "If a Reference > is provided, the reference is first dereferenced, > and any formulas are evaluated." > [ODF1.2 part2 section 6.13.33 TYP] > > Because of argument type "Any" the function cannot result > in an error. Gnumeric, Apache OpenOffice, and Excel return > the number 1 in this case. Therefore, have LibreOffice return 1 as well, rather than having an "Err:502" ("Error: Invalid argument"). Change-Id: I1e679645e7b2e70e185574f805cd410b0508cbd8 Reviewed-on: https://gerrit.libreoffice.org/59826 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com> (cherry picked from commit 0383ccd4e7116c3d26edc1f86b7a74fe3cf649bd) Reviewed-on: https://gerrit.libreoffice.org/59852 Tested-by: Eike Rathke <erack@redhat.com>
-rw-r--r--sc/source/core/tool/interpr1.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index c78c0593e986..a2d0dfa0f865 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -2120,6 +2120,10 @@ void ScInterpreter::ScType()
nType = 1;
}
break;
+ case CELLTYPE_NONE:
+ // always 1, s. tdf#73078
+ nType = 1;
+ break;
case CELLTYPE_FORMULA :
nType = 8;
break;