Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


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@gmx.de>

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.