summaryrefslogtreecommitdiff
path: root/sal/inc/rtl/string.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'sal/inc/rtl/string.hxx')
-rw-r--r--sal/inc/rtl/string.hxx19
1 files changed, 10 insertions, 9 deletions
diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx
index ee4101188013..007129a7dc0f 100644
--- a/sal/inc/rtl/string.hxx
+++ b/sal/inc/rtl/string.hxx
@@ -29,12 +29,15 @@
#ifndef _RTL_STRING_HXX_
#define _RTL_STRING_HXX_
-#ifdef __cplusplus
+#include "sal/config.h"
+
+#include <cassert>
#include <osl/diagnose.h>
#include <rtl/memory.h>
#include <rtl/textenc.h>
#include <rtl/string.h>
+#include "sal/log.h"
#if !defined EXCEPTIONS_OFF
#include <new>
@@ -183,13 +186,13 @@ public:
{
pData = 0;
rtl_uString2String( &pData, value, length, encoding, convertFlags );
+ if (pData == 0) {
#if defined EXCEPTIONS_OFF
- OSL_ASSERT(pData != NULL);
+ SAL_WARN("sal", "std::bad_alloc but EXCEPTIONS_OFF");
#else
- if (pData == 0) {
throw std::bad_alloc();
- }
#endif
+ }
}
/**
@@ -655,7 +658,7 @@ public:
*/
OString copy( sal_Int32 beginIndex ) const SAL_THROW(())
{
- OSL_ASSERT(beginIndex >= 0 && beginIndex <= getLength());
+ assert(beginIndex >= 0 && beginIndex <= getLength());
if ( beginIndex == 0 )
return *this;
else
@@ -679,8 +682,8 @@ public:
*/
OString copy( sal_Int32 beginIndex, sal_Int32 count ) const SAL_THROW(())
{
- OSL_ASSERT(beginIndex >= 0 && beginIndex <= getLength()
- && count >= 0 && count <= getLength() - beginIndex);
+ assert(beginIndex >= 0 && beginIndex <= getLength()
+ && count >= 0 && count <= getLength() - beginIndex);
if ( (beginIndex == 0) && (count == getLength()) )
return *this;
else
@@ -1034,8 +1037,6 @@ struct OStringHash
} /* Namespace */
-#endif /* __cplusplus */
-
#endif /* _RTL_STRING_HXX_ */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */