diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-10-20 20:03:17 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-10-21 09:17:31 +0100 |
commit | 60ff30a2ab0cb219a1dc46e599ad01416bb8d7fa (patch) | |
tree | d21ddcca1f43644b5b0d222a48a4c4763eeb696f /tools | |
parent | String::GetBuffer()->OUString::getStr() (diff) | |
download | core-60ff30a2ab0cb219a1dc46e599ad01416bb8d7fa.tar.gz core-60ff30a2ab0cb219a1dc46e599ad01416bb8d7fa.zip |
drop DBGCHECKSTRING
Change-Id: I0c60becfd3a61cffb46c76e6f1488528c59b46e9
Diffstat (limited to 'tools')
-rw-r--r-- | tools/inc/impstrg.hxx | 4 | ||||
-rw-r--r-- | tools/source/string/strimp.cxx | 29 | ||||
-rw-r--r-- | tools/source/string/strucvt.cxx | 8 | ||||
-rw-r--r-- | tools/source/string/tustring.cxx | 13 |
4 files changed, 0 insertions, 54 deletions
diff --git a/tools/inc/impstrg.hxx b/tools/inc/impstrg.hxx index b7fc086434dc..5c6748861694 100644 --- a/tools/inc/impstrg.hxx +++ b/tools/inc/impstrg.hxx @@ -21,10 +21,6 @@ #include <tools/tools.h> -// Debug methode for Strings - -const char* DbgCheckUniString( const void* pString ); - // Helper functions for Strings xub_StrLen ImplStringLen( const sal_Char* pStr ); diff --git a/tools/source/string/strimp.cxx b/tools/source/string/strimp.cxx index 34f782efea0b..335c6aed2e26 100644 --- a/tools/source/string/strimp.cxx +++ b/tools/source/string/strimp.cxx @@ -32,18 +32,6 @@ static sal_Int32 ImplStringCompareWithoutZero( const STRCODE* pStr1, const STRCO return nRet; } -#ifdef DBG_UTIL -const char* DBGCHECKSTRING( const void* pString ) -{ - STRING* p = (STRING*)pString; - - if ( p->GetBuffer()[p->Len()] != 0 ) - return "String damaged: aStr[nLen] != 0"; - - return NULL; -} -#endif - static STRINGDATA* ImplAllocData( sal_Int32 nLen ) { STRINGDATA* pData = (STRINGDATA*)rtl_allocateMemory( sizeof(STRINGDATA)+(nLen*sizeof( STRCODE )) ); @@ -96,16 +84,11 @@ inline sal_Int32 ImplGetCopyLen( sal_Int32 nStrLen, sal_Int32 nCopyLen ) STRING::STRING() : mpData(NULL) { - DBG_CTOR( STRING, DBGCHECKSTRING ); - STRING_NEW((STRING_TYPE **)&mpData); } STRING::STRING( const STRING& rStr ) { - DBG_CTOR( STRING, DBGCHECKSTRING ); - DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING ); - // Set pointer to argument string and increase reference counter STRING_ACQUIRE((STRING_TYPE *)rStr.mpData); mpData = rStr.mpData; @@ -114,9 +97,6 @@ STRING::STRING( const STRING& rStr ) STRING::STRING( const STRING& rStr, xub_StrLen nPos, xub_StrLen nLen ) : mpData( NULL ) { - DBG_CTOR( STRING, DBGCHECKSTRING ); - DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING ); - if ( nPos > rStr.mpData->mnLen ) nLen = 0; else @@ -150,17 +130,12 @@ STRING::STRING( const STRING& rStr, xub_StrLen nPos, xub_StrLen nLen ) STRING::~STRING() { - DBG_DTOR( STRING, DBGCHECKSTRING ); - // free string data STRING_RELEASE((STRING_TYPE *)mpData); } STRING& STRING::Append( const STRING& rStr ) { - DBG_CHKTHIS( STRING, DBGCHECKSTRING ); - DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING ); - // Assignment is sufficient if string is empty sal_Int32 nLen = mpData->mnLen; if ( !nLen ) @@ -194,7 +169,6 @@ STRING& STRING::Append( const STRING& rStr ) void STRING::SetChar( xub_StrLen nIndex, STRCODE c ) { - DBG_CHKTHIS( STRING, DBGCHECKSTRING ); DBG_ASSERT( nIndex < mpData->mnLen, "String::SetChar() - nIndex > String.Len()" ); // copy data if necessary @@ -204,9 +178,6 @@ void STRING::SetChar( xub_StrLen nIndex, STRCODE c ) STRING& STRING::Insert( const STRING& rStr, xub_StrLen nIndex ) { - DBG_CHKTHIS( STRING, DBGCHECKSTRING ); - DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING ); - // detect overflow sal_Int32 nCopyLen = ImplGetCopyLen( mpData->mnLen, rStr.mpData->mnLen ); diff --git a/tools/source/string/strucvt.cxx b/tools/source/string/strucvt.cxx index 29041ddc0e41..f85d7d6c6f65 100644 --- a/tools/source/string/strucvt.cxx +++ b/tools/source/string/strucvt.cxx @@ -20,7 +20,6 @@ UniString::UniString( const char* pByteStr, rtl_TextEncoding eTextEncoding, sal_uInt32 nCvtFlags ) { - DBG_CTOR( UniString, DbgCheckUniString ); DBG_ASSERT( pByteStr, "UniString::UniString() - pByteStr is NULL" ); mpData = NULL; @@ -32,7 +31,6 @@ UniString::UniString( const char* pByteStr, UniString::UniString( const char* pByteStr, xub_StrLen nLen, rtl_TextEncoding eTextEncoding, sal_uInt32 nCvtFlags ) { - DBG_CTOR( UniString, DbgCheckUniString ); DBG_ASSERT( pByteStr, "UniString::UniString() - pByteStr is NULL" ); if ( nLen == STRING_LEN ) @@ -47,8 +45,6 @@ UniString::UniString( const char* pByteStr, xub_StrLen nLen, UniString::UniString( const OUString& rStr ) : mpData(NULL) { - DBG_CTOR( UniString, DbgCheckUniString ); - OSL_ENSURE(rStr.pData->length < STRING_MAXLEN, "Overflowing OUString -> UniString cut to zero length"); @@ -66,8 +62,6 @@ UniString::UniString( const OUString& rStr ) UniString& UniString::Assign( const OUString& rStr ) { - DBG_CHKTHIS( UniString, DbgCheckUniString ); - OSL_ENSURE(rStr.pData->length < STRING_MAXLEN, "Overflowing OUString -> UniString cut to zero length"); @@ -95,8 +89,6 @@ UniString::UniString( const ResId& rResId ) { OUString sStr(rResId.toString()); - DBG_CTOR( UniString, DbgCheckUniString ); - OSL_ENSURE(sStr.pData->length < STRING_MAXLEN, "Overflowing OUString -> UniString cut to zero length"); diff --git a/tools/source/string/tustring.cxx b/tools/source/string/tustring.cxx index e3dc5b680b67..1476dff0a03f 100644 --- a/tools/source/string/tustring.cxx +++ b/tools/source/string/tustring.cxx @@ -42,10 +42,6 @@ DBG_NAME( UniString ) #define STRING_RELEASE rtl_uString_release #define STRING_NEW rtl_uString_new -#if defined DBG_UTIL -#define DBGCHECKSTRING DbgCheckUniString -#endif - #include <strimp.cxx> #include <strucvt.cxx> @@ -53,15 +49,11 @@ UniString::UniString(char c): mpData(ImplAllocData(1)) { mpData->maStr[0] = c; } sal_Int32 UniString::ToInt32() const { - DBG_CHKTHIS( UniString, DbgCheckUniString ); - return rtl_ustr_toInt32( mpData->maStr, 10 ); } STRING& STRING::Insert( STRCODE c, xub_StrLen nIndex ) { - DBG_CHKTHIS( STRING, DBGCHECKSTRING ); - // Don't insert 0 char or string size is maximum if ( !c || (mpData->mnLen == STRING_MAXLEN) ) return *this; @@ -88,9 +80,6 @@ STRING& STRING::Insert( STRCODE c, xub_StrLen nIndex ) StringCompare STRING::CompareTo( const STRING& rStr, xub_StrLen nLen ) const { - DBG_CHKTHIS( STRING, DBGCHECKSTRING ); - DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING ); - if ( mpData == rStr.mpData ) return COMPARE_EQUAL; @@ -123,8 +112,6 @@ sal_Bool operator==(const UniString& rStr1, const UniString& rStr2) STRING& STRING::Append( STRCODE c ) { - DBG_CHKTHIS( STRING, DBGCHECKSTRING ); - // don't append null characters and keep string length < maxlen sal_Int32 nLen = mpData->mnLen; if ( c && (nLen < STRING_MAXLEN) ) |