summaryrefslogtreecommitdiffstats
path: root/sal/rtl
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-10-04 15:06:27 +0200
committerMichael Stahl <mstahl@redhat.com>2012-10-09 22:45:24 +0200
commit7ef1190c3e9422998d89df2cf8fcf30bddfc1a03 (patch)
tree3c59c424bfb648626ef195542cb2251245f5f626 /sal/rtl
parentmerge double fix (diff)
downloadcore-7ef1190c3e9422998d89df2cf8fcf30bddfc1a03.tar.gz
core-7ef1190c3e9422998d89df2cf8fcf30bddfc1a03.zip
Add a 'fromIndex' parameter to OUString::replaceAll
This method will be needed for forthcoming String->OUStringBuffer conversions. Change-Id: I001099baaca5cd402aebcd15c031d9060286a8f9
Diffstat (limited to 'sal/rtl')
-rw-r--r--sal/rtl/source/ustring.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/sal/rtl/source/ustring.cxx b/sal/rtl/source/ustring.cxx
index b21994959e62..ac2d7d9eba65 100644
--- a/sal/rtl/source/ustring.cxx
+++ b/sal/rtl/source/ustring.cxx
@@ -1159,9 +1159,17 @@ void rtl_uString_newReplaceAll(
rtl_uString ** newStr, rtl_uString * str, rtl_uString const * from,
rtl_uString const * to) SAL_THROW_EXTERN_C()
{
+ rtl_uString_newReplaceAllFromIndex( newStr, str, from, to, 0 );
+}
+
+void rtl_uString_newReplaceAllFromIndex(
+ rtl_uString ** newStr, rtl_uString * str, rtl_uString const * from,
+ rtl_uString const * to, sal_Int32 fromIndex) SAL_THROW_EXTERN_C()
+{
assert(to != 0);
+ assert(fromIndex >= 0 && fromIndex <= str->length);
rtl_uString_assign(newStr, str);
- for (sal_Int32 i = 0;; i += to->length) {
+ for (sal_Int32 i = fromIndex;; i += to->length) {
rtl_uString_newReplaceFirst(newStr, *newStr, from, to, &i);
if (i == -1) {
break;