sc/source/ui/app/inputhdl.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
New commits: commit 42be5b7c75b2d50b93e110b0cd906a48b3bb0e26 Author: Justin Luth <justin_l...@sil.org> AuthorDate: Mon Dec 13 11:21:21 2021 +0200 Commit: Eike Rathke <er...@redhat.com> CommitDate: Mon Dec 13 23:30:18 2021 +0100 related tdf#92010 sc autoformula: ensure proper sorting order When typing "=a", autoformula was suggesting ACCRINT,ACCRINTM,ACOS instead of starting with ABS. [This has been true since these 3 suggestions started in LO 5.2.] Prior to this patch, the very first item in the sorted list (ABS) was placed at the end of the suggestion vector. That is because the loop immediately increments. Since the given initialization value is end(), it set begin() as the starting loop value and then immediately incremented to item 2. Item 1 was finally evaluated last, putting ABS after ZTEST. The backwards loop handled this properly, so do the same thing for the forward loop. Change-Id: I539c749ea43140a1480d74471787bc886dda671e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126723 Tested-by: Jenkins Reviewed-by: Justin Luth <jl...@mail.com> Reviewed-by: Eike Rathke <er...@redhat.com> (cherry picked from commit b2fb1631ab5b3c1d9d09aefa0d3a81307e7ffa35) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126750 diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 307f0f7a6886..8b4d8bde90b3 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -258,7 +258,7 @@ ScTypedCaseStrSet::const_iterator findTextAll( ScTypedCaseStrSet::const_iterator it, itEnd; it = itPos; if ( it == rDataSet.end() ) - it = rDataSet.begin(); + it = --rDataSet.end(); itEnd = it; bool bFirstTime = true;