sal/inc/rtl/ustrbuf.hxx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
New commits: commit bf246fce77cdfac7e031d93a912d0bf2071a6e5e Author: Norbert Thiebaud <nthieb...@gmail.com> Date: Mon Nov 19 22:34:35 2012 -0600 a replace() to OUStringBuffer Change-Id: I2cbfeea9800ad656c49ce1cae7ff1f4b830f1442 Reviewed-on: https://gerrit.libreoffice.org/1139 Reviewed-by: Norbert Thiebaud <nthieb...@gmail.com> Tested-by: Norbert Thiebaud <nthieb...@gmail.com> diff --git a/sal/inc/rtl/ustrbuf.hxx b/sal/inc/rtl/ustrbuf.hxx index a82a30b..25195f1 100644 --- a/sal/inc/rtl/ustrbuf.hxx +++ b/sal/inc/rtl/ustrbuf.hxx @@ -924,6 +924,26 @@ public: return *this; } + /** + Replace all occurrences of + oldChar in this string buffer with newChar. + + @since LibreOffice 4.0 + + @param oldChar the old character. + @param newChar the new character. + @return this string buffer + */ + OUStringBuffer& replace( sal_Unicode oldChar, sal_Unicode newChar ) + { + sal_Int32 index = 0; + while((index = indexOf(oldChar, index)) >= 0) + { + pData->buffer[ index ] = newChar; + } + return *this; + } + /** Allows access to the internal data of this OUStringBuffer, for effective manipulation. _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits