Description: in ODFF specification of SEARCH function is Constraints: Start >= 1, but =SEARCH("e","LibreOffice",*-1*) returns 5. Should return error. Actual Results: . Expected Results: . Reproducible: Always User Profile Reset: No Additional Info: User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:51.0) Gecko/20100101 Firefox/51.0
I get 'err:501' in Version: 5.4.0.0.alpha0+ Build ID: fc53cce64400430cdc21f79c959d75fb9a26d13d CPU Threads: 4; OS Version: Linux 4.8; UI Render: default; VCL: gtk2; Locale: ca-ES (ca_ES.UTF-8); Calc: group
(In reply to Xisco Faulí from comment #1) > I get 'err:501' in > Hi Xisco, try this formula =SEARCH("e","LibreOffice",-1)
(In reply to raal from comment #2) ... > try this formula =SEARCH("e","LibreOffice",-1) On pc Debian x86-64 with master sources updated today, I copied-pasted this exact expression on a brand new Calc file, I got error -501. locale is LANG=fr_FR.UTF-8 and use English US interface in LO Could it be localization related?
Also for me first sample gives: 'err:501' Seems that any value under 1 is treated as 1. Last version right: Versión: 4.2.8.2 Id. de compilación: 48d50dbfc06349262c9d50868e5c1f630a573ebd First version bad: Version: 4.4.7.2 Build ID: f3153a8b245191196a4b6b9abd1d0da16eead600 Locale: es_ES
(In reply to raal from comment #2) > (In reply to Xisco Faulí from comment #1) > > I get 'err:501' in > > > > Hi Xisco, > try this formula =SEARCH("e","LibreOffice",-1) same result, even on Windows.
Those who tried and got Err501 as result probably just copied Raal's formula (I did at first too). The formula does not work directly (i.e. produces Err501) unless you change the argument separator to what your locale uses and remove the * before and after -1 in argument 'Start'. Presently, Calc accepts values for argument Start that are 0 or negative and replaces them with 1 before processing the formula. As this is not compliant with ODFF1.2 and differs from the behaviour of Excel, with which we aim for as much interoperability as possible, I will fix it.
Winfried Donkers committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=07157107a3b7fd3d1b55db9ce1aeb9f6d4e204ab tdf#105772 apply all ODFF constraints with function SEARCH. It will be available in 5.4.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.