cui/source/dialogs/cuicharmap.cxx |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

New commits:
commit 9e76d8b66e8b3a337f426651de3d44c164dce7ed
Author: Akshay Deep <akshaydeepi...@gmail.com>
Date:   Fri Jun 30 02:43:46 2017 +0530

    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 <c...@libreoffice.org>
    Reviewed-by: Akshay Deep <akshaydeepi...@gmail.com>

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();
 }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to