diff options
author | Rüdiger Timm <rt@openoffice.org> | 2004-03-30 15:28:31 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2004-03-30 15:28:31 +0000 |
commit | acc934a7ef780260483eed5677ae2772bc72baa5 (patch) | |
tree | 638b62f3959479924f3e46fbf17836bb02b52617 /sal/inc | |
parent | e9f5782dea7d28426f1e46cb8527a676f064c8d1 (diff) |
INTEGRATION: CWS sb14 (1.18.62); FILE MERGED
2004/03/15 09:09:27 sb 1.18.62.2: #i21150# Improved documentation.
2004/03/11 14:41:31 sb 1.18.62.1: #i21150# rtl_string2UString and OUString::OUString(sal_Char const *, sal_Int32, rtl_TextEncoding, sal_uInt32) handle out-of-memory conditions.
Diffstat (limited to 'sal/inc')
-rw-r--r-- | sal/inc/rtl/ustring.hxx | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/sal/inc/rtl/ustring.hxx b/sal/inc/rtl/ustring.hxx index 6bc583ae8e41..4150a292e02c 100644 --- a/sal/inc/rtl/ustring.hxx +++ b/sal/inc/rtl/ustring.hxx @@ -2,9 +2,9 @@ * * $RCSfile: ustring.hxx,v $ * - * $Revision: 1.18 $ + * $Revision: 1.19 $ * - * last change: $Author: obo $ $Date: 2003-09-04 10:56:15 $ + * last change: $Author: rt $ $Date: 2004-03-30 16:28:31 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -77,6 +77,10 @@ #include <rtl/memory.h> #endif +#if !defined EXCEPTIONS_OFF +#include <new> +#endif + class String; namespace rtl @@ -202,13 +206,22 @@ public: sequence should be converted. @param convertFlags flags which controls the conversion. see RTL_TEXTTOUNICODE_FLAGS_... + + @exception std::bad_alloc is thrown if an out-of-memory condition occurs */ OUString( const sal_Char * value, sal_Int32 length, rtl_TextEncoding encoding, - sal_uInt32 convertFlags = OSTRING_TO_OUSTRING_CVTFLAGS ) SAL_THROW(()) + sal_uInt32 convertFlags = OSTRING_TO_OUSTRING_CVTFLAGS ) { pData = 0; rtl_string2UString( &pData, value, length, encoding, convertFlags ); +#if defined EXCEPTIONS_OFF + OSL_ASSERT(pData != NULL); +#else + if (pData == 0) { + throw std::bad_alloc(); + } +#endif } /** Convert a String (from the tools module) into an OUString. |