diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-02-15 15:26:43 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-02-15 15:41:09 +0100 |
commit | 9ab0b38e95133dab720408cc2c80093b8a201c10 (patch) | |
tree | 416dde227ed5c4ded99292feb94f36a64c327999 /svtools | |
parent | Merge sal_textenc into sal just on Android (diff) | |
download | core-9ab0b38e95133dab720408cc2c80093b8a201c10.tar.gz core-9ab0b38e95133dab720408cc2c80093b8a201c10.zip |
Various string function clean up
Added:
* rtl::OString::matchL
* rtl::OString::endsWith
* rtl::OString::endsWithL
* rtl::OString::indexOfL
* rtl::OString::replaceFirst
* rtl::OString::replaceAll
* rtl::OString::getToken
* rtl::OUString::endsWith
* rtl::OUString::replaceFirst
* rtl::OUString::replaceFirstAsciiL
* rtl::OUString::replaceFirstAsciiLAsciiL
* rtl::OUString::replaceAll
* rtl::OUString::replaceAllAsciiL
* rtl::OUString::replaceAllAsciiLAsciiL
* rtl::OUString::getToken
plus underlying C functions where necessary
Deprecated:
* comphelper::string::remove
* comphelper::string::getToken
Removed:
* comphelper::string::searchAndReplaceAsciiL
* comphelper::string::searchAndReplaceAllAsciiWithAscii
* comphelper::string::searchAndReplaceAsciiI
* comphelper::string::replace
* comphelper::string::matchL
* comphelper::string::matchIgnoreAsciiCaseL
* comphelper::string::indexOfL
Also fixed some apparent misuses of RTL_CONSTASCII_USTRINGPARAM ->
RTL_CONSTASCII_STRINGPARAM.
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/bmpmaker/bmpcore.cxx | 10 | ||||
-rw-r--r-- | svtools/bmpmaker/bmpsum.cxx | 10 | ||||
-rw-r--r-- | svtools/source/filter/ixbm/xbmread.cxx | 5 | ||||
-rw-r--r-- | svtools/source/filter/sgvtext.cxx | 33 | ||||
-rw-r--r-- | svtools/source/misc/imap2.cxx | 8 | ||||
-rw-r--r-- | svtools/source/svhtml/parhtml.cxx | 3 |
6 files changed, 31 insertions, 38 deletions
diff --git a/svtools/bmpmaker/bmpcore.cxx b/svtools/bmpmaker/bmpcore.cxx index 2a7c709fdb34..c2c954ab7dae 100644 --- a/svtools/bmpmaker/bmpcore.cxx +++ b/svtools/bmpmaker/bmpcore.cxx @@ -364,8 +364,6 @@ void BmpCreator::Create( const String& rSRSName, rtl::OString aByteText; sal_Bool bLangDep = sal_False; - using comphelper::string::indexOfL; - do { do @@ -373,14 +371,14 @@ void BmpCreator::Create( const String& rSRSName, if (!pSRS->ReadLine(aByteText)) break; } - while ( indexOfL(aByteText, RTL_CONSTASCII_STRINGPARAM("ImageList")) == -1 ); + while ( aByteText.indexOfL(RTL_CONSTASCII_STRINGPARAM("ImageList")) == -1 ); do { if (!pSRS->ReadLine( aByteText ) ) break; } - while ( indexOfL(aByteText, RTL_CONSTASCII_STRINGPARAM("File")) == -1 ); + while ( aByteText.indexOfL(RTL_CONSTASCII_STRINGPARAM("File")) == -1 ); aText = rtl::OStringToOUString(aByteText, RTL_TEXTENCODING_ASCII_US); const String aName( aText.GetToken( 1, '"' ) ); @@ -388,7 +386,7 @@ void BmpCreator::Create( const String& rSRSName, do { if( !bLangDep && - indexOfL(aByteText, RTL_CONSTASCII_STRINGPARAM("File")) != -1 && + aByteText.indexOfL(RTL_CONSTASCII_STRINGPARAM("File")) != -1 && aByteText.indexOf('[') != -1 && aByteText.indexOf(']') != -1 ) { @@ -398,7 +396,7 @@ void BmpCreator::Create( const String& rSRSName, if (!pSRS->ReadLine(aByteText)) break; } - while (indexOfL(aByteText, RTL_CONSTASCII_STRINGPARAM("IdList")) == -1); + while (aByteText.indexOfL(RTL_CONSTASCII_STRINGPARAM("IdList")) == -1); aText = rtl::OStringToOUString(aByteText, RTL_TEXTENCODING_ASCII_US); // if image list is not language dependent, don't do anything for languages except german diff --git a/svtools/bmpmaker/bmpsum.cxx b/svtools/bmpmaker/bmpsum.cxx index c57273708503..4fdf1e515275 100644 --- a/svtools/bmpmaker/bmpsum.cxx +++ b/svtools/bmpmaker/bmpsum.cxx @@ -305,7 +305,7 @@ void BmpSum::ProcessFileList( const String& rInFileList, if( !aReadLine.isEmpty() ) aFileNameSet.insert( aReadLine ); - if( comphelper::string::indexOfL(aReadLine, RTL_CONSTASCII_STRINGPARAM("enus") ) != -1 ) + if( aReadLine.indexOfL(RTL_CONSTASCII_STRINGPARAM("enus") ) != -1 ) { static const char* aLanguages[] = { @@ -328,10 +328,10 @@ void BmpSum::ProcessFileList( const String& rInFileList, for( sal_uInt32 n = 0; n < 14; ++n ) { - rtl::OString aLangPath = comphelper::string::replace( - aReadLine, - rtl::OString(RTL_CONSTASCII_STRINGPARAM("enus")), - rtl::OString(aLanguages[n])); + rtl::OString aLangPath( + aReadLine.replaceAll( + rtl::OString(RTL_CONSTASCII_STRINGPARAM("enus")), + rtl::OString(aLanguages[n]))); DirEntry aTestFile( aLangPath ); diff --git a/svtools/source/filter/ixbm/xbmread.cxx b/svtools/source/filter/ixbm/xbmread.cxx index aae46dcc4cfe..e6fc446816c1 100644 --- a/svtools/source/filter/ixbm/xbmread.cxx +++ b/svtools/source/filter/ixbm/xbmread.cxx @@ -317,10 +317,9 @@ ReadState XBMReader::ReadXBM( Graphic& rGraphic ) { XBMFormat eFormat = XBM10; - using comphelper::string::indexOfL; - if (indexOfL(aLine, RTL_CONSTASCII_STRINGPARAM("short")) != -1) + if (aLine.indexOfL(RTL_CONSTASCII_STRINGPARAM("short")) != -1) eFormat = XBM10; - else if (indexOfL(aLine, RTL_CONSTASCII_STRINGPARAM("char")) != -1) + else if (aLine.indexOfL(RTL_CONSTASCII_STRINGPARAM("char")) != -1) eFormat = XBM11; else bStatus = sal_False; diff --git a/svtools/source/filter/sgvtext.cxx b/svtools/source/filter/sgvtext.cxx index 7a79edd472c9..1060c482ebe1 100644 --- a/svtools/source/filter/sgvtext.cxx +++ b/svtools/source/filter/sgvtext.cxx @@ -1185,26 +1185,25 @@ void SgfFontOne::ReadOne( const rtl::OString& rID, rtl::OString& Dsc ) sal_Int32 nTokenCount = comphelper::string::getTokenCount(Dsc, ' '); for (sal_Int32 nIdx = 0; nIdx < nTokenCount; ++nIdx) { - rtl::OString s = comphelper::string::getToken(Dsc, nIdx, ' '); + rtl::OString s(Dsc.getToken(nIdx, ' ')); if (!s.isEmpty()) { s = s.toAsciiUpperCase(); - using comphelper::string::matchL; - if (matchL(s, RTL_CONSTASCII_USTRINGPARAM("BOLD"))) Bold=sal_True; - else if (matchL(s, RTL_CONSTASCII_USTRINGPARAM("ITAL"))) Ital=sal_True; - else if (matchL(s, RTL_CONSTASCII_USTRINGPARAM("SERF"))) Serf=sal_True; - else if (matchL(s, RTL_CONSTASCII_USTRINGPARAM("SANS"))) Sans=sal_True; - else if (matchL(s, RTL_CONSTASCII_USTRINGPARAM("FIXD"))) Fixd=sal_True; - else if (matchL(s, RTL_CONSTASCII_USTRINGPARAM("ROMAN"))) SVFamil=FAMILY_ROMAN; - else if (matchL(s, RTL_CONSTASCII_USTRINGPARAM("SWISS"))) SVFamil=FAMILY_SWISS; - else if (matchL(s, RTL_CONSTASCII_USTRINGPARAM("MODERN"))) SVFamil=FAMILY_MODERN; - else if (matchL(s, RTL_CONSTASCII_USTRINGPARAM("SCRIPT"))) SVFamil=FAMILY_SCRIPT; - else if (matchL(s, RTL_CONSTASCII_USTRINGPARAM("DECORA"))) SVFamil=FAMILY_DECORATIVE; - else if (matchL(s, RTL_CONSTASCII_USTRINGPARAM("ANSI"))) SVChSet=RTL_TEXTENCODING_MS_1252; - else if (matchL(s, RTL_CONSTASCII_USTRINGPARAM("IBMPC"))) SVChSet=RTL_TEXTENCODING_IBM_850; - else if (matchL(s, RTL_CONSTASCII_USTRINGPARAM("MAC"))) SVChSet=RTL_TEXTENCODING_APPLE_ROMAN; - else if (matchL(s, RTL_CONSTASCII_USTRINGPARAM("SYMBOL"))) SVChSet=RTL_TEXTENCODING_SYMBOL; - else if (matchL(s, RTL_CONSTASCII_USTRINGPARAM("SYSTEM"))) SVChSet = osl_getThreadTextEncoding(); + if (s.matchL(RTL_CONSTASCII_STRINGPARAM("BOLD"))) Bold=sal_True; + else if (s.matchL(RTL_CONSTASCII_STRINGPARAM("ITAL"))) Ital=sal_True; + else if (s.matchL(RTL_CONSTASCII_STRINGPARAM("SERF"))) Serf=sal_True; + else if (s.matchL(RTL_CONSTASCII_STRINGPARAM("SANS"))) Sans=sal_True; + else if (s.matchL(RTL_CONSTASCII_STRINGPARAM("FIXD"))) Fixd=sal_True; + else if (s.matchL(RTL_CONSTASCII_STRINGPARAM("ROMAN"))) SVFamil=FAMILY_ROMAN; + else if (s.matchL(RTL_CONSTASCII_STRINGPARAM("SWISS"))) SVFamil=FAMILY_SWISS; + else if (s.matchL(RTL_CONSTASCII_STRINGPARAM("MODERN"))) SVFamil=FAMILY_MODERN; + else if (s.matchL(RTL_CONSTASCII_STRINGPARAM("SCRIPT"))) SVFamil=FAMILY_SCRIPT; + else if (s.matchL(RTL_CONSTASCII_STRINGPARAM("DECORA"))) SVFamil=FAMILY_DECORATIVE; + else if (s.matchL(RTL_CONSTASCII_STRINGPARAM("ANSI"))) SVChSet=RTL_TEXTENCODING_MS_1252; + else if (s.matchL(RTL_CONSTASCII_STRINGPARAM("IBMPC"))) SVChSet=RTL_TEXTENCODING_IBM_850; + else if (s.matchL(RTL_CONSTASCII_STRINGPARAM("MAC"))) SVChSet=RTL_TEXTENCODING_APPLE_ROMAN; + else if (s.matchL(RTL_CONSTASCII_STRINGPARAM("SYMBOL"))) SVChSet=RTL_TEXTENCODING_SYMBOL; + else if (s.matchL(RTL_CONSTASCII_STRINGPARAM("SYSTEM"))) SVChSet = osl_getThreadTextEncoding(); else if (comphelper::string::isdigitAsciiString(s) ) SVWidth=sal::static_int_cast< sal_uInt16 >(s.toInt32()); } } diff --git a/svtools/source/misc/imap2.cxx b/svtools/source/misc/imap2.cxx index 252346b48c95..60225a86d9f9 100644 --- a/svtools/source/misc/imap2.cxx +++ b/svtools/source/misc/imap2.cxx @@ -535,11 +535,9 @@ sal_uLong ImageMap::ImpDetectFormat( SvStream& rIStm ) { aStr = aStr.toAsciiLowerCase(); - using comphelper::string::indexOfL; - - if ( (indexOfL(aStr, RTL_CONSTASCII_STRINGPARAM("rect")) != -1) || - (indexOfL(aStr, RTL_CONSTASCII_USTRINGPARAM("circ")) != -1) || - (indexOfL(aStr, RTL_CONSTASCII_USTRINGPARAM("poly")) != -1) ) + if ( (aStr.indexOfL(RTL_CONSTASCII_STRINGPARAM("rect")) != -1) || + (aStr.indexOfL(RTL_CONSTASCII_USTRINGPARAM("circ")) != -1) || + (aStr.indexOfL(RTL_CONSTASCII_USTRINGPARAM("poly")) != -1) ) { if ( ( aStr.indexOf('(') != -1 ) && ( aStr.indexOf(')') != -1 ) ) diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx index 3df6ab9f3f16..781b48abee56 100644 --- a/svtools/source/svhtml/parhtml.cxx +++ b/svtools/source/svhtml/parhtml.cxx @@ -39,7 +39,6 @@ #include <tools/tenccvt.hxx> #include <tools/datetime.hxx> #include <svl/inettype.hxx> -#include <comphelper/string.hxx> #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/document/XDocumentProperties.hpp> @@ -1967,7 +1966,7 @@ bool HTMLParser::IsHTMLFormat( const sal_Char* pHeader, return true; // <HTML> somewhere in the first 80 characters of the document - nStart = comphelper::string::indexOfL(sCmp, RTL_CONSTASCII_STRINGPARAM(OOO_STRING_SVTOOLS_HTML_html)); + nStart = sCmp.indexOfL(RTL_CONSTASCII_STRINGPARAM(OOO_STRING_SVTOOLS_HTML_html)); if( nStart != -1 && nStart>0 && '<'==sCmp[nStart-1] && nStart+4 < sCmp.getLength() && '>'==sCmp[nStart+4] ) |