summaryrefslogtreecommitdiff
path: root/tools/source/string/tustring.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-10-20 12:07:34 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-10-20 19:00:36 +0100
commit8bb4b18127cdc6259ecd65ec0f28d27d0513cb26 (patch)
tree3992f44ffe474da9b38094b93267692c2afb0b01 /tools/source/string/tustring.cxx
parentb0fd64b2fa7ae1fd8d435c64b7b69758e98e8926 (diff)
Related: fdo#38838 remove String::Equals
Change-Id: Ib85907c9e274ba4e4f4c9394f3d4ecf0c9374603
Diffstat (limited to 'tools/source/string/tustring.cxx')
-rw-r--r--tools/source/string/tustring.cxx30
1 files changed, 4 insertions, 26 deletions
diff --git a/tools/source/string/tustring.cxx b/tools/source/string/tustring.cxx
index c4604229e30c..3d174a4b3e56 100644
--- a/tools/source/string/tustring.cxx
+++ b/tools/source/string/tustring.cxx
@@ -110,37 +110,15 @@ StringCompare STRING::CompareTo( const STRING& rStr, xub_StrLen nLen ) const
return COMPARE_GREATER;
}
-sal_Bool STRING::Equals( const STRING& rStr ) const
+sal_Bool operator==(const UniString& rStr1, const UniString& rStr2)
{
- DBG_CHKTHIS( STRING, DBGCHECKSTRING );
- DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING );
-
- if ( mpData == rStr.mpData )
+ if ( rStr1.mpData == rStr2.mpData )
return sal_True;
- if ( mpData->mnLen != rStr.mpData->mnLen )
+ if ( rStr1.mpData->mnLen != rStr2.mpData->mnLen )
return sal_False;
- return (ImplStringCompareWithoutZero( mpData->maStr, rStr.mpData->maStr, mpData->mnLen ) == 0);
-}
-
-sal_Bool STRING::Equals( const STRING& rStr, xub_StrLen nIndex, xub_StrLen nLen ) const
-{
- DBG_CHKTHIS( STRING, DBGCHECKSTRING );
- DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING );
-
- // Are there enough codes for comparing?
- if ( nIndex > mpData->mnLen )
- return (rStr.mpData->mnLen == 0);
- sal_Int32 nMaxLen = mpData->mnLen-nIndex;
- if ( nMaxLen < nLen )
- {
- if ( rStr.mpData->mnLen != nMaxLen )
- return sal_False;
- nLen = static_cast< xub_StrLen >(nMaxLen);
- }
-
- return (ImplStringCompareWithoutZero( mpData->maStr+nIndex, rStr.mpData->maStr, nLen ) == 0);
+ return (ImplStringCompareWithoutZero( rStr1.mpData->maStr, rStr2.mpData->maStr, rStr1.mpData->mnLen ) == 0);
}
STRING& STRING::Append( STRCODE c )