[PATCH] O(U)String::valueOf don't duplicate code

David Ostrovsky (via Code Review) gerrit at gerrit.libreoffice.org
Tue Feb 5 02:39:33 PST 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/1992

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/92/1992/1

O(U)String::valueOf don't duplicate code

Change-Id: I586fca181f63999a8f2d19d600b69f6788fd61d9
---
M sal/inc/rtl/string.hxx
M sal/inc/rtl/ustring.hxx
2 files changed, 2 insertions(+), 8 deletions(-)



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 @@
     */
     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 @@
     */
     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 );
     }
 
     /**

-- 
To view, visit https://gerrit.libreoffice.org/1992
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I586fca181f63999a8f2d19d600b69f6788fd61d9
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: David Ostrovsky <David.Ostrovsky at gmx.de>


More information about the LibreOffice mailing list