cui/source/dialogs/cuicharmap.cxx |   16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

New commits:
commit a4d22caa78f58a2e9263a17370feaa6d7fdf665c
Author: Caolán McNamara <caol...@redhat.com>
Date:   Fri Jul 28 11:50:31 2017 +0100

    replace snprintf with our own converters
    
    Change-Id: I27b0b82ac5be631c0d47f486603e241026dcabd9

diff --git a/cui/source/dialogs/cuicharmap.cxx 
b/cui/source/dialogs/cuicharmap.cxx
index e37a6163aea5..05626672e419 100644
--- a/cui/source/dialogs/cuicharmap.cxx
+++ b/cui/source/dialogs/cuicharmap.cxx
@@ -775,16 +775,12 @@ IMPL_LINK(SvxCharacterMap, CharClickHdl, SvxCharView*, 
rView, void)
 
     // 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);
+    OUString aHexText = OUString::number(cChar, 16).toAsciiUpperCase();
 
     // Get the decimal code
-    char aDecBuf[32];
-    snprintf( aDecBuf, sizeof(aDecBuf), "%u", static_cast<unsigned>(cChar));
-    OUString aDecimalText = OUString::createFromAscii(aDecBuf);
+    OUString aDecimalText = OUString::number(cChar);
 
     m_pHexCodeText->SetText( aHexText );
     m_pDecimalCodeText->SetText( aDecimalText );
@@ -870,13 +866,9 @@ IMPL_LINK_NOARG(SvxCharacterMap, CharHighlightHdl, 
SvxShowCharSet*, void)
     if ( bSelect )
     {
         // Get the hexadecimal code
-        char aBuf[32];
-        snprintf( aBuf, sizeof(aBuf), "%X", static_cast<unsigned>(cChar) );
-        aHexText = OUString::createFromAscii(aBuf);
+        aHexText = OUString::number(cChar, 16).toAsciiUpperCase();
         // Get the decimal code
-        char aDecBuf[32];
-        snprintf( aDecBuf, sizeof(aDecBuf), "%u", static_cast<unsigned>(cChar) 
);
-        aDecimalText = OUString::createFromAscii(aDecBuf);
+        aDecimalText = OUString::number(cChar);
         setCharName(cChar);
     }
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to