Kaydet (Commit) 8fad6d99 authored tarafından Herbert Dürr's avatar Herbert Dürr Kaydeden (comit) Caolán McNamara

Resolves: #i123986# fix charmap accessibility for...

code points beyond the unicode baseplane

(cherry picked from commit 5a81299b)

Conflicts:
	svx/source/accessibility/charmapacc.cxx

Change-Id: I29eaf14211be633a8dd354aac9f308e4a18ba27b
üst 431b49fb
...@@ -696,18 +696,21 @@ OUString SAL_CALL SvxShowCharSetItemAcc::getAccessibleDescription() ...@@ -696,18 +696,21 @@ OUString SAL_CALL SvxShowCharSetItemAcc::getAccessibleDescription()
ensureAlive(); ensureAlive();
OUString sDescription = SVX_RESSTR( RID_SVXSTR_CHARACTER_CODE ); 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"; char buf[16] = "0x0000";
sal_Unicode c_Shifted = c; sal_UCS4 c_Shifted = c;
for( int i = 0; i < 4; ++i ) for( int i = 0; i < tmp_len; ++i )
{ {
char h = (char)(c_Shifted & 0x0F); 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; c_Shifted >>= 4;
} }
if( c < 256 ) if( c < 256 )
snprintf( buf+6, 10, " (%d)", c ); 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; return sDescription;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment