diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2022-02-26 20:41:55 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2022-02-27 06:07:21 +0100 |
commit | 2126968ffbceb3c6f05db29c26ec90975e3f6331 (patch) | |
tree | 9317f04740494e3ab6032d1b572608f34358c38c /sal/rtl/string.cxx | |
parent | 5df0289f6af5aa7142017b56a8e17c134d54fe41 (diff) |
Deduplicate more comparison functions
Change-Id: I93aba36b7cde268e358bd96b55183533ddc70b16
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130603
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sal/rtl/string.cxx')
-rw-r--r-- | sal/rtl/string.cxx | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/sal/rtl/string.cxx b/sal/rtl/string.cxx index 2b118a57aada..4b08b5e2c39f 100644 --- a/sal/rtl/string.cxx +++ b/sal/rtl/string.cxx @@ -337,14 +337,15 @@ sal_Int32 SAL_CALL rtl_str_getLength(const char* pStr) SAL_THROW_EXTERN_C() sal_Int32 SAL_CALL rtl_str_compare(const char* pStr1, const char* pStr2) SAL_THROW_EXTERN_C() { - return rtl::str::compare(pStr1, pStr2); + return rtl::str::compare(pStr1, pStr2, rtl::str::CompareNormal()); } sal_Int32 SAL_CALL rtl_str_compare_WithLength(const char* pStr1, sal_Int32 nStr1Len, const char* pStr2, sal_Int32 nStr2Len) SAL_THROW_EXTERN_C() { - return rtl::str::compare_WithLength(pStr1, nStr1Len, pStr2, nStr2Len); + return rtl::str::compare_WithLengths(pStr1, nStr1Len, pStr2, nStr2Len, + rtl::str::CompareNormal()); } sal_Int32 SAL_CALL rtl_str_shortenedCompare_WithLength(const char* pStr1, sal_Int32 nStr1Len, @@ -352,35 +353,38 @@ sal_Int32 SAL_CALL rtl_str_shortenedCompare_WithLength(const char* pStr1, sal_In sal_Int32 nShortenedLength) SAL_THROW_EXTERN_C() { - return rtl::str::shortenedCompare_WithLength(pStr1, nStr1Len, pStr2, nStr2Len, nShortenedLength); + return rtl::str::shortenedCompare_WithLengths(pStr1, nStr1Len, pStr2, nStr2Len, + nShortenedLength, rtl::str::CompareNormal()); } sal_Int32 SAL_CALL rtl_str_reverseCompare_WithLength(const char* pStr1, sal_Int32 nStr1Len, const char* pStr2, sal_Int32 nStr2Len) SAL_THROW_EXTERN_C() { - return rtl::str::reverseCompare_WithLength(pStr1, nStr1Len, pStr2, nStr2Len); + return rtl::str::reverseCompare_WithLengths(pStr1, nStr1Len, pStr2, nStr2Len, + rtl::str::CompareNormal()); } sal_Int32 SAL_CALL rtl_str_compareIgnoreAsciiCase(const char* pStr1, const char* pStr2) SAL_THROW_EXTERN_C() { - return rtl::str::compareIgnoreAsciiCase(pStr1, pStr2); + return rtl::str::compare(pStr1, pStr2, rtl::str::CompareIgnoreAsciiCase()); } sal_Int32 SAL_CALL rtl_str_compareIgnoreAsciiCase_WithLength(const char* pStr1, sal_Int32 nStr1Len, const char* pStr2, sal_Int32 nStr2Len) SAL_THROW_EXTERN_C() { - return rtl::str::compareIgnoreAsciiCase_WithLength(pStr1, nStr1Len, pStr2, nStr2Len); + return rtl::str::compare_WithLengths(pStr1, nStr1Len, pStr2, nStr2Len, + rtl::str::CompareIgnoreAsciiCase()); } sal_Int32 SAL_CALL rtl_str_shortenedCompareIgnoreAsciiCase_WithLength( const char* pStr1, sal_Int32 nStr1Len, const char* pStr2, sal_Int32 nStr2Len, sal_Int32 nShortenedLength) SAL_THROW_EXTERN_C() { - return rtl::str::shortenedCompareIgnoreAsciiCase_WithLength(pStr1, nStr1Len, pStr2, nStr2Len, - nShortenedLength); + return rtl::str::shortenedCompare_WithLengths( + pStr1, nStr1Len, pStr2, nStr2Len, nShortenedLength, rtl::str::CompareIgnoreAsciiCase()); } sal_Int32 SAL_CALL rtl_str_hashCode(const char* pStr) SAL_THROW_EXTERN_C() |