diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-10-17 17:01:22 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-10-18 11:11:49 +0100 |
commit | 13f383ac919acb36f54c5cf211954a8c032837b4 (patch) | |
tree | e174ecb67e28edca273b575aa9f2c88f57a33113 | |
parent | 11e7475402861ab2719cfefce35a405298946b71 (diff) |
Related: fdo#38838 remove String::GetToken
Change-Id: Ic5307816dd3f0c74f10eb8a15910a1674713bf9c
-rw-r--r-- | include/tools/string.hxx | 9 | ||||
-rw-r--r-- | tools/source/string/tustring.cxx | 47 |
2 files changed, 0 insertions, 56 deletions
diff --git a/include/tools/string.hxx b/include/tools/string.hxx index ed3f42ea80cc..16f28dbe4eaf 100644 --- a/include/tools/string.hxx +++ b/include/tools/string.hxx @@ -234,9 +234,6 @@ public: xub_StrLen Search( sal_Unicode c, xub_StrLen nIndex = 0 ) const; xub_StrLen Search( const UniString& rStr, xub_StrLen nIndex = 0 ) const; - UniString GetToken( xub_StrLen nToken, sal_Unicode cTok, sal_Int32& rIndex ) const; - UniString GetToken( xub_StrLen nToken, sal_Unicode cTok = ';' ) const; - const sal_Unicode* GetBuffer() const { return mpData->maStr; } friend sal_Bool operator == ( const UniString& rStr1, const UniString& rStr2 ) @@ -258,12 +255,6 @@ inline UniString UniString::Copy( xub_StrLen nIndex, xub_StrLen nCount ) const return UniString( *this, nIndex, nCount ); } -inline UniString UniString::GetToken( xub_StrLen nToken, sal_Unicode cTok ) const -{ - sal_Int32 nTempPos = 0; - return GetToken( nToken, cTok, nTempPos ); -} - template< typename charT, typename traits > std::basic_ostream<charT, traits> & operator <<( std::basic_ostream<charT, traits> & stream, UniString const & string) diff --git a/tools/source/string/tustring.cxx b/tools/source/string/tustring.cxx index e8395b05b193..40c99cf8363f 100644 --- a/tools/source/string/tustring.cxx +++ b/tools/source/string/tustring.cxx @@ -212,53 +212,6 @@ xub_StrLen STRING::Match( const STRING& rStr ) const return STRING_MATCH; } -STRING STRING::GetToken( xub_StrLen nToken, STRCODE cTok, sal_Int32& rIndex ) const -{ - DBG_CHKTHIS( STRING, DBGCHECKSTRING ); - - const STRCODE* pStr = mpData->maStr; - xub_StrLen nLen = (xub_StrLen)mpData->mnLen; - xub_StrLen nTok = 0; - sal_Int32 nFirstChar = rIndex; - xub_StrLen i = nFirstChar; - - // Determine token position and length - pStr += i; - while ( i < nLen ) - { - // Increase token count if match - if ( *pStr == cTok ) - { - ++nTok; - - if ( nTok == nToken ) - nFirstChar = i+1; - else - { - if ( nTok > nToken ) - break; - } - } - - ++pStr, - ++i; - } - - if ( nTok >= nToken ) - { - if ( i < nLen ) - rIndex = i+1; - else - rIndex = -1; - return Copy( nFirstChar, i-nFirstChar ); - } - else - { - rIndex = -1; - return STRING(); - } -} - STRING& STRING::Append( STRCODE c ) { DBG_CHKTHIS( STRING, DBGCHECKSTRING ); |