Bug 117879 - Formula truncated falsely if the first/middle argument of the function(with two or more significant args) contains a non-constants parameter within array of constants
Summary: Formula truncated falsely if the first/middle argument of the function(with t...
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
URL:
Whiteboard: target:6.2.0 target:6.1.0.1 target:6.0.6
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-29 13:26 UTC by Andrey
Modified: 2018-06-05 15:20 UTC (History)
4 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 Andrey 2018-05-29 13:26:39 UTC
Description:
Issue is reproduced for all function with 2 or more arguments

Steps to Reproduce:
1.Open LibreOffice Calc
2.Enter following formulas to any cell:
=SUM({A1},2,3,4,5}
=CONCATENATE({PI()},"this", "is", "PI")
=EXACT({#ERR501!},#ERR501!)

Actual Results:  
Actual result: entered formula is truncated, all arguments which are follow after invalid array is disappeared:
=SUM({A1},2,3,4,5) -->> =SUM({A1})
=CONCATENATE({PI()},"this", "is", "PI") -->> =CONCATENATE({PI()})
=EXACT({#ERR501!},#ERR501!) -->> =EXACT({#ERR501!})

Expected Results:
Expected result: formula entered by user should be saved


Reproducible: Always


User Profile Reset: Yes


OpenGL enabled: Yes

Additional Info:
Version: 6.0.4.1 (x64)
Build ID: a63363f6506b8bdc5222481ce79ef33b2d13c741
CPU threads: 4; OS: Windows 10.0; UI render: GL; 
Locale: en-US (en_US); Calc: CL


User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36
Comment 1 m.a.riosv 2018-05-29 21:50:39 UTC
Have you tested with semicolon instead commas as separator.
It is on Menu/Tools/Options/LibreOffice calc/Formula - Separators - function.
Comment 2 Andrey 2018-05-30 07:31:45 UTC
(In reply to m.a.riosv from comment #1)
> Have you tested with semicolon instead commas as separator.
> It is on Menu/Tools/Options/LibreOffice calc/Formula - Separators - function.

Still reproduce with semicolon separator instead of comma. Thanks for the quick response
Comment 3 m.a.riosv 2018-05-30 20:46:55 UTC
Please take a look to the help about inline arrays.
https://help.libreoffice.org/Calc/Array_Functions#Using_Inline_Array_Constants_in_Formulas

So only values are allowed, and I think there is not allowed mix inline arrays and other data with the same argument type. But it works with a formula like:
=VLOOKUP(A3;{0|0;4000|0,07;6000|0,1;9000|0,15};2)

Maybe to do what you want, the way is enter the formula as array not with an inline array.
{=SUM(A1:A6,2,3,4,5)}
Introduced with [shift+Ctrl+Enter] without the brackets.
Comment 4 Andrey 2018-05-31 08:10:04 UTC
(In reply to m.a.riosv from comment #3)
> Please take a look to the help about inline arrays.
> https://help.libreoffice.org/Calc/
> Array_Functions#Using_Inline_Array_Constants_in_Formulas
> 
> So only values are allowed, and I think there is not allowed mix inline
> arrays and other data with the same argument type. But it works with a
> formula like:
> =VLOOKUP(A3;{0|0;4000|0,07;6000|0,1;9000|0,15};2)
> 
> Maybe to do what you want, the way is enter the formula as array not with an
> inline array.
> {=SUM(A1:A6,2,3,4,5)}
> Introduced with [shift+Ctrl+Enter] without the brackets.

This issue describes falsely truncation of formula (not result of formula) with not allowed data in inline arrays. I see only 2 solutions:
1) Fix this problem
2) Add information about truncation in documentation

Thanks a lot.
Comment 5 Xisco Faulí 2018-06-04 09:33:04 UTC
> This issue describes falsely truncation of formula (not result of formula)
> with not allowed data in inline arrays. I see only 2 solutions:
> 1) Fix this problem
> 2) Add information about truncation in documentation
> 
> Thanks a lot.

@Eike, any opinion here?

Putting to UNCONFIRMED for the time being...
Comment 6 Commit Notification 2018-06-05 07:21:59 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

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

Resolves: tdf#117879 preserve formula after inline array error

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 Eike Rathke 2018-06-05 08:01:04 UTC
Pending review
https://gerrit.libreoffice.org/55307 for 6-1
https://gerrit.libreoffice.org/55308 for 6-0
Comment 8 Commit Notification 2018-06-05 08:31:29 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

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

Resolves: tdf#117879 preserve formula after inline array error

It will be available in 6.1.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 9 Commit Notification 2018-06-05 10:12:27 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

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

Add "Unsupported inline array content." BadArrayContent message, tdf#117879

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 10 Commit Notification 2018-06-05 14:26:29 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

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

Add "Unsupported inline array content." BadArrayContent message, tdf#117879

It will be available in 6.1.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 11 Commit Notification 2018-06-05 15:20:52 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-6-0":

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

Resolves: tdf#117879 preserve formula after inline array error

It will be available in 6.0.6.

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.