Bug 127013 - The input fields for separators ("Function", "Array column", "Array row") allow to choose improper characters.
Summary: The input fields for separators ("Function", "Array column", "Array row") all...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.3.0 release
Hardware: All All
: medium normal
Assignee: Eike Rathke
URL:
Whiteboard: target:7.2.0 target:7.1.5
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-18 20:06 UTC by Wolfgang Jäger
Modified: 2021-06-14 09:16 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 Wolfgang Jäger 2019-08-18 20:06:33 UTC
Menu item sequence >Tools>Options>LibreOffice Calc>Formula>
leads to a dialogue window containing a section "Separators".

There are the three mentioned input fields. They don't offer a restricted selection, but allow for direct input. Some characters are not accepted, among them letters and the ordinary arithmentic operators, but many are accepted even if obviousliy not usable for the purpose. 

Among the improper characters are 
all decimal digits
":", "~", "!" range operators
"&" the concatenation operator
"=" a comparison operator
"%" an arithmetic suffix operator
"#","$", "?" otherwise improper
and even "{", "}".

The only characters I can find for a positive list are ";" and (hesitating) "|",  and -if you think it's unavoidable- the damned comma which surely was at the beginning of the mess.

Suggested solutions:
1) Simple: The fields accept only ";", "|", and "," shown in a label.
2) Comfortable: The selection is made by enabling the respective radio button from a group.
In any case the second and the third choice must be different (as already implemented).
Comment 1 Wolfgang Jäger 2019-08-18 20:20:44 UTC
I missed to mention a suggestion:

The defaults should be the characters used for the respective purpose in the persistent representation. These are
";" between parameters (labelled "Function")
";" between elements in a row (Labelled "Array column")
"|" between the rows ("Array row").
Comment 2 m_a_riosv 2019-08-19 20:55:41 UTC
Agree, but I find personally more understandable visually:
"|" between elements in a row (Labelled "Array column")
";" between the rows ("Array row")
Comment 3 Wolfgang Jäger 2019-08-19 21:58:43 UTC
(In reply to m.a.riosv from comment #2)
> Agree, but I find personally more understandable visually:
> "|" between elements in a row (Labelled "Array column")
> ";" between the rows ("Array row")

Well, it may be seen differently. I personally would see it the other way. BUT:

I simply suggested to do did it as ODF "Recalculated Formula" defines the separators for the persistent (file) representation in "5.13 Inline Arrays".
Comment 4 Eike Rathke 2021-01-14 17:24:09 UTC
That once was the case, but users complained that they can't enter formulas like they were used to from Excel, so separator settings were introduced. Which does make sense.
Comment 5 Wolfgang Jäger 2021-01-14 20:11:26 UTC
(In reply to Eike Rathke from comment #4)
> That once was the case, but users complained that they can't enter formulas
> like they were used to from Excel, so separator settings were introduced.
> Which does make sense.

I simply want to make clear again that the bug report was concerned about IMPROPER (not working, not acceptable) settings. The line of discussion what probably was better in old times ran in parallel. 

Just testing with V 7-0.3.1RC I got again that a setting like

'Function : 1
'Array Column' : ?
'Array rRow': }  (Curly bracket)

was accepted and saved despite the fact that these settings not can be expected to allow functional and/or reasonable usage.  

(A "working" example with the kind of setting is shown 'local' as "=TEXT(11"0")" e.g. It returned 1.)
Comment 6 Eike Rathke 2021-06-11 12:07:45 UTC
A very restricted set is necessary for the function parameter separator that must not equal any other operator (or (one letter) function name).

As expressions are not evaluated in inline arrays the array separators are less restricted, e.g. ':' or other otherwise operators *are* possible, '{' and '}' or digits of course not. Maybe disallow '%' to prevent confusion.
Comment 7 Commit Notification 2021-06-11 20:09:50 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/bb54d6d8241a06a6772052b77b67d6a4f686426c

Resolves: tdf#127013 differentiate non-/array separators and restrict

It will be available in 7.2.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2021-06-11 21:51:51 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/381bc9d9acd461415cf81eef71ec3dd935a07b62

Related: tdf#127013 Check loaded separators for validity

It will be available in 7.2.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 9 Eike Rathke 2021-06-11 22:02:13 UTC
Pending review https://gerrit.libreoffice.org/c/core/+/117075 for 7-1
Comment 10 Commit Notification 2021-06-14 09:16:02 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-7-1":

https://git.libreoffice.org/core/commit/304d64cc27a729646522c7e16ad3d1d0aa2b1a12

Resolves: tdf#127013 differentiate non-/array separators and restrict

It will be available in 7.1.5.

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

Affected users are encouraged to test the fix and report feedback.