From 60573363d87bb1335ff8ac0c0623f0ec3e0dc319 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Wed, 28 Mar 2012 22:24:48 +0200 Subject: clean up string literal overloads in OUStringBuffer --- sal/inc/rtl/ustrbuf.hxx | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'sal') diff --git a/sal/inc/rtl/ustrbuf.hxx b/sal/inc/rtl/ustrbuf.hxx index 15bbe67ad04b..a89d87716fe5 100644 --- a/sal/inc/rtl/ustrbuf.hxx +++ b/sal/inc/rtl/ustrbuf.hxx @@ -52,10 +52,6 @@ namespace rtl #ifdef RTL_STRING_UNITTEST #undef rtl -// helper macro to make functions appear more readable -#define RTL_STRING_CONST_FUNCTION rtl_string_unittest_const_literal_function = true; -#else -#define RTL_STRING_CONST_FUNCTION #endif /** A string buffer implements a mutable sequence of characters. @@ -428,20 +424,14 @@ public: This function accepts an ASCII string literal as its argument. @since LibreOffice 3.6 */ - template< int N > - OUStringBuffer& append( const char (&literal)[ N ] ) + template< typename T > + typename internal::ConstCharArrayDetector< T, OUStringBuffer& >::Type append( T& literal ) { - rtl_uStringbuffer_insert_ascii( &pData, &nCapacity, getLength(), literal, N - 1 ); + rtl_uStringbuffer_insert_ascii( &pData, &nCapacity, getLength(), literal, + internal::ConstCharArrayDetector< T, void >::size - 1 ); return *this; } - /** - It is an error to call this overload. Strings cannot directly use non-const char[]. - @internal - */ - template< int N > - OUStringBuffer& append( char (&literal)[ N ] ); - /** Appends the string representation of the sal_Bool argument to the string buffer. @@ -889,7 +879,6 @@ namespace rtl { typedef rtlunittest::OUStringBuffer OUStringBuffer; } -#undef RTL_STRING_CONST_FUNCTION #endif #endif /* _RTL_USTRBUF_HXX_ */ -- cgit