From 5c2894222beed4b30c6be0379cade228c42c5610 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 7 Oct 2016 18:12:26 +0200 Subject: New rtl::splitSurrogates, remove code duplication Change-Id: Ic96b64244f817196ccdfe06b97f7f31291adf372 --- sal/rtl/ustring.cxx | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'sal') 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 ); } -- cgit