diff options
-rw-r--r-- | tools/inc/tools/string.hxx | 5 | ||||
-rw-r--r-- | tools/source/string/strimp.cxx | 53 | ||||
-rw-r--r-- | tools/source/string/tustring.cxx | 32 | ||||
-rw-r--r-- | unusedcode.easy | 2 |
4 files changed, 32 insertions, 60 deletions
diff --git a/tools/inc/tools/string.hxx b/tools/inc/tools/string.hxx index c9258bea0117..11716ffb9c26 100644 --- a/tools/inc/tools/string.hxx +++ b/tools/inc/tools/string.hxx @@ -234,10 +234,6 @@ public: ByteString& Erase( xub_StrLen nIndex = 0, xub_StrLen nCount = STRING_LEN ); ByteString Copy( xub_StrLen nIndex = 0, xub_StrLen nCount = STRING_LEN ) const; - ByteString& EraseLeadingChars( sal_Char c = ' ' ); - ByteString& EraseTrailingChars( sal_Char c = ' ' ); - ByteString& EraseLeadingAndTrailingChars( sal_Char c = ' ' ); - ByteString& ConvertLineEnd( LineEnd eLineEnd ); ByteString& ConvertLineEnd() { return ConvertLineEnd( GetSystemLineEnd() ); } @@ -489,7 +485,6 @@ public: UniString& EraseLeadingChars( sal_Unicode c = ' ' ); UniString& EraseTrailingChars( sal_Unicode c = ' ' ); - UniString& EraseLeadingAndTrailingChars( sal_Unicode c = ' ' ); UniString& Reverse(); UniString& ConvertLineEnd( LineEnd eLineEnd ); diff --git a/tools/source/string/strimp.cxx b/tools/source/string/strimp.cxx index aad7df6dd67e..33c0572867d2 100644 --- a/tools/source/string/strimp.cxx +++ b/tools/source/string/strimp.cxx @@ -757,59 +757,6 @@ STRING& STRING::Erase( xub_StrLen nIndex, xub_StrLen nCount ) // ----------------------------------------------------------------------- -STRING& STRING::EraseLeadingChars( STRCODE c ) -{ - DBG_CHKTHIS( STRING, DBGCHECKSTRING ); - - if ( mpData->maStr[0] != c ) - return *this; - - xub_StrLen nStart = 0; - while ( mpData->maStr[nStart] == c ) - ++nStart; - - return Erase( 0, nStart ); -} - -// ----------------------------------------------------------------------- - -STRING& STRING::EraseTrailingChars( STRCODE c ) -{ - DBG_CHKTHIS( STRING, DBGCHECKSTRING ); - - sal_Int32 nEnd = mpData->mnLen; - while ( nEnd && (mpData->maStr[nEnd-1] == c) ) - nEnd--; - - if ( nEnd != mpData->mnLen ) - Erase( static_cast< xub_StrLen >(nEnd) ); - - return *this; -} - -// ----------------------------------------------------------------------- - -STRING& STRING::EraseLeadingAndTrailingChars( STRCODE c ) -{ - DBG_CHKTHIS( STRING, DBGCHECKSTRING ); - - xub_StrLen nStart = 0; - while ( mpData->maStr[nStart] == c ) - ++nStart; - if ( nStart ) - Erase( 0, nStart ); - - sal_Int32 nEnd = mpData->mnLen; - while ( nEnd && (mpData->maStr[nEnd-1] == c) ) - nEnd--; - if ( nEnd != mpData->mnLen ) - Erase( static_cast< xub_StrLen >(nEnd) ); - - return *this; -} - -// ----------------------------------------------------------------------- - STRING& STRING::ToLowerAscii() { DBG_CHKTHIS( STRING, DBGCHECKSTRING ); diff --git a/tools/source/string/tustring.cxx b/tools/source/string/tustring.cxx index 30a0fd508f49..79a7ebc3febd 100644 --- a/tools/source/string/tustring.cxx +++ b/tools/source/string/tustring.cxx @@ -576,4 +576,36 @@ STRING::STRING( STRCODE c ) mpData->maStr[0] = c; } +// ----------------------------------------------------------------------- + +STRING& STRING::EraseLeadingChars( STRCODE c ) +{ + DBG_CHKTHIS( STRING, DBGCHECKSTRING ); + + if ( mpData->maStr[0] != c ) + return *this; + + xub_StrLen nStart = 0; + while ( mpData->maStr[nStart] == c ) + ++nStart; + + return Erase( 0, nStart ); +} + +// ----------------------------------------------------------------------- + +STRING& STRING::EraseTrailingChars( STRCODE c ) +{ + DBG_CHKTHIS( STRING, DBGCHECKSTRING ); + + sal_Int32 nEnd = mpData->mnLen; + while ( nEnd && (mpData->maStr[nEnd-1] == c) ) + nEnd--; + + if ( nEnd != mpData->mnLen ) + Erase( static_cast< xub_StrLen >(nEnd) ); + + return *this; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/unusedcode.easy b/unusedcode.easy index 4eef24bd9147..3283270c1206 100644 --- a/unusedcode.easy +++ b/unusedcode.easy @@ -7,8 +7,6 @@ AtomPubSession::~AtomPubSession() BufferNode::childAt(int) const ByteString::Assign(char const*, unsigned short) ByteString::Assign(char) -ByteString::EraseLeadingChars(char) -ByteString::EraseTrailingChars(char) CIccCLUT::Interp3dTetra(float*, float const*) CIccCLUT::Iterate(IIccCLUTExec*) CIccFormulaCurveSegment::SetFunction(unsigned short, unsigned char, float*) |