drop DBGCHECKSTRING
Change-Id: I0c60becfd3a61cffb46c76e6f1488528c59b46e9
This commit is contained in:
parent
5ce6e535bb
commit
60ff30a2ab
4 changed files with 0 additions and 54 deletions
|
@ -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 );
|
||||
|
|
|
@ -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 );
|
||||
|
||||
|
|
|
@ -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");
|
||||
|
||||
|
|
|
@ -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) )
|
||||
|
|
Loading…
Reference in a new issue