[Libreoffice-commits] .: tools/inc tools/source unusedcode.easy
tools/inc/tools/string.hxx |7 --- tools/source/string/strimp.cxx | 86 --- tools/source/string/tstring.cxx | 13 - tools/source/string/tustring.cxx | 86 +++ unusedcode.easy |4 - 5 files changed, 87 insertions(+), 109 deletions(-) New commits: commit 67f67509ff20c0d5b6e9f3557fb1e427655601ee Author: Caolán McNamara Date: Thu Feb 23 15:57:11 2012 + lock in ByteString gains diff --git a/tools/inc/tools/string.hxx b/tools/inc/tools/string.hxx index c232c07..7fe2c10 100644 --- a/tools/inc/tools/string.hxx +++ b/tools/inc/tools/string.hxx @@ -156,6 +156,7 @@ private: voidAssign(int); // not implemented; to detect misuses of // Assign(sal_Char) ByteString& Assign( const sal_Char* pCharStr, xub_StrLen nLen ); //not implemented, to detect use of removed methods without compiler making something to fit +ByteString& Assign( const sal_Char* pCharStr ); //not implemented, to detect use of removed methods without compiler making something to fit ByteString& operator =(const sal_Char); //not implemented, to detect use of removed methods without compiler making something to fit ByteString& Assign(sal_Char); //not implemented, to detect use of removed methods without compiler making something to fit @@ -187,7 +188,6 @@ public: ByteString& Assign( const ByteString& rStr ); ByteString& Assign( const rtl::OString& rStr ); -ByteString& Assign( const sal_Char* pCharStr ); ByteString& operator =( const ByteString& rStr ) { return Assign( rStr ); } ByteString& operator =( const rtl::OString& rStr ) @@ -220,16 +220,11 @@ public: StringCompare CompareIgnoreCaseToAscii( const sal_Char* pCharStr, xub_StrLen nLen = STRING_LEN ) const; sal_BoolEquals( const sal_Char* pCharStr ) const; -sal_BoolEqualsIgnoreCaseAscii( const sal_Char* pCharStr ) const; xub_StrLen Search( sal_Char c, xub_StrLen nIndex = 0 ) const; xub_StrLen Search( const ByteString& rStr, xub_StrLen nIndex = 0 ) const; xub_StrLen Search( const sal_Char* pCharStr, xub_StrLen nIndex = 0 ) const; -xub_StrLen SearchAndReplace( const ByteString& rStr, const ByteString& rRepStr, - xub_StrLen nIndex = 0 ); -xub_StrLen SearchAndReplace( const sal_Char* pCharStr, const ByteString& rRepStr, - xub_StrLen nIndex = 0 ); voidSearchAndReplaceAll( sal_Char c, sal_Char cRep ); ByteString GetToken( xub_StrLen nToken, sal_Char cTok = ';' ) const; diff --git a/tools/source/string/strimp.cxx b/tools/source/string/strimp.cxx index 1eef75d..dd00878 100644 --- a/tools/source/string/strimp.cxx +++ b/tools/source/string/strimp.cxx @@ -60,34 +60,6 @@ static sal_Int32 ImplStringCompareWithoutZero( const STRCODE* pStr1, const STRCO return nRet; } -// --- - -static sal_Int32 ImplStringICompare( const STRCODE* pStr1, const STRCODE* pStr2 ) -{ -sal_Int32 nRet; -STRCODE c1; -STRCODE c2; -do -{ -// Ist das Zeichen zwischen 'A' und 'Z' dann umwandeln -c1 = *pStr1; -c2 = *pStr2; -if ( (c1 >= 65) && (c1 <= 90) ) -c1 += 32; -if ( (c2 >= 65) && (c2 <= 90) ) -c2 += 32; -nRet = ((sal_Int32)((STRCODEU)c1))-((sal_Int32)((STRCODEU)c2)); -if ( nRet != 0 ) -break; - -++pStr1, -++pStr2; -} -while ( c2 ); - -return nRet; -} - // === #ifdef DBG_UTIL @@ -280,39 +252,6 @@ STRING& STRING::Assign( const STRING& rStr ) // --- -STRING& STRING::Assign( const STRCODE* pCharStr ) -{ -DBG_CHKTHIS( STRING, DBGCHECKSTRING ); -DBG_ASSERT( pCharStr, "String::Assign() - pCharStr is NULL" ); - -// Stringlaenge ermitteln -xub_StrLen nLen = ImplStringLen( pCharStr ); - -if ( !nLen ) -{ -STRING_NEW((STRING_TYPE **)&mpData); -} -else -{ -// Wenn String genauso lang ist, wie der String, dann direkt kopieren -if ( (nLen == mpData->mnLen) && (mpData->mnRefCount == 1) ) -memcpy( mpData->maStr, pCharStr, nLen*sizeof( STRCODE ) ); -else -{ -// Alte Daten loeschen -STRING_RELEASE((STRING_TYPE *)mpData); - -// Daten initialisieren und String kopieren -mpData = ImplAllocData( nLen ); -memcpy( mpData->m
[Libreoffice-commits] .: tools/inc tools/source unusedcode.easy
tools/inc/tools/string.hxx | 55 tools/source/string/strimp.cxx | 513 --- tools/source/string/tstring.cxx | 50 --- tools/source/string/tustring.cxx | 513 +++ unusedcode.easy | 19 - 5 files changed, 526 insertions(+), 624 deletions(-) New commits: commit 48649cdfb8671fb49a28b33c1ba1cd71c0999a07 Author: Caolán McNamara Date: Wed Feb 15 10:05:30 2012 + lock in those ByteString gains so there's no back-sliding diff --git a/tools/inc/tools/string.hxx b/tools/inc/tools/string.hxx index b91170a..c232c07 100644 --- a/tools/inc/tools/string.hxx +++ b/tools/inc/tools/string.hxx @@ -148,26 +148,36 @@ private: sal_uInt32 nCvtFlags = UNISTRING_TO_BYTESTRING_CVTFLAGS ); //not implemented, to detect use of removed methods without compiler making something to fit ByteString( const sal_Unicode* pUniStr, xub_StrLen nLen, rtl_TextEncoding eTextEncoding, -sal_uInt32 nCvtFlags = UNISTRING_TO_BYTESTRING_CVTFLAGS ); //not implemented, to detect use of removed methods without compiler making somethiing to fit +sal_uInt32 nCvtFlags = UNISTRING_TO_BYTESTRING_CVTFLAGS ); //not implemented, to detect use of removed methods without compiler making something to fit ByteString( const UniString& rUniStr, rtl_TextEncoding eTextEncoding, -sal_uInt32 nCvtFlags = UNISTRING_TO_BYTESTRING_CVTFLAGS ); //not implemented, to detect use of removed methods without compiler making somethiing to fit +sal_uInt32 nCvtFlags = UNISTRING_TO_BYTESTRING_CVTFLAGS ); //not implemented, to detect use of removed methods without compiler making something to fit +ByteString( const sal_Char* pCharStr, xub_StrLen nLen ); //not implemented, to detect use of removed methods without compiler making something to fit voidAssign(int); // not implemented; to detect misuses of // Assign(sal_Char) +ByteString& Assign( const sal_Char* pCharStr, xub_StrLen nLen ); //not implemented, to detect use of removed methods without compiler making something to fit +ByteString& operator =(const sal_Char); //not implemented, to detect use of removed methods without compiler making something to fit + +ByteString& Assign(sal_Char); //not implemented, to detect use of removed methods without compiler making something to fit voidoperator =(int); // not implemented; to detect misuses // of operator =(sal_Char) voidAppend(int); // not implemented; to detect misuses of // Append(char) +ByteString& Append( const sal_Char* pCharStr, xub_StrLen nLen ); // not implemented, to detect use of removed methods without compiler making something to fit +ByteString& operator +=(sal_Char); //not implemented, to detect use of removed methods without compiler making something to fit +ByteString& Append( char c ); //not implemented, to detect use of removed methods without compiler making something to fit voidoperator +=(int); // not implemented; to detect misuses // of operator +=(sal_Char) +friend sal_Bool operator == ( const ByteString& rStr1, const ByteString& rStr2 ); //not implemented, to detect use of removed methods without compiler making something to fit +friend sal_Bool operator < ( const ByteString& rStr1, const ByteString& rStr2 ); //not implemented, to detect use of removed methods without compiler making something to fit +friend sal_Bool operator > ( const ByteString& rStr1, const ByteString& rStr2 ); //not implemented, to detect use of removed methods without compiler making something to fit public: ByteString(); ByteString( const ByteString& rStr ); ByteString( const ByteString& rStr, xub_StrLen nPos, xub_StrLen nLen ); ByteString( const rtl::OString& rStr ); ByteString( const sal_Char* pCharStr ); -ByteString( const sal_Char* pCharStr, xub_StrLen nLen ); ~ByteString(); operator rtl::OString () const @@ -178,27 +188,19 @@ public: ByteString& Assign( const ByteString& rStr ); ByteString& Assign( const rtl::OString& rStr ); ByteString& Assign( const sal_Char* pCharStr ); -ByteString& Assign( const sal_Char* pCharStr, xub_StrLen nLen