Kaydet (Commit) e5c20a78 authored tarafından Noel Grandin's avatar Noel Grandin

sal/rtl: remove SAL_THROW macro

Change-Id: I70e41f087dbe188f8fc455150480faeae2b426ed
üst b6c67082
......@@ -70,8 +70,7 @@ namespace rtl
@see rtl_bootstrap_set()
*/
static inline void set( ::rtl::OUString const & name, ::rtl::OUString const & value )
SAL_THROW(());
static inline void set( ::rtl::OUString const & name, ::rtl::OUString const & value );
/** default ctor.
*/
......@@ -116,21 +115,21 @@ namespace rtl
@param macro [inout] The macro to be expanded
*/
inline void expandMacrosFrom( ::rtl::OUString & macro ) const SAL_THROW(())
inline void expandMacrosFrom( ::rtl::OUString & macro ) const
{ rtl_bootstrap_expandMacros_from_handle( _handle, &macro.pData ); }
/** Expands a macro using default bootstrap variables.
@param macro [inout] The macro to be expanded
*/
static inline void expandMacros( ::rtl::OUString & macro ) SAL_THROW(())
static inline void expandMacros( ::rtl::OUString & macro )
{ rtl_bootstrap_expandMacros( &macro.pData ); }
/** Provides the bootstrap internal handle.
@return bootstrap handle
*/
inline rtlBootstrapHandle getHandle() const SAL_THROW(())
inline rtlBootstrapHandle getHandle() const
{ return _handle; }
/** Escapes special characters ("$" and "\").
......@@ -144,8 +143,7 @@ namespace rtl
@since UDK 3.2.9
*/
static inline ::rtl::OUString encode( ::rtl::OUString const & value )
SAL_THROW(());
static inline ::rtl::OUString encode( ::rtl::OUString const & value );
};
......@@ -170,7 +168,6 @@ namespace rtl
}
inline void Bootstrap::set( ::rtl::OUString const & name, ::rtl::OUString const & value )
SAL_THROW(())
{
rtl_bootstrap_set( name.pData, value.pData );
}
......@@ -214,7 +211,6 @@ namespace rtl
}
inline ::rtl::OUString Bootstrap::encode( ::rtl::OUString const & value )
SAL_THROW(())
{
::rtl::OUString encoded;
rtl_bootstrap_encode(value.pData, &encoded.pData);
......
......@@ -167,29 +167,29 @@ class SAL_WARN_UNUSED ByteSequence
public:
/// @cond INTERNAL
// these are here to force memory de/allocation to sal lib.
inline static void * SAL_CALL operator new ( size_t nSize ) SAL_THROW(())
inline static void * SAL_CALL operator new ( size_t nSize )
{ return ::rtl_allocateMemory( nSize ); }
inline static void SAL_CALL operator delete ( void * pMem ) SAL_THROW(())
inline static void SAL_CALL operator delete ( void * pMem )
{ ::rtl_freeMemory( pMem ); }
inline static void * SAL_CALL operator new ( size_t, void * pMem ) SAL_THROW(())
inline static void * SAL_CALL operator new ( size_t, void * pMem )
{ return pMem; }
inline static void SAL_CALL operator delete ( void *, void * ) SAL_THROW(())
inline static void SAL_CALL operator delete ( void *, void * )
{}
/// @endcond
/** Default constructor: Creates an empty sequence.
*/
inline ByteSequence() SAL_THROW(());
inline ByteSequence();
/** Copy constructor: Creates a copy of given sequence.
@param rSeq another byte sequence
*/
inline ByteSequence( const ByteSequence & rSeq ) SAL_THROW(());
inline ByteSequence( const ByteSequence & rSeq );
/** Copy constructor Creates a copy from the C-Handle.
@param pSequence another byte sequence handle
*/
inline ByteSequence( sal_Sequence *pSequence ) SAL_THROW(());
inline ByteSequence( sal_Sequence *pSequence );
/** Constructor: Creates a copy of given data bytes.
@param pElements an array of bytes
......@@ -217,23 +217,23 @@ public:
@param pSequence sequence handle to be taken over
@param noacquire dummy parameter forcing explicit BYTESEQ_NOACQUIRE
*/
inline ByteSequence( sal_Sequence *pSequence , enum __ByteSequence_NoAcquire noacquire ) SAL_THROW(());
inline ByteSequence( sal_Sequence *pSequence , enum __ByteSequence_NoAcquire noacquire );
/** Destructor: Releases sequence handle. Last handle will free memory.
*/
inline ~ByteSequence() SAL_THROW(());
inline ~ByteSequence();
/** Assignment operator: Acquires given sequence handle and releases a previously set handle.
@param rSeq another byte sequence
@return this sequence
*/
inline ByteSequence & SAL_CALL operator = ( const ByteSequence & rSeq ) SAL_THROW(());
inline ByteSequence & SAL_CALL operator = ( const ByteSequence & rSeq );
/** Gets the length of sequence.
@return length of sequence
*/
inline sal_Int32 SAL_CALL getLength() const SAL_THROW(())
inline sal_Int32 SAL_CALL getLength() const
{ return _pSequence->nElements; }
/** Gets a pointer to byte array for READING. If the sequence has a length of 0, then the
......@@ -241,7 +241,7 @@ public:
@return pointer to byte array
*/
inline const sal_Int8 * SAL_CALL getConstArray() const SAL_THROW(())
inline const sal_Int8 * SAL_CALL getConstArray() const
{ return (const sal_Int8 *)_pSequence->elements; }
/** Gets a pointer to elements array for READING AND WRITING. In general if the sequence
has a handle acquired by other sequences (reference count > 1), then a new sequence is
......@@ -272,7 +272,7 @@ public:
@param nIndex index
@return const C++ reference to byte at element of indenx nIndex
*/
inline const sal_Int8 & SAL_CALL operator [] ( sal_Int32 nIndex ) const SAL_THROW(())
inline const sal_Int8 & SAL_CALL operator [] ( sal_Int32 nIndex ) const
{ return getConstArray()[ nIndex ]; }
/** Equality operator: Compares two sequences.
......@@ -280,13 +280,13 @@ public:
@param rSeq another byte sequence (right side)
@return true if both sequences are equal, false otherwise
*/
inline bool SAL_CALL operator == ( const ByteSequence & rSeq ) const SAL_THROW(());
inline bool SAL_CALL operator == ( const ByteSequence & rSeq ) const;
/** Unequality operator: Compares two sequences.
@param rSeq another byte sequence (right side)
@return false if both sequences are equal, true otherwise
*/
inline bool SAL_CALL operator != ( const ByteSequence & rSeq ) const SAL_THROW(());
inline bool SAL_CALL operator != ( const ByteSequence & rSeq ) const;
/** Reallocates sequence to new length. If the sequence has a handle acquired by other sequences
(reference count > 1), then the remaining elements are copied to a new sequence handle to
......@@ -300,13 +300,13 @@ public:
@return UNacquired handle of the sequence
*/
inline sal_Sequence * SAL_CALL getHandle() const SAL_THROW(())
inline sal_Sequence * SAL_CALL getHandle() const
{ return _pSequence; }
/** Returns the UNnacquired C handle of the sequence (for compatibility reasons)
@return UNacquired handle of the sequence
*/
inline sal_Sequence * SAL_CALL get() const SAL_THROW(())
inline sal_Sequence * SAL_CALL get() const
{ return _pSequence; }
};
......
......@@ -29,19 +29,19 @@ namespace rtl
{
inline ByteSequence::ByteSequence() SAL_THROW(())
inline ByteSequence::ByteSequence()
: _pSequence( 0 )
{
::rtl_byte_sequence_construct( &_pSequence, 0 );
}
inline ByteSequence::ByteSequence( const ByteSequence & rSeq ) SAL_THROW(())
inline ByteSequence::ByteSequence( const ByteSequence & rSeq )
: _pSequence( 0 )
{
::rtl_byte_sequence_assign( &_pSequence, rSeq._pSequence );
}
inline ByteSequence::ByteSequence( sal_Sequence *pSequence) SAL_THROW(())
inline ByteSequence::ByteSequence( sal_Sequence *pSequence)
: _pSequence( pSequence )
{
::rtl_byte_sequence_acquire( pSequence );
......@@ -63,7 +63,7 @@ inline ByteSequence::ByteSequence( sal_Int32 len, enum __ByteSequence_NoDefault
throw ::std::bad_alloc();
}
inline ByteSequence::ByteSequence( sal_Sequence *pSequence, enum __ByteSequence_NoAcquire ) SAL_THROW(())
inline ByteSequence::ByteSequence( sal_Sequence *pSequence, enum __ByteSequence_NoAcquire )
: _pSequence( pSequence )
{
}
......@@ -76,18 +76,18 @@ inline ByteSequence::ByteSequence( sal_Int32 len )
throw ::std::bad_alloc();
}
inline ByteSequence::~ByteSequence() SAL_THROW(())
inline ByteSequence::~ByteSequence()
{
::rtl_byte_sequence_release( _pSequence );
}
inline ByteSequence & ByteSequence::operator = ( const ByteSequence & rSeq ) SAL_THROW(())
inline ByteSequence & ByteSequence::operator = ( const ByteSequence & rSeq )
{
::rtl_byte_sequence_assign( &_pSequence, rSeq._pSequence );
return *this;
}
inline bool ByteSequence::operator == ( const ByteSequence & rSeq ) const SAL_THROW(())
inline bool ByteSequence::operator == ( const ByteSequence & rSeq ) const
{
return ::rtl_byte_sequence_equals( _pSequence, rSeq._pSequence );
}
......@@ -112,7 +112,7 @@ inline sal_Int8 & ByteSequence::operator [] ( sal_Int32 nIndex )
return getArray()[ nIndex ];
}
inline bool ByteSequence::operator != ( const ByteSequence & rSeq ) const SAL_THROW(())
inline bool ByteSequence::operator != ( const ByteSequence & rSeq ) const
{
return (! operator == ( rSeq ));
}
......
......@@ -289,7 +289,7 @@ public:
@since LibreOffice 4.1
*/
bool isEmpty() const SAL_THROW(())
bool isEmpty() const
{
return pData->length == 0;
}
......@@ -923,7 +923,7 @@ public:
@internal
@since LibreOffice 4.1
*/
friend OString operator+( const OStringBuffer& str1, const OStringBuffer& str2 ) SAL_THROW(())
friend OString operator+( const OStringBuffer& str1, const OStringBuffer& str2 )
{
return OString( str1.pData ).concat( str2.pData );
}
......
This diff is collapsed.
......@@ -39,8 +39,7 @@ public:
static inline rtl::OUString encode(rtl::OUString const & rText,
sal_Bool const * pCharClass,
rtl_UriEncodeMechanism eMechanism,
rtl_TextEncoding eCharset)
SAL_THROW(());
rtl_TextEncoding eCharset);
/** A wrapper around rtl_uriEncode() from <rtl/uri.h> (see there), using
a predefined rtl_UriCharClass enumeration member.
......@@ -48,15 +47,13 @@ public:
static inline rtl::OUString encode(rtl::OUString const & rText,
rtl_UriCharClass eCharClass,
rtl_UriEncodeMechanism eMechanism,
rtl_TextEncoding eCharset)
SAL_THROW(());
rtl_TextEncoding eCharset);
/** A wrapper around rtl_uriDecode() from <rtl/uri.h> (see there).
*/
static inline rtl::OUString decode(rtl::OUString const & rText,
rtl_UriDecodeMechanism eMechanism,
rtl_TextEncoding eCharset)
SAL_THROW(());
rtl_TextEncoding eCharset);
/** A wrapper around rtl_uriConvertRelToAbs() from <rtl/uri.h> (see there).
......@@ -85,7 +82,6 @@ inline rtl::OUString Uri::encode(rtl::OUString const & rText,
sal_Bool const * pCharClass,
rtl_UriEncodeMechanism eMechanism,
rtl_TextEncoding eCharset)
SAL_THROW(())
{
rtl::OUString aResult;
rtl_uriEncode(const_cast< rtl::OUString & >(rText).pData,
......@@ -100,7 +96,6 @@ inline rtl::OUString Uri::encode(rtl::OUString const & rText,
rtl_UriCharClass eCharClass,
rtl_UriEncodeMechanism eMechanism,
rtl_TextEncoding eCharset)
SAL_THROW(())
{
rtl::OUString aResult;
rtl_uriEncode(const_cast< rtl::OUString & >(rText).pData,
......@@ -114,7 +109,6 @@ inline rtl::OUString Uri::encode(rtl::OUString const & rText,
inline rtl::OUString Uri::decode(rtl::OUString const & rText,
rtl_UriDecodeMechanism eMechanism,
rtl_TextEncoding eCharset)
SAL_THROW(())
{
rtl::OUString aResult;
rtl_uriDecode(const_cast< rtl::OUString & >(rText).pData,
......
......@@ -257,7 +257,7 @@ public:
@since LibreOffice 4.1
*/
bool isEmpty() const SAL_THROW(())
bool isEmpty() const
{
return pData->length == 0;
}
......@@ -1117,7 +1117,7 @@ public:
greater than or equal to fromIndex, or
-1 if the character does not occur.
*/
sal_Int32 indexOf( sal_Unicode ch, sal_Int32 fromIndex = 0 ) const SAL_THROW(())
sal_Int32 indexOf( sal_Unicode ch, sal_Int32 fromIndex = 0 ) const
{
sal_Int32 ret = rtl_ustr_indexOfChar_WithLength( pData->buffer+fromIndex, pData->length-fromIndex, ch );
return (ret < 0 ? ret : ret+fromIndex);
......@@ -1134,7 +1134,7 @@ public:
character sequence represented by this string, or
-1 if the character does not occur.
*/
sal_Int32 lastIndexOf( sal_Unicode ch ) const SAL_THROW(())
sal_Int32 lastIndexOf( sal_Unicode ch ) const
{
return rtl_ustr_lastIndexOfChar_WithLength( pData->buffer, pData->length, ch );
}
......@@ -1153,7 +1153,7 @@ public:
is less than fromIndex, or -1
if the character does not occur before that point.
*/
sal_Int32 lastIndexOf( sal_Unicode ch, sal_Int32 fromIndex ) const SAL_THROW(())
sal_Int32 lastIndexOf( sal_Unicode ch, sal_Int32 fromIndex ) const
{
return rtl_ustr_lastIndexOfChar_WithLength( pData->buffer, fromIndex, ch );
}
......@@ -1175,7 +1175,7 @@ public:
returned. If it does not occur as a substring starting
at fromIndex or beyond, -1 is returned.
*/
sal_Int32 indexOf( const OUString & str, sal_Int32 fromIndex = 0 ) const SAL_THROW(())
sal_Int32 indexOf( const OUString & str, sal_Int32 fromIndex = 0 ) const
{
sal_Int32 ret = rtl_ustr_indexOfStr_WithLength( pData->buffer+fromIndex, pData->length-fromIndex,
str.pData->buffer, str.pData->length );
......@@ -1189,7 +1189,7 @@ public:
@since LibreOffice 4.0
*/
template< typename T >
typename internal::ConstCharArrayDetector< T, sal_Int32 >::Type indexOf( T& literal, sal_Int32 fromIndex = 0 ) const SAL_THROW(())
typename internal::ConstCharArrayDetector< T, sal_Int32 >::Type indexOf( T& literal, sal_Int32 fromIndex = 0 ) const
{
assert( strlen( literal ) == internal::ConstCharArrayDetector< T >::size - 1 );
sal_Int32 ret = rtl_ustr_indexOfAscii_WithLength(
......@@ -1215,7 +1215,7 @@ public:
the last such substring is returned. If it does not occur as
a substring, -1 is returned.
*/
sal_Int32 lastIndexOf( const OUString & str ) const SAL_THROW(())
sal_Int32 lastIndexOf( const OUString & str ) const
{
return rtl_ustr_lastIndexOfStr_WithLength( pData->buffer, pData->length,
str.pData->buffer, str.pData->length );
......@@ -1240,7 +1240,7 @@ public:
of the first character of the last such substring is
returned. Otherwise, -1 is returned.
*/
sal_Int32 lastIndexOf( const OUString & str, sal_Int32 fromIndex ) const SAL_THROW(())
sal_Int32 lastIndexOf( const OUString & str, sal_Int32 fromIndex ) const
{
return rtl_ustr_lastIndexOfStr_WithLength( pData->buffer, fromIndex,
str.pData->buffer, str.pData->length );
......@@ -1252,7 +1252,7 @@ public:
@since LibreOffice 4.0
*/
template< typename T >
typename internal::ConstCharArrayDetector< T, sal_Int32 >::Type lastIndexOf( T& literal ) const SAL_THROW(())
typename internal::ConstCharArrayDetector< T, sal_Int32 >::Type lastIndexOf( T& literal ) const
{
assert( strlen( literal ) == internal::ConstCharArrayDetector< T >::size - 1 );
return rtl_ustr_lastIndexOfAscii_WithLength(
......@@ -1335,7 +1335,7 @@ public:
@return the specified substring.
@since LibreOffice 4.1
*/
OUStringBuffer copy( sal_Int32 beginIndex ) const SAL_THROW(())
OUStringBuffer copy( sal_Int32 beginIndex ) const
{
assert(beginIndex >= 0 && beginIndex <= getLength());
return copy( beginIndex, getLength() - beginIndex );
......@@ -1354,7 +1354,7 @@ public:
@return the specified substring.
@since LibreOffice 4.1
*/
OUStringBuffer copy( sal_Int32 beginIndex, sal_Int32 count ) const SAL_THROW(())
OUStringBuffer copy( sal_Int32 beginIndex, sal_Int32 count ) const
{
assert(beginIndex >= 0 && beginIndex <= getLength());
assert(count >= 0 && count <= getLength() - beginIndex);
......@@ -1371,7 +1371,7 @@ public:
@internal
@since LibreOffice 4.1
*/
friend OUString operator+( const OUStringBuffer& str1, const OUStringBuffer& str2 ) SAL_THROW(())
friend OUString operator+( const OUStringBuffer& str1, const OUStringBuffer& str2 )
{
return OUString( str1.pData ).concat( str2.pData );
}
......
This diff is collapsed.
......@@ -33,11 +33,11 @@ struct AllocatorTraits
typedef char const signature_type[8];
const signature_type & m_signature;
explicit AllocatorTraits (signature_type const & s) SAL_THROW(())
explicit AllocatorTraits (signature_type const & s)
: m_signature (s)
{}
std::size_t size (std::size_t n) const SAL_THROW(())
std::size_t size (std::size_t n) const
{
n = std::max(n, std::size_t(1));
#if OSL_DEBUG_LEVEL > 0
......@@ -46,7 +46,7 @@ struct AllocatorTraits
return n;
}
void* init (void * p) const SAL_THROW(())
void* init (void * p) const
{
#if OSL_DEBUG_LEVEL > 0
memcpy (p, m_signature, sizeof(signature_type));
......@@ -55,7 +55,7 @@ struct AllocatorTraits
return p;
}
void* fini (void * p) const SAL_THROW(())
void* fini (void * p) const
{
#if OSL_DEBUG_LEVEL > 0
p = static_cast<char*>(p) - sizeof(signature_type);
......@@ -72,7 +72,7 @@ struct VectorTraits : public AllocatorTraits
{
static const signature_type g_signature;
VectorTraits() SAL_THROW(())
VectorTraits()
: AllocatorTraits (g_signature)
{}
};
......@@ -81,7 +81,7 @@ struct ScalarTraits : public AllocatorTraits
{
static const signature_type g_signature;
ScalarTraits() SAL_THROW(())
ScalarTraits()
: AllocatorTraits (g_signature)
{}
};
......@@ -101,7 +101,6 @@ static void default_handler (void)
static void* allocate (
std::size_t n, AllocatorTraits const & rTraits)
SAL_THROW((std::bad_alloc))
{
n = rTraits.size (n);
for (;;)
......@@ -122,7 +121,6 @@ static void* allocate (
static void* allocate_nothrow (
std::size_t n, AllocatorTraits const & rTraits)
SAL_THROW(())
{
try
{
......@@ -135,7 +133,6 @@ static void* allocate_nothrow (
}
static void deallocate (void * p, AllocatorTraits const & rTraits)
SAL_THROW(())
{
if (p)
{
......
......@@ -122,10 +122,10 @@ struct rtl_bootstrap_NameValue
OUString sName;
OUString sValue;
inline rtl_bootstrap_NameValue() SAL_THROW( () )
inline rtl_bootstrap_NameValue()
{}
inline rtl_bootstrap_NameValue(
OUString const & name, OUString const & value ) SAL_THROW( () )
OUString const & name, OUString const & value )
: sName( name ),
sValue( value )
{}
......@@ -316,9 +316,9 @@ struct Bootstrap_Impl
explicit Bootstrap_Impl (OUString const & rIniName);
~Bootstrap_Impl();
static void * operator new (std::size_t n) SAL_THROW(())
static void * operator new (std::size_t n)
{ return rtl_allocateMemory (sal_uInt32(n)); }
static void operator delete (void * p , std::size_t) SAL_THROW(())
static void operator delete (void * p , std::size_t)
{ rtl_freeMemory (p); }
bool getValue(
......@@ -410,7 +410,7 @@ Bootstrap_Impl::~Bootstrap_Impl()
namespace {
Bootstrap_Impl * get_static_bootstrap_handle() SAL_THROW(())
Bootstrap_Impl * get_static_bootstrap_handle()
{
osl::MutexGuard guard( osl::Mutex::getGlobalMutex() );
static Bootstrap_Impl * s_handle = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment