Related: fdo#38838 remove String::Match
Change-Id: I9db663dbcb432cbfe380e1272d6daaed3e6f4221
This commit is contained in:
parent
f1a8aefec9
commit
fdf85819c3
@ -229,8 +229,6 @@ public:
|
|||||||
sal_Bool Equals( const UniString& rStr,
|
sal_Bool Equals( const UniString& rStr,
|
||||||
xub_StrLen nIndex, xub_StrLen nLen ) const;
|
xub_StrLen nIndex, xub_StrLen nLen ) const;
|
||||||
|
|
||||||
xub_StrLen Match( const UniString& rStr ) const;
|
|
||||||
|
|
||||||
xub_StrLen Search( sal_Unicode c, xub_StrLen nIndex = 0 ) const;
|
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 UniString& rStr, xub_StrLen nIndex = 0 ) const;
|
||||||
|
|
||||||
|
@ -186,32 +186,6 @@ sal_Bool STRING::Equals( const STRING& rStr, xub_StrLen nIndex, xub_StrLen nLen
|
|||||||
return (ImplStringCompareWithoutZero( mpData->maStr+nIndex, rStr.mpData->maStr, nLen ) == 0);
|
return (ImplStringCompareWithoutZero( mpData->maStr+nIndex, rStr.mpData->maStr, nLen ) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
xub_StrLen STRING::Match( const STRING& rStr ) const
|
|
||||||
{
|
|
||||||
DBG_CHKTHIS( STRING, DBGCHECKSTRING );
|
|
||||||
DBG_CHKOBJ( &rStr, STRING, DBGCHECKSTRING );
|
|
||||||
|
|
||||||
// return if string is empty
|
|
||||||
if ( !mpData->mnLen )
|
|
||||||
return STRING_MATCH;
|
|
||||||
|
|
||||||
// Search the string for unmatching chars
|
|
||||||
const STRCODE* pStr1 = mpData->maStr;
|
|
||||||
const STRCODE* pStr2 = rStr.mpData->maStr;
|
|
||||||
xub_StrLen i = 0;
|
|
||||||
while ( i < mpData->mnLen )
|
|
||||||
{
|
|
||||||
// Abort on the first unmatching char
|
|
||||||
if ( *pStr1 != *pStr2 )
|
|
||||||
return i;
|
|
||||||
++pStr1,
|
|
||||||
++pStr2,
|
|
||||||
++i;
|
|
||||||
}
|
|
||||||
|
|
||||||
return STRING_MATCH;
|
|
||||||
}
|
|
||||||
|
|
||||||
STRING& STRING::Append( STRCODE c )
|
STRING& STRING::Append( STRCODE c )
|
||||||
{
|
{
|
||||||
DBG_CHKTHIS( STRING, DBGCHECKSTRING );
|
DBG_CHKTHIS( STRING, DBGCHECKSTRING );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user