Bug 100409 - Functions in Calc - matrix is passed as argument -> any text returns 0 instead
Summary: Functions in Calc - matrix is passed as argument -> any text returns 0 instead
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Eike Rathke
QA Contact:
URL:
Whiteboard: target:5.3.0 target:5.2.0.1
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-15 16:18 UTC by raal
Modified: 2016-09-19 16:35 UTC (History)
0 users

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 raal 2016-06-15 16:18:18 UTC
If a matrix is passed as argument to a function that expects a scalar
parameter and it is not in array/matrix mode, then the top left element
of the matrix is passed. However, if a numeric value is expected then
a text string should be converted according to the conversion settings,
which here are ignored and any text returns 0 instead. This affects not
only WEEKS. Seems I need to figure out a general handling.


=WEEKS(DATE(2014;11;1);DATE(2014;11;30);{"Hello";"Eike";"!"})  works. Should trigger error.


    So actually whether the result should be error or not should depend on
    the settings, furthermore other values than 0 or 1 should return error
    where currently all values not 1 are treated as 0.

Affect WEEKS, WEEKSINYEAR and other functions.
Comment 1 Commit Notification 2016-06-15 19:07:13 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=481b8589d135baced12469bec4ee734b23faac21

introduce ScMatrix::GetDoubleWithStringConversion() preparing for tdf#100409

It will be available in 5.3.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 2 Commit Notification 2016-06-15 19:07:17 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

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

Resolves: tdf#100409 GetDoubleWithStringConversion() in GetDoubleFromMatrix()

It will be available in 5.3.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 3 Commit Notification 2016-06-15 19:29:01 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-5-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=56c916992276baf374664d0bfca4181919b849f5&h=libreoffice-5-2

introduce ScMatrix::GetDoubleWithStringConversion() preparing for tdf#100409

It will be available in 5.2.0.1.

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 4 Commit Notification 2016-06-15 19:30:21 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-5-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5795989729274cdf8a8e6e1a55fb7cf12ab7fe7d&h=libreoffice-5-2

Resolves: tdf#100409 GetDoubleWithStringConversion() in GetDoubleFromMatrix()

It will be available in 5.2.0.1.

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 5 Commit Notification 2016-09-19 16:11:52 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=388014fc19b2a785f887cdfee91100fc9ab8d58d

Resolves: tdf#100409 do not return coded double error for single matrix value

It will be available in 5.3.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 6 Eike Rathke 2016-09-19 16:35:37 UTC
Last commit notification ^^^ should had gone to bug 102215 ...