diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-10-19 14:25:58 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-10-19 19:16:30 +0100 |
commit | a6cdf1b2f638800318e0b8789bd991e04eef5cf5 (patch) | |
tree | 4c3b394ed3d9af98f86bf11c4b6787d5911b817e /tools/source | |
parent | 75e6bcba872bc1fd7b4316ff219fb6545e9f542d (diff) |
Related: fdo#38838 remove String::Search
Change-Id: I92a50bc5f7b0cddcf2066cdac50439a3d5f1708b
Diffstat (limited to 'tools/source')
-rw-r--r-- | tools/source/string/strimp.cxx | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/tools/source/string/strimp.cxx b/tools/source/string/strimp.cxx index 99a2778d2db4..a0d6ccaf67a6 100644 --- a/tools/source/string/strimp.cxx +++ b/tools/source/string/strimp.cxx @@ -244,67 +244,4 @@ STRING& STRING::Insert( const STRING& rStr, xub_StrLen nIndex ) return *this; } -xub_StrLen STRING::Search( STRCODE c, xub_StrLen nIndex ) const -{ - DBG_CHKTHIS( STRING, DBGCHECKSTRING ); - - sal_Int32 nLen = mpData->mnLen; - const STRCODE* pStr = mpData->maStr; - pStr += nIndex; - while ( nIndex < nLen ) - { - if ( *pStr == c ) - return nIndex; - ++pStr, - ++nIndex; - } - - return STRING_NOTFOUND; -} - -xub_StrLen STRING::Search( const STRING& rStr, xub_StrLen nIndex ) const -{ - DBG_CHKTHIS( STRING, DBGCHECKSTRING ); - DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING ); - - sal_Int32 nLen = mpData->mnLen; - sal_Int32 nStrLen = rStr.mpData->mnLen; - - // rStr was not found if its length is zero - // or index is larger than searched string - if ( !nStrLen || (nIndex >= nLen) ) - return STRING_NOTFOUND; - - const STRCODE* pStr1 = mpData->maStr; - pStr1 += nIndex; - - if ( nStrLen == 1 ) - { - STRCODE cSearch = rStr.mpData->maStr[0]; - while ( nIndex < nLen ) - { - if ( *pStr1 == cSearch ) - return nIndex; - ++pStr1, - ++nIndex; - } - } - else - { - const STRCODE* pStr2 = rStr.mpData->maStr; - - // search only within string - while ( nLen - nIndex >= nStrLen ) - { - // increase match if found - if ( ImplStringCompareWithoutZero( pStr1, pStr2, nStrLen ) == 0 ) - return nIndex; - ++pStr1, - ++nIndex; - } - } - - return STRING_NOTFOUND; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |