summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-10-07 18:12:26 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-10-07 18:12:26 +0200
commit5c2894222beed4b30c6be0379cade228c42c5610 (patch)
tree9c797db7bc93db83579f5a1e9a8633d2d087cbca /svtools
parentd211dafa9e35d9af26acc274b18a32b8ca0b937a (diff)
New rtl::splitSurrogates, remove code duplication
Change-Id: Ic96b64244f817196ccdfe06b97f7f31291adf372
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/svhtml/htmlout.cxx10
1 files changed, 1 insertions, 9 deletions
diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx
index 5413e91da00f..baf8cc6dae2c 100644
--- a/svtools/source/svhtml/htmlout.cxx
+++ b/svtools/source/svhtml/htmlout.cxx
@@ -449,15 +449,7 @@ static OString lcl_ConvertCharToHTML( sal_uInt32 c,
sal_Size nSrcChars;
sal_Unicode utf16[2];
- sal_Size n;
- if (c < 0x10000) {
- utf16[0] = c;
- n = 1;
- } else {
- utf16[0] = rtl::getHighSurrogate(c);
- utf16[1] = rtl::getLowSurrogate(c);
- n = 2;
- }
+ auto n = rtl::splitSurrogates(c, utf16);
sal_Size nLen = rtl_convertUnicodeToText(rContext.m_hConv,
rContext.m_hContext, utf16, n,
cBuffer, TXTCONV_BUFFER_SIZE,