[Libreoffice-commits] core.git: sal/inc

David Ostrovsky david at ostrovsky.org
Wed Feb 6 10:28:51 PST 2013


 sal/inc/rtl/string.hxx  |    5 +----
 sal/inc/rtl/ustring.hxx |    5 +----
 2 files changed, 2 insertions(+), 8 deletions(-)

New commits:
commit 145eda4c4de2bcbb3cd255e1ccd353e81bf6c96f
Author: David Ostrovsky <david at ostrovsky.org>
Date:   Tue Feb 5 11:39:06 2013 +0100

    O(U)String::valueOf don't duplicate code
    
    Change-Id: I586fca181f63999a8f2d19d600b69f6788fd61d9
    Reviewed-on: https://gerrit.libreoffice.org/1992
    Reviewed-by: Luboš Luňák <l.lunak at suse.cz>
    Tested-by: Luboš Luňák <l.lunak at suse.cz>

diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx
index 05ba18f..345827c 100644
--- a/sal/inc/rtl/string.hxx
+++ b/sal/inc/rtl/string.hxx
@@ -1540,10 +1540,7 @@ public:
     */
     SAL_DEPRECATED_INTERNAL("use number()") static OString valueOf( sal_Int32 i, sal_Int16 radix = 10 ) SAL_THROW(())
     {
-        sal_Char aBuf[RTL_STR_MAX_VALUEOFINT32];
-        rtl_String* pNewData = 0;
-        rtl_string_newFromStr_WithLength( &pNewData, aBuf, rtl_str_valueOfInt32( aBuf, i, radix ) );
-        return OString( pNewData, (DO_NOT_ACQUIRE*)0 );
+        return number( i, radix );
     }
 
     /**
diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx
index f7d793a..7024bf4 100644
--- a/sal/inc/rtl/ustring.hxx
+++ b/sal/inc/rtl/ustring.hxx
@@ -2191,10 +2191,7 @@ public:
     */
     SAL_DEPRECATED_INTERNAL("use number()") static OUString valueOf( sal_Int32 i, sal_Int16 radix = 10 ) SAL_THROW(())
     {
-        sal_Unicode aBuf[RTL_USTR_MAX_VALUEOFINT32];
-        rtl_uString* pNewData = 0;
-        rtl_uString_newFromStr_WithLength( &pNewData, aBuf, rtl_ustr_valueOfInt32( aBuf, i, radix ) );
-        return OUString( pNewData, (DO_NOT_ACQUIRE*)0 );
+        return number( i, radix );
     }
 
     /**


More information about the Libreoffice-commits mailing list