diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-10-16 08:54:51 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-10-16 11:59:48 +0100 |
commit | 255cfbbeaa090fd7a06130e2b621cb27ae9baca4 (patch) | |
tree | f3600726a5d25b9743f77df1728082f528224fcc /tools | |
parent | Straighten the removeFragment code again (diff) | |
download | core-255cfbbeaa090fd7a06130e2b621cb27ae9baca4.tar.gz core-255cfbbeaa090fd7a06130e2b621cb27ae9baca4.zip |
Related: fdo#38838 remove unused String::Append varients
Change-Id: I158c171d39756d1949427b3a45d685a194d9fb63
Diffstat (limited to 'tools')
-rw-r--r-- | tools/source/string/strimp.cxx | 29 | ||||
-rw-r--r-- | tools/source/string/tustring.cxx | 42 |
2 files changed, 0 insertions, 71 deletions
diff --git a/tools/source/string/strimp.cxx b/tools/source/string/strimp.cxx index b86564a88e5b..6b0c40129d4e 100644 --- a/tools/source/string/strimp.cxx +++ b/tools/source/string/strimp.cxx @@ -203,35 +203,6 @@ STRING& STRING::Append( const STRING& rStr ) return *this; } -STRING& STRING::Append( const STRCODE* pCharStr ) -{ - DBG_CHKTHIS( STRING, DBGCHECKSTRING ); - DBG_ASSERT( pCharStr, "String::Append() - pCharStr is NULL" ); - - // determine string length - sal_Int32 nLen = mpData->mnLen; - sal_Int32 nCopyLen = ImplStringLen( pCharStr ); - - // detect overflow - nCopyLen = ImplGetCopyLen( nLen, nCopyLen ); - - if ( nCopyLen ) - { - // allocate string of new size - STRINGDATA* pNewData = ImplAllocData( nLen+nCopyLen ); - - // copy string - memcpy( pNewData->maStr, mpData->maStr, nLen*sizeof( STRCODE ) ); - memcpy( pNewData->maStr+nLen, pCharStr, nCopyLen*sizeof( STRCODE ) ); - - // free old string - STRING_RELEASE((STRING_TYPE *)mpData); - mpData = pNewData; - } - - return *this; -} - void STRING::SetChar( xub_StrLen nIndex, STRCODE c ) { DBG_CHKTHIS( STRING, DBGCHECKSTRING ); diff --git a/tools/source/string/tustring.cxx b/tools/source/string/tustring.cxx index c339941b2a3d..69af7a1f9e05 100644 --- a/tools/source/string/tustring.cxx +++ b/tools/source/string/tustring.cxx @@ -282,48 +282,6 @@ STRING STRING::GetToken( xub_StrLen nToken, STRCODE cTok, sal_Int32& rIndex ) co } } -STRING& STRING::Append( const STRCODE* pCharStr, xub_StrLen nCharLen ) -{ - DBG_CHKTHIS( STRING, DBGCHECKSTRING ); - DBG_ASSERT( pCharStr, "String::Append() - pCharStr is NULL" ); - - if ( nCharLen == STRING_LEN ) - nCharLen = ImplStringLen( pCharStr ); - -#ifdef DBG_UTIL - if ( DbgIsAssert() ) - { - for ( xub_StrLen i = 0; i < nCharLen; i++ ) - { - if ( !pCharStr[i] ) - { - OSL_FAIL( "String::Append() : nLen is wrong" ); - } - } - } -#endif - - // Catch overflow - sal_Int32 nLen = mpData->mnLen; - sal_Int32 nCopyLen = ImplGetCopyLen( nLen, nCharLen ); - - if ( nCopyLen ) - { - // allocate string of new size - STRINGDATA* pNewData = ImplAllocData( nLen+nCopyLen ); - - // copy string - memcpy( pNewData->maStr, mpData->maStr, nLen*sizeof( STRCODE ) ); - memcpy( pNewData->maStr+nLen, pCharStr, nCopyLen*sizeof( STRCODE ) ); - - // free old string - STRING_RELEASE((STRING_TYPE *)mpData); - mpData = pNewData; - } - - return *this; -} - STRING& STRING::Append( STRCODE c ) { DBG_CHKTHIS( STRING, DBGCHECKSTRING ); |