From 3bfed17b047422a8c4e98ab80001f3158afb227e Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Fri, 23 Sep 2022 07:41:23 -0400 Subject: tdf#123990 sc condformat: case insensitive begins/ends/contains This is how Excel handles these. At first I was afraid that this would upset LibreOffice users, but then I realized that equals already is case insensitive, so this change ought to be more consistent, and thus there should be fewer outcrys. Change-Id: Ia3de78d5888672ba8b774866d41ecd65293397c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140484 Tested-by: Jenkins Reviewed-by: Justin Luth --- unotools/source/i18n/collatorwrapper.cxx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'unotools') diff --git a/unotools/source/i18n/collatorwrapper.cxx b/unotools/source/i18n/collatorwrapper.cxx index 4da1398e0636..ce85de11df7e 100644 --- a/unotools/source/i18n/collatorwrapper.cxx +++ b/unotools/source/i18n/collatorwrapper.cxx @@ -46,6 +46,23 @@ CollatorWrapper::compareString (const OUString& s1, const OUString& s2) const return 0; } +sal_Int32 +CollatorWrapper::compareSubstring (const OUString& s1, sal_Int32 off1, sal_Int32 len1, + const OUString& s2, sal_Int32 off2, sal_Int32 len2) const +{ + try + { + if (mxInternationalCollator.is()) + return mxInternationalCollator->compareSubstring (s1, off1, len1, s2, off2, len2); + } + catch (const uno::RuntimeException&) + { + SAL_WARN( "unotools.i18n","CollatorWrapper: compareSubstring failed"); + } + + return 0; +} + uno::Sequence< OUString > CollatorWrapper::listCollatorAlgorithms (const lang::Locale& rLocale) const { -- cgit