summaryrefslogtreecommitdiff
path: root/sal
diff options
context:
space:
mode:
authorNoel <noel.grandin@collabora.co.uk>2021-01-28 11:01:28 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-01-28 11:11:28 +0100
commit1da69081732c8a429840edaaf10cfb789ea68df8 (patch)
treef343c9559e9dfb0263f7e33fe4306f81ec60e3fa /sal
parentb3737c638671ab39c5e6aaeaf5426d102392cc0a (diff)
add string_view variants of methods to O[U]StringBuffer
and update the stringview loplugin to detect cases where we can use these new methods. Change-Id: I998efe02e35c8efcb3abfb4d7186165bbe6dfb2c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110046 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sal')
-rw-r--r--sal/qa/rtl/oustringbuffer/test_oustringbuffer_utf32.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/sal/qa/rtl/oustringbuffer/test_oustringbuffer_utf32.cxx b/sal/qa/rtl/oustringbuffer/test_oustringbuffer_utf32.cxx
index 80643df2eba0..2a4f35e2e793 100644
--- a/sal/qa/rtl/oustringbuffer/test_oustringbuffer_utf32.cxx
+++ b/sal/qa/rtl/oustringbuffer/test_oustringbuffer_utf32.cxx
@@ -86,13 +86,13 @@ void test::oustringbuffer::Utf32::appendUtf32() {
int const str3Len = 6;
sal_Unicode const str3[str3Len] = { 'a', 'b', 'c', 'd', 0xD800, 0xDC00 };
OStringBuffer message;
- OUStringBuffer buf1(OUString(str1, str1Len));
+ OUStringBuffer buf1(std::u16string_view(str1, str1Len));
buf1.appendUtf32('d');
OUString res1(buf1.makeStringAndClear());
createMessage(message, res1, OUString(str2, str2Len));
CPPUNIT_ASSERT_EQUAL_MESSAGE(
message.getStr(), OUString(str2, str2Len), res1);
- OUStringBuffer buf2(OUString(str2, str2Len));
+ OUStringBuffer buf2(std::u16string_view(str2, str2Len));
buf2.appendUtf32(0x10000);
OUString res2(buf2.makeStringAndClear());
createMessage(message, res2, OUString(str3, str3Len));
@@ -108,13 +108,13 @@ void test::oustringbuffer::Utf32::insertUtf32() {
int const str3Len = 6;
sal_Unicode const str3[str3Len] = { 'a', 'b', 0xDBFF, 0xDFFF, 'd', 'c' };
OStringBuffer message;
- OUStringBuffer buf1(OUString(str1, str1Len));
+ OUStringBuffer buf1(std::u16string_view(str1, str1Len));
buf1.insertUtf32(2, 'd');
OUString res1(buf1.makeStringAndClear());
createMessage(message, res1, OUString(str2, str2Len));
CPPUNIT_ASSERT_EQUAL_MESSAGE(
message.getStr(), OUString(str2, str2Len), res1);
- OUStringBuffer buf2(OUString(str2, str2Len));
+ OUStringBuffer buf2(std::u16string_view(str2, str2Len));
buf2.insertUtf32(2, 0x10FFFF);
OUString res2(buf2.makeStringAndClear());
createMessage(message, res2, OUString(str3, str3Len));