summaryrefslogtreecommitdiff
path: root/sal/inc
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2012-03-30 16:53:45 +0200
committerLuboš Luňák <l.lunak@suse.cz>2012-03-30 17:34:17 +0200
commitd537da41d7b51783f98e0629917dc3831b053795 (patch)
tree7fcd80dcc47bf1489c8e3c5c9a5c713c0ceaeb2d /sal/inc
parent8bc439333a970895b0f1dd5f353ac9f8c9031c56 (diff)
no bad_alloc throwing in string literal O(U)String functions
String literals should be reasonably short, and if memory is so low that they trigger allocation failure, something else would would trip over very soon anyway.
Diffstat (limited to 'sal/inc')
-rw-r--r--sal/inc/rtl/ustring.hxx23
1 files changed, 0 insertions, 23 deletions
diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx
index ad6fad22713e..a5528894e0d4 100644
--- a/sal/inc/rtl/ustring.hxx
+++ b/sal/inc/rtl/ustring.hxx
@@ -192,7 +192,6 @@ public:
@param literal the 8-bit ASCII string literal
- @exception std::bad_alloc is thrown if an out-of-memory condition occurs
@since LibreOffice 3.6
*/
#ifdef HAVE_SFINAE_ANONYMOUS_BROKEN
@@ -203,13 +202,6 @@ public:
{
pData = 0;
rtl_uString_newFromLiteral( &pData, literal, N - 1 );
- if (pData == 0) {
-#if defined EXCEPTIONS_OFF
- SAL_WARN("sal", "std::bad_alloc but EXCEPTIONS_OFF");
-#else
- throw std::bad_alloc();
-#endif
- }
#ifdef RTL_STRING_UNITTEST
rtl_string_unittest_const_literal = true;
#endif
@@ -237,13 +229,6 @@ public:
{
pData = 0;
rtl_uString_newFromLiteral( &pData, literal, internal::ConstCharArrayDetector< T, void >::size - 1 );
- if (pData == 0) {
-#if defined EXCEPTIONS_OFF
- SAL_WARN("sal", "std::bad_alloc but EXCEPTIONS_OFF");
-#else
- throw std::bad_alloc();
-#endif
- }
#ifdef RTL_STRING_UNITTEST
rtl_string_unittest_const_literal = true;
#endif
@@ -379,20 +364,12 @@ public:
@param literal the 8-bit ASCII string literal
- @exception std::bad_alloc is thrown if an out-of-memory condition occurs
@since LibreOffice 3.6
*/
template< typename T >
typename internal::ConstCharArrayDetector< T, OUString& >::Type operator=( T& literal )
{
rtl_uString_newFromLiteral( &pData, literal, internal::ConstCharArrayDetector< T, void >::size - 1 );
- if (pData == 0) {
-#if defined EXCEPTIONS_OFF
- SAL_WARN("sal", "std::bad_alloc but EXCEPTIONS_OFF");
-#else
- throw std::bad_alloc();
-#endif
- }
return *this;
}