diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-08-28 00:17:42 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-08-29 09:56:06 +0100 |
commit | 14d2a60053e30dcb7e6956637fe8d57d18563e3f (patch) | |
tree | a395e8185afde2031fa255094ee9b0d23f11afe9 /tools | |
parent | 65302eb1bed16db8f06cbb048d03ba6d644b3fb6 (diff) |
remove ByteString::IsAlphaNumericAscii and refactor a bit
Diffstat (limited to 'tools')
-rw-r--r-- | tools/inc/tools/string.hxx | 1 | ||||
-rw-r--r-- | tools/source/fsys/dirent.cxx | 6 | ||||
-rw-r--r-- | tools/source/inet/inetmsg.cxx | 2 | ||||
-rw-r--r-- | tools/source/string/tstring.cxx | 23 |
4 files changed, 5 insertions, 27 deletions
diff --git a/tools/inc/tools/string.hxx b/tools/inc/tools/string.hxx index fc03584c6de1..b9e66763e799 100644 --- a/tools/inc/tools/string.hxx +++ b/tools/inc/tools/string.hxx @@ -256,7 +256,6 @@ public: sal_Bool IsLowerAscii() const; sal_Bool IsUpperAscii() const; sal_Bool IsAlphaAscii() const; - sal_Bool IsAlphaNumericAscii() const; ByteString& ToLowerAscii(); ByteString& ToUpperAscii(); diff --git a/tools/source/fsys/dirent.cxx b/tools/source/fsys/dirent.cxx index 64d2319828c1..14548558e107 100644 --- a/tools/source/fsys/dirent.cxx +++ b/tools/source/fsys/dirent.cxx @@ -65,7 +65,7 @@ #include <osl/file.hxx> #include <rtl/instance.hxx> - +#include <comphelper/string.hxx> using namespace osl; @@ -333,12 +333,14 @@ ByteString ImplCutPath( const ByteString& rStr, sal_uInt16 nMax, char cAccDel ) if ( aCutPath.Len() > nMaxPathLen ) { for ( sal_uInt16 n = nMaxPathLen; n > nMaxPathLen/2; --n ) - if ( !ByteString(aCutPath.GetChar(n)).IsAlphaNumericAscii() ) + { + if (!comphelper::string::isalnumAscii(aCutPath.GetChar(n))) { aCutPath.Erase( n ); aCutPath += "..."; break; } + } } if ( bInsertPrefix ) diff --git a/tools/source/inet/inetmsg.cxx b/tools/source/inet/inetmsg.cxx index 24e564240529..11bd5dbcefd9 100644 --- a/tools/source/inet/inetmsg.cxx +++ b/tools/source/inet/inetmsg.cxx @@ -414,7 +414,7 @@ sal_Bool INetRFC822Message::ParseDateField ( } } } - else if (comphelper::string::isAsciiDecimalString(aDateField)) + else if (comphelper::string::isdigitAsciiString(aDateField)) { // Format: delta seconds. Time aDelta (0); diff --git a/tools/source/string/tstring.cxx b/tools/source/string/tstring.cxx index 833e0d4fa9c7..5b3d41de6265 100644 --- a/tools/source/string/tstring.cxx +++ b/tools/source/string/tstring.cxx @@ -152,29 +152,6 @@ sal_Bool ByteString::IsAlphaAscii() const return sal_True; } -// ----------------------------------------------------------------------- - -sal_Bool ByteString::IsAlphaNumericAscii() const -{ - DBG_CHKTHIS( ByteString, DbgCheckByteString ); - - sal_Int32 nIndex = 0; - sal_Int32 nLen = mpData->mnLen; - const sal_Char* pStr = mpData->maStr; - while ( nIndex < nLen ) - { - if ( !(((*pStr >= 97) && (*pStr <= 122)) || - ((*pStr >= 65) && (*pStr <= 90)) || - ((*pStr >= 48) && (*pStr <= 57))) ) - return sal_False; - - ++pStr, - ++nIndex; - } - - return sal_True; -} - void STRING::SearchAndReplaceAll( const STRCODE* pCharStr, const STRING& rRepStr ) { DBG_CHKTHIS( STRING, DBGCHECKSTRING ); |