diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-10-20 12:06:08 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-10-20 19:00:36 +0100 |
commit | b0fd64b2fa7ae1fd8d435c64b7b69758e98e8926 (patch) | |
tree | 70ce590c008d65257b2a7ce3a0b745378767eef2 /tools/source | |
parent | 2d41f3acc359643a88bd39ef8c8d7bac106765fa (diff) |
Related: fdo#38838 remove the unused String::Insert
Change-Id: I39f4c68b76d8816fc91e4dc39bf2305142d1fb93
Diffstat (limited to 'tools/source')
-rw-r--r-- | tools/source/string/tustring.cxx | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/tools/source/string/tustring.cxx b/tools/source/string/tustring.cxx index 6fd2689fdd3d..c4604229e30c 100644 --- a/tools/source/string/tustring.cxx +++ b/tools/source/string/tustring.cxx @@ -58,49 +58,6 @@ sal_Int32 UniString::ToInt32() const return rtl_ustr_toInt32( mpData->maStr, 10 ); } -STRING& STRING::Insert( const STRING& rStr, xub_StrLen nPos, xub_StrLen nLen, - xub_StrLen nIndex ) -{ - DBG_CHKTHIS( STRING, DBGCHECKSTRING ); - DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING ); - - // Determine string length - if ( nPos > rStr.mpData->mnLen ) - nLen = 0; - else - { - // Correct length if necessary - sal_Int32 nMaxLen = rStr.mpData->mnLen-nPos; - if ( nLen > nMaxLen ) - nLen = static_cast< xub_StrLen >(nMaxLen); - } - - // Detect overflow - sal_Int32 nCopyLen = ImplGetCopyLen( mpData->mnLen, nLen ); - - if ( !nCopyLen ) - return *this; - - // Correct index if necessary - if ( nIndex > mpData->mnLen ) - nIndex = static_cast< xub_StrLen >(mpData->mnLen); - - // Determine new length and allocate string - STRINGDATA* pNewData = ImplAllocData( mpData->mnLen+nCopyLen ); - - // copy string to newdata - memcpy( pNewData->maStr, mpData->maStr, nIndex*sizeof( STRCODE ) ); - memcpy( pNewData->maStr+nIndex, rStr.mpData->maStr+nPos, nCopyLen*sizeof( STRCODE ) ); - memcpy( pNewData->maStr+nIndex+nCopyLen, mpData->maStr+nIndex, - (mpData->mnLen-nIndex)*sizeof( STRCODE ) ); - - // release old data - STRING_RELEASE((STRING_TYPE *)mpData); - mpData = pNewData; - - return *this; -} - STRING& STRING::Insert( STRCODE c, xub_StrLen nIndex ) { DBG_CHKTHIS( STRING, DBGCHECKSTRING ); |