summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorTomáš Chvátal <tchvatal@suse.com>2019-03-15 16:43:31 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-03-25 16:35:05 +0100
commit04074fe336be514d3d3f3537e6ff915a7604f6f4 (patch)
treeeff88345e9522e50782e450cdb3fd0307af125d2 /sc
parent848b25f0848bbf3d214ac19c9f815b488be9303d (diff)
Use RegexMatcher.find(pos, status) call on old ICU
The RegexMatcher.find(status) is new since icu 55 and this works even on the old releases thus revert there to the available albeit slower call. Change-Id: I964c10efd15515b04ac9037cda3b5b309910baf5 Reviewed-on: https://gerrit.libreoffice.org/69311 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com> Reviewed-on: https://gerrit.libreoffice.org/69312 Reviewed-by: Tomáš Chvátal <tchvatal@suse.cz> Tested-by: Tomáš Chvátal <tchvatal@suse.cz> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/interpr1.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index c9c3624bb019..fc0600368b7f 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -9411,7 +9411,12 @@ void ScInterpreter::ScRegex()
{
// Find n-th occurrence.
sal_Int32 nCount = 0;
- while (aRegexMatcher.find( status) && U_SUCCESS(status) && ++nCount < nOccurrence)
+#if (U_ICU_VERSION_MAJOR_NUM < 55)
+ int32_t nStartPos = 0;
+ while (aRegexMatcher.find(nStartPos, status) && U_SUCCESS(status) && ++nCount < nOccurrence)
+#else
+ while (aRegexMatcher.find(status) && U_SUCCESS(status) && ++nCount < nOccurrence)
+#endif
;
if (U_FAILURE(status))
{
@@ -9451,7 +9456,12 @@ void ScInterpreter::ScRegex()
{
// Replace n-th occurrence of match with replacement.
sal_Int32 nCount = 0;
- while (aRegexMatcher.find( status) && U_SUCCESS(status))
+#if (U_ICU_VERSION_MAJOR_NUM < 55)
+ int32_t nStartPos = 0;
+ while (aRegexMatcher.find(nStartPos, status) && U_SUCCESS(status))
+#else
+ while (aRegexMatcher.find(status) && U_SUCCESS(status))
+#endif
{
// XXX NOTE: After several RegexMatcher::find() the
// RegexMatcher::appendReplacement() still starts at the