diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2023-05-05 09:46:52 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2023-05-05 11:30:12 +0200 |
commit | 28cc0bff10f5dcec0c7b698ae7ba275845b2cad1 (patch) | |
tree | cdcccaa2356b8bea6c5b919faa6cd497a72e2336 /o3tl | |
parent | c1bd421eae5449a005f2ee0f01b3b4e72002296e (diff) |
Break comphelper::adjustIndexToStartOfSurrogate out of o3tl::iterateCodePoints
...as what they do is orthogonal (and it turned out that the use case that
motivated the addition of o3tl::iterateCodePoints in the first place needs them
independently, anyway)
Change-Id: Id33901a2f7ac627253654ee6d883305dcf5a456f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151415
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'o3tl')
-rw-r--r-- | o3tl/qa/test-string_view.cxx | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/o3tl/qa/test-string_view.cxx b/o3tl/qa/test-string_view.cxx index 5378ce9415ed..c658da16b5dc 100644 --- a/o3tl/qa/test-string_view.cxx +++ b/o3tl/qa/test-string_view.cxx @@ -737,28 +737,16 @@ private: { { std::size_t i = 1; - auto const c = o3tl::iterateCodePoints(u"\U00010000", &i, 1, false); + auto const c = o3tl::iterateCodePoints(u"\U00010000", &i, 1); CPPUNIT_ASSERT_EQUAL(std::size_t(2), i); CPPUNIT_ASSERT_EQUAL(sal_uInt32(0xDC00), c); } { - std::size_t i = 1; - auto const c = o3tl::iterateCodePoints(u"\U00010000", &i, 1, true); - CPPUNIT_ASSERT_EQUAL(std::size_t(2), i); - CPPUNIT_ASSERT_EQUAL(sal_uInt32(0x10000), c); - } - { std::size_t i = 2; - auto const c = o3tl::iterateCodePoints(u"a\U00010000", &i, -1, false); + auto const c = o3tl::iterateCodePoints(u"a\U00010000", &i, -1); CPPUNIT_ASSERT_EQUAL(std::size_t(1), i); CPPUNIT_ASSERT_EQUAL(sal_uInt32(0x10000), c); } - { - std::size_t i = 2; - auto const c = o3tl::iterateCodePoints(u"a\U00010000", &i, -1, true); - CPPUNIT_ASSERT_EQUAL(std::size_t(0), i); - CPPUNIT_ASSERT_EQUAL(sal_uInt32('a'), c); - } } }; |