summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-10-19 14:25:58 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-10-19 19:16:30 +0100
commita6cdf1b2f638800318e0b8789bd991e04eef5cf5 (patch)
tree4c3b394ed3d9af98f86bf11c4b6787d5911b817e
parent75e6bcba872bc1fd7b4316ff219fb6545e9f542d (diff)
Related: fdo#38838 remove String::Search
Change-Id: I92a50bc5f7b0cddcf2066cdac50439a3d5f1708b
-rw-r--r--include/tools/string.hxx4
-rw-r--r--tools/source/string/strimp.cxx63
2 files changed, 0 insertions, 67 deletions
diff --git a/include/tools/string.hxx b/include/tools/string.hxx
index 6c738827c494..d2e5088c9f92 100644
--- a/include/tools/string.hxx
+++ b/include/tools/string.hxx
@@ -141,7 +141,6 @@ private:
TOOLS_DLLPRIVATE UniString& Expand( xub_StrLen nCount, sal_Unicode cExpandChar );
TOOLS_DLLPRIVATE sal_Bool Equals( const sal_Unicode* pCharStr,
xub_StrLen nIndex, xub_StrLen nLen ) const;
- TOOLS_DLLPRIVATE xub_StrLen Search( const sal_Unicode* pCharStr, xub_StrLen nIndex = 0 ) const;
TOOLS_DLLPRIVATE UniString& operator +=( const sal_Unicode* pCharStr );
@@ -227,9 +226,6 @@ public:
sal_Bool Equals( const UniString& rStr,
xub_StrLen nIndex, xub_StrLen nLen ) const;
- xub_StrLen Search( sal_Unicode c, xub_StrLen nIndex = 0 ) const;
- xub_StrLen Search( const UniString& rStr, xub_StrLen nIndex = 0 ) const;
-
const sal_Unicode* GetBuffer() const { return mpData->maStr; }
friend sal_Bool operator == ( const UniString& rStr1, const UniString& rStr2 )
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: */