diff options
author | Herbert Dürr <hdu@apache.org> | 2014-01-07 08:45:56 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-01-07 15:59:23 +0000 |
commit | 8fad6d99650c63dcc4a4ca4910d34dc4b901c00d (patch) | |
tree | 4f415274b8dc5e9173831a902515a1ada0e68069 /svx | |
parent | 431b49fbec68c17c7a486ef0f577107d3dd27e55 (diff) |
Resolves: #i123986# fix charmap accessibility for...
code points beyond the unicode baseplane
(cherry picked from commit 5a81299b05da6f1f9ec81246abe54c55f49793a4)
Conflicts:
svx/source/accessibility/charmapacc.cxx
Change-Id: I29eaf14211be633a8dd354aac9f308e4a18ba27b
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/accessibility/charmapacc.cxx | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/svx/source/accessibility/charmapacc.cxx b/svx/source/accessibility/charmapacc.cxx index 28a11fef7dd2..36f493f42dd5 100644 --- a/svx/source/accessibility/charmapacc.cxx +++ b/svx/source/accessibility/charmapacc.cxx @@ -696,18 +696,21 @@ OUString SAL_CALL SvxShowCharSetItemAcc::getAccessibleDescription() ensureAlive(); OUString sDescription = SVX_RESSTR( RID_SVXSTR_CHARACTER_CODE ); - sal_Unicode c = mpParent->maText[0]; + const OUString aCharStr( mpParent->maText); + sal_Int32 nStrIndex = 0; + const sal_UCS4 c = aCharStr.iterateCodePoints( &nStrIndex ); + const int tmp_len = (c < 0x10000) ? 4 : 6; char buf[16] = "0x0000"; - sal_Unicode c_Shifted = c; - for( int i = 0; i < 4; ++i ) + sal_UCS4 c_Shifted = c; + for( int i = 0; i < tmp_len; ++i ) { char h = (char)(c_Shifted & 0x0F); - buf[5-i] = (h > 9) ? (h - 10 + 'A') : (h + '0'); + buf[tmp_len+1-i] = (h > 9) ? (h - 10 + 'A') : (h + '0'); c_Shifted >>= 4; } if( c < 256 ) snprintf( buf+6, 10, " (%d)", c ); - sDescription += OUString(buf, strlen(buf), RTL_TEXTENCODING_ASCII_US); + sDescription += " " + OUString(buf, strlen(buf), RTL_TEXTENCODING_ASCII_US); return sDescription; } |