diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-10-20 20:12:08 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-10-21 09:17:32 +0100 |
commit | 48bb54aa7eafa85c5b0a2574fb3fa167614ddcbc (patch) | |
tree | a46b6b2f9fbed420133750e47f6004facbf9242a /tools | |
parent | Related: fdo#38838 remove String::ToInt32 (diff) | |
download | core-48bb54aa7eafa85c5b0a2574fb3fa167614ddcbc.tar.gz core-48bb54aa7eafa85c5b0a2574fb3fa167614ddcbc.zip |
Related: fdo#38838 remove String::Insert
Change-Id: I37e35b5a16d37b1fccc6aa47f5027ff406c67d98
Diffstat (limited to 'tools')
-rw-r--r-- | tools/source/string/strimp.cxx | 28 | ||||
-rw-r--r-- | tools/source/string/tustring.cxx | 26 |
2 files changed, 0 insertions, 54 deletions
diff --git a/tools/source/string/strimp.cxx b/tools/source/string/strimp.cxx index e62f5ed5d0b1..a3e44fa39ff5 100644 --- a/tools/source/string/strimp.cxx +++ b/tools/source/string/strimp.cxx @@ -167,32 +167,4 @@ STRING& STRING::Append( const STRING& rStr ) return *this; } -STRING& STRING::Insert( const STRING& rStr, xub_StrLen nIndex ) -{ - // detect overflow - sal_Int32 nCopyLen = ImplGetCopyLen( mpData->mnLen, rStr.mpData->mnLen ); - - if ( !nCopyLen ) - return *this; - - // adjust index if necessary - if ( nIndex > mpData->mnLen ) - nIndex = static_cast< xub_StrLen >(mpData->mnLen); - - // allocate string of new size - STRINGDATA* pNewData = ImplAllocData( mpData->mnLen+nCopyLen ); - - // copy string - memcpy( pNewData->maStr, mpData->maStr, nIndex*sizeof( STRCODE ) ); - memcpy( pNewData->maStr+nIndex, rStr.mpData->maStr, nCopyLen*sizeof( STRCODE ) ); - memcpy( pNewData->maStr+nIndex+nCopyLen, mpData->maStr+nIndex, - (mpData->mnLen-nIndex)*sizeof( STRCODE ) ); - - // free old string - STRING_RELEASE((STRING_TYPE *)mpData); - mpData = pNewData; - - return *this; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/tools/source/string/tustring.cxx b/tools/source/string/tustring.cxx index d386c6abbe4a..42c69477c865 100644 --- a/tools/source/string/tustring.cxx +++ b/tools/source/string/tustring.cxx @@ -47,32 +47,6 @@ DBG_NAME( UniString ) UniString::UniString(char c): mpData(ImplAllocData(1)) { mpData->maStr[0] = c; } -STRING& STRING::Insert( STRCODE c, xub_StrLen nIndex ) -{ - // Don't insert 0 char or string size is maximum - if ( !c || (mpData->mnLen == STRING_MAXLEN) ) - return *this; - - // Adjust string index - if ( nIndex > mpData->mnLen ) - nIndex = static_cast< xub_StrLen >(mpData->mnLen); - - // allocate string of new size - STRINGDATA* pNewData = ImplAllocData( mpData->mnLen+1 ); - - // copy string - memcpy( pNewData->maStr, mpData->maStr, nIndex*sizeof( STRCODE ) ); - pNewData->maStr[nIndex] = c; - memcpy( pNewData->maStr+nIndex+1, mpData->maStr+nIndex, - (mpData->mnLen-nIndex)*sizeof( STRCODE ) ); - - // free old data - STRING_RELEASE((STRING_TYPE *)mpData); - mpData = pNewData; - - return *this; -} - StringCompare STRING::CompareTo( const STRING& rStr, xub_StrLen nLen ) const { if ( mpData == rStr.mpData ) |