diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-10-07 18:12:26 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-10-07 18:12:26 +0200 |
commit | 5c2894222beed4b30c6be0379cade228c42c5610 (patch) | |
tree | 9c797db7bc93db83579f5a1e9a8633d2d087cbca /sal | |
parent | d211dafa9e35d9af26acc274b18a32b8ca0b937a (diff) |
New rtl::splitSurrogates, remove code duplication
Change-Id: Ic96b64244f817196ccdfe06b97f7f31291adf372
Diffstat (limited to 'sal')
-rw-r--r-- | sal/rtl/ustring.cxx | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/sal/rtl/ustring.cxx b/sal/rtl/ustring.cxx index b1fb82a375dd..3d157270ef3c 100644 --- a/sal/rtl/ustring.cxx +++ b/sal/rtl/ustring.cxx @@ -598,13 +598,7 @@ void SAL_CALL rtl_uString_newFromCodePoints( } p = (*newString)->buffer; for (i = 0; i < codePointCount; ++i) { - sal_uInt32 c = codePoints[i]; - if (c < 0x10000) { - *p++ = (sal_Unicode) c; - } else { - *p++ = rtl::getHighSurrogate(c); - *p++ = rtl::getLowSurrogate(c); - } + p += rtl::splitSurrogates(codePoints[i], p); } RTL_LOG_STRING_NEW( *newString ); } |