Bug 73078 - Function TYPE() returns error, when parameter is a reference to an empty cell
Summary: Function TYPE() returns error, when parameter is a reference to an empty cell
Status: CLOSED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.1.3.2 release
Hardware: Other Windows (All)
: medium normal
Assignee: Michael Weghorn (away)
URL:
Whiteboard: target:6.2.0 target:6.1.2
Keywords:
Depends on:
Blocks: Calc-Function
  Show dependency treegraph
 
Reported: 2013-12-27 17:43 UTC by Regina Henschel
Modified: 2018-09-14 20:00 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2013-12-27 17:43:26 UTC
Make sure cell B2 is empty, that means it has no content at all.
Write formula =TYPE(B2) into cell A1.
Expected behavior: You get a number.
Seen behavior: Err:502. That is "Error: Invalid argument".

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 TYPE]

Because of argument type "Any" the function cannot result in an error. Gnumeric, Apache OpenOffice, and Excel return the number 1 in this case.

Suggestion: LibreOffice should return 1 in this case too.
Comment 1 A (Andy) 2013-12-27 20:00:35 UTC
reproducible with LO 4.1.4.2 (Win7 Home, 64bit)

As per Excel the function TYPE should evaluate the empty cell as the value 0 and therefore return 1, to denote a numeric value
Comment 2 QA Administrators 2015-04-19 03:20:52 UTC Comment hidden (obsolete)
Comment 3 Regina Henschel 2015-04-19 21:41:44 UTC
The bug still exists in Version: 4.5.0.0.alpha0+
Build ID: 40b1e8266e47792d354cd457c652bfb0f0a21e69
TinderBox: Win-x86@62-TDF, Branch:MASTER, Time: 2015-02-11_00:13:43
Locale: de_DE
Comment 4 QA Administrators 2018-07-12 02:44:07 UTC Comment hidden (obsolete)
Comment 5 Regina Henschel 2018-07-12 09:58:00 UTC
The bug still exists in Version: 6.2.0.0.alpha0+ (x64)
Build ID: 2c85607101e2e04e870e3b87362f39f9a9148e6c
CPU threads: 8; OS: Windows 10.0; UI render: default; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-06-16_00:12:37
Locale: de-DE (en_US); Calc: CL
Comment 6 Commit Notification 2018-08-31 08:14:26 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=0383ccd4e7116c3d26edc1f86b7a74fe3cf649bd

tdf#73078 Let 'Type()' return '1' for empty cells

It will be available in 6.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Commit Notification 2018-08-31 10:31:09 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=370d4c9ba34913076f7a73a2912eb2e0e48ca73c

tdf#73078 Add/Enable test for TYPE function on empty cell

It will be available in 6.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2018-08-31 11:58:07 UTC
Michael Weghorn committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=0b84398784dfffca807965d678aeee5c2c302b66&h=libreoffice-6-1

tdf#73078 Let 'Type()' return '1' for empty cells

It will be available in 6.1.2.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Regina Henschel 2018-09-14 20:00:16 UTC
Verified in Version: 6.1.2.0.0+ (x64)
Build ID: 2f52a8e0f1098a51631434129707cfb0b60fecb3
CPU threads: 8; OS: Windows 10.0; UI render: GL; 
TinderBox: Win-x86_64@42, Branch:libreoffice-6-1, Time: 2018-09-14_00:42:50
Locale: en-US (en_US); Calc: CL

and in Version: 6.2.0.0.alpha0+ (x64)
Build-ID: 3778399872ad592b4416e54a154e8bcc02d73a2e
CPU-Threads: 8; BS: Windows 10.0; UI-Render: GL; 
Gebietsschema: de-DE (en_US); Calc: threaded