summaryrefslogtreecommitdiff
path: root/cui/source
diff options
context:
space:
mode:
authorAkshay Deep <akshaydeepiitr@gmail.com>2017-06-30 02:43:46 +0530
committerAkshay Deep <akshaydeepiitr@gmail.com>2017-06-30 11:20:28 +0200
commit9e76d8b66e8b3a337f426651de3d44c164dce7ed (patch)
treeb7806d60c1ee18b49f26245645c723d713f45ede /cui/source
parent09031ef2fe89a8a6321ca89cca49f1587fe577e6 (diff)
Hexcode amd decimal code should be updated while switching to recent view
Change-Id: Iecde38cf076a5c3d862912ff042bd51864b89a0c Reviewed-on: https://gerrit.libreoffice.org/39401 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Akshay Deep <akshaydeepiitr@gmail.com>
Diffstat (limited to 'cui/source')
-rw-r--r--cui/source/dialogs/cuicharmap.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx
index 85f6afb3989d..58438b0fa913 100644
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -477,6 +477,23 @@ IMPL_LINK(SvxCharacterMap, RecentClickHdl, SvxCharView*, rView, void)
m_pShowChar->SetFont(rView->GetFont());
m_pShowChar->Update();
rView->GrabFocus();
+
+ // Get the hexadecimal code
+ OUString charValue = rView->GetText();
+ char aBuf[32];
+ sal_Int32 tmp = 1;
+ sal_UCS4 cChar = charValue.iterateCodePoints(&tmp, -1);
+ snprintf( aBuf, sizeof(aBuf), "%X", static_cast<unsigned>(cChar));
+ OUString aHexText = OUString::createFromAscii(aBuf);
+
+ // Get the decimal code
+ char aDecBuf[32];
+ snprintf( aDecBuf, sizeof(aDecBuf), "%u", static_cast<unsigned>(cChar));
+ OUString aDecimalText = OUString::createFromAscii(aDecBuf);
+
+ m_pHexCodeText->SetText( aHexText );
+ m_pDecimalCodeText->SetText( aDecimalText );
+
rView->Invalidate();
m_pOKBtn->Enable();
}