[Libreoffice-commits] core.git: cui/source

Akshay Deep akshaydeepiitr at gmail.com
Fri Jun 30 09:20:52 UTC 2017


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

New commits:
commit 9e76d8b66e8b3a337f426651de3d44c164dce7ed
Author: Akshay Deep <akshaydeepiitr at 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 <ci at libreoffice.org>
    Reviewed-by: Akshay Deep <akshaydeepiitr at 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();
 }


More information about the Libreoffice-commits mailing list