diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-07-28 11:39:48 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-07-28 11:39:51 +0100 |
commit | f59284e3369f249b33dbd2adb4ed44d72840d78f (patch) | |
tree | 57088ab2f5bb5b1d42f580f13360210c6a47d4a0 | |
parent | 3fea681c48dbb5ca599d78ae219785b90a13f2a6 (diff) |
pass char code directly rather than as-text
and then turning it back into the code again
Change-Id: Iae9cddb18a6bdad4b1ba8c2af81f3d29a7f26725
-rw-r--r-- | cui/source/dialogs/cuicharmap.cxx | 12 | ||||
-rw-r--r-- | cui/source/inc/cuicharmap.hxx | 2 |
2 files changed, 6 insertions, 8 deletions
diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx index a7f8ae6eacf3..e37a6163aea5 100644 --- a/cui/source/dialogs/cuicharmap.cxx +++ b/cui/source/dialogs/cuicharmap.cxx @@ -666,14 +666,12 @@ IMPL_LINK_NOARG(SvxCharacterMap, FontSelectHdl, ListBox&, void) m_pSubsetLB->Enable(bNeedSubset); } -void SvxCharacterMap::setCharName(char decimal[]) +void SvxCharacterMap::setCharName(sal_UCS4 nDecimalValue) { - int nDecimalValue = std::stoi(decimal); - char buffer[100]; - /* get the character name */ UErrorCode errorCode = U_ZERO_ERROR; - u_charName((UChar32)nDecimalValue, U_UNICODE_CHAR_NAME, buffer, sizeof(buffer), &errorCode); + char buffer[100]; + u_charName(nDecimalValue, U_UNICODE_CHAR_NAME, buffer, sizeof(buffer), &errorCode); m_pCharName->SetText(OUString::createFromAscii(buffer)); } @@ -790,7 +788,7 @@ IMPL_LINK(SvxCharacterMap, CharClickHdl, SvxCharView*, rView, void) m_pHexCodeText->SetText( aHexText ); m_pDecimalCodeText->SetText( aDecimalText ); - setCharName(aDecBuf); + setCharName(cChar); rView->Invalidate(); m_pOKBtn->Enable(); @@ -879,7 +877,7 @@ IMPL_LINK_NOARG(SvxCharacterMap, CharHighlightHdl, SvxShowCharSet*, void) char aDecBuf[32]; snprintf( aDecBuf, sizeof(aDecBuf), "%u", static_cast<unsigned>(cChar) ); aDecimalText = OUString::createFromAscii(aDecBuf); - setCharName(aDecBuf); + setCharName(cChar); } // Update the hex and decimal codes only if necessary diff --git a/cui/source/inc/cuicharmap.hxx b/cui/source/inc/cuicharmap.hxx index 2681bb610ac4..9f4f2e9a0fb2 100644 --- a/cui/source/inc/cuicharmap.hxx +++ b/cui/source/inc/cuicharmap.hxx @@ -144,7 +144,7 @@ public: void updateFavCharControl(); void setFavButtonState(const OUString& sTitle, const OUString& rFont); - void setCharName(char decimal[]); + void setCharName(sal_UCS4 nDecimalValue); }; #endif |