diff --git a/include/tools/string.hxx b/include/tools/string.hxx index 5fd64e9e6d88..543ad6fe0ac3 100644 --- a/include/tools/string.hxx +++ b/include/tools/string.hxx @@ -137,6 +137,7 @@ private: TOOLS_DLLPRIVATE sal_Bool Equals( const sal_Unicode* pCharStr, xub_StrLen nIndex, xub_StrLen nLen ) const; TOOLS_DLLPRIVATE sal_Bool EqualsIgnoreCaseAscii( const sal_Unicode* pCharStr ) const; + TOOLS_DLLPRIVATE xub_StrLen Search( const sal_Unicode* pCharStr, xub_StrLen nIndex = 0 ) const; public: UniString(); UniString( const ResId& rResId ); @@ -250,7 +251,6 @@ public: xub_StrLen Search( sal_Unicode c, xub_StrLen nIndex = 0 ) const; xub_StrLen Search( const UniString& rStr, xub_StrLen nIndex = 0 ) const; - xub_StrLen Search( const sal_Unicode* pCharStr, xub_StrLen nIndex = 0 ) const; xub_StrLen SearchAscii( const sal_Char* pAsciiStr, xub_StrLen nIndex = 0 ) const; xub_StrLen SearchBackward( sal_Unicode c, xub_StrLen nIndex = STRING_LEN ) const; diff --git a/tools/source/string/strimp.cxx b/tools/source/string/strimp.cxx index c6d882b65524..3357c22ed29d 100644 --- a/tools/source/string/strimp.cxx +++ b/tools/source/string/strimp.cxx @@ -428,48 +428,6 @@ xub_StrLen STRING::Search( const STRING& rStr, xub_StrLen nIndex ) const return STRING_NOTFOUND; } -xub_StrLen STRING::Search( const STRCODE* pCharStr, xub_StrLen nIndex ) const -{ - DBG_CHKTHIS( STRING, DBGCHECKSTRING ); - - sal_Int32 nLen = mpData->mnLen; - xub_StrLen nStrLen = ImplStringLen( pCharStr ); - - // 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* pStr = mpData->maStr; - pStr += nIndex; - - if ( nStrLen == 1 ) - { - STRCODE cSearch = *pCharStr; - while ( nIndex < nLen ) - { - if ( *pStr == cSearch ) - return nIndex; - ++pStr, - ++nIndex; - } - } - else - { - // search only within string - while ( nLen - nIndex >= nStrLen ) - { - // increase match if found - if ( ImplStringCompareWithoutZero( pStr, pCharStr, nStrLen ) == 0 ) - return nIndex; - ++pStr, - ++nIndex; - } - } - - return STRING_NOTFOUND; -} - void STRING::SearchAndReplaceAll( STRCODE c, STRCODE cRep ) { DBG_CHKTHIS( STRING, DBGCHECKSTRING ); diff --git a/unusedcode.easy b/unusedcode.easy index 800480533272..f736e9dc410b 100644 --- a/unusedcode.easy +++ b/unusedcode.easy @@ -57,7 +57,6 @@ SfxGrabBagItem::SetGrabBag(std::__debug::map