diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-11-22 23:40:24 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-11-23 10:10:09 +0000 |
commit | b7ea36101497c275cb08b0e37facbde656197d9b (patch) | |
tree | a05e25d4f01c94c69712d17a1ab4cdbc925ef355 /svtools | |
parent | 62d880f3228c7f5c3f8a1d30f5a5c9ed390a1eb5 (diff) |
add stripStart, can replace EraseTrailingChars
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/contnr/fileview.cxx | 3 | ||||
-rw-r--r-- | svtools/source/control/fmtfield.cxx | 9 | ||||
-rw-r--r-- | svtools/source/control/inettbc.cxx | 5 | ||||
-rw-r--r-- | svtools/source/misc/imap2.cxx | 10 | ||||
-rw-r--r-- | svtools/source/svhtml/htmlsupp.cxx | 6 |
5 files changed, 18 insertions, 15 deletions
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx index 6e7370ba06ae..c579e14601b8 100644 --- a/svtools/source/contnr/fileview.cxx +++ b/svtools/source/contnr/fileview.cxx @@ -63,6 +63,7 @@ #include <tools/urlobj.hxx> #include <tools/datetime.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/string.hxx> #include <unotools/localfilehelper.hxx> #include <ucbhelper/content.hxx> #include <ucbhelper/commandenvironment.hxx> @@ -1686,7 +1687,7 @@ String SvtFileView::GetConfigString() const sRet += ';'; } - sRet.EraseTrailingChars( ';' ); + sRet = comphelper::string::stripEnd(sRet, ';'); return sRet; } diff --git a/svtools/source/control/fmtfield.cxx b/svtools/source/control/fmtfield.cxx index 188ef360f829..6e602e2bee42 100644 --- a/svtools/source/control/fmtfield.cxx +++ b/svtools/source/control/fmtfield.cxx @@ -32,6 +32,7 @@ #include <stdio.h> #include <tools/debug.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/string.hxx> #include <unotools/localedatawrapper.hxx> #include <vcl/svapp.hxx> #include <svl/zformat.hxx> @@ -1348,8 +1349,8 @@ void DoubleCurrencyField::UpdateCurrencyFormat() if (getPrependCurrSym()) { XubString sSymbol = getCurrencySymbol(); - sSymbol.EraseLeadingChars(' '); - sSymbol.EraseTrailingChars(' '); + sSymbol = comphelper::string::stripStart(sSymbol, ' '); + sSymbol = comphelper::string::stripEnd(sSymbol, ' '); XubString sTemp = String::CreateFromAscii("[$"); sTemp += sSymbol; @@ -1370,8 +1371,8 @@ void DoubleCurrencyField::UpdateCurrencyFormat() else { XubString sTemp = getCurrencySymbol(); - sTemp.EraseLeadingChars(' '); - sTemp.EraseTrailingChars(' '); + sTemp = comphelper::string::stripStart(sTemp, ' '); + sTemp = comphelper::string::stripEnd(sTemp, ' '); sNewFormat += String::CreateFromAscii(" [$"); sNewFormat += sTemp; diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx index 097a8ada8658..6b99f8f54f69 100644 --- a/svtools/source/control/inettbc.cxx +++ b/svtools/source/control/inettbc.cxx @@ -48,6 +48,7 @@ #include <com/sun/star/ucb/XContentAccess.hpp> #include <com/sun/star/ucb/XSortedDynamicResultSetFactory.hpp> #include <comphelper/processfactory.hxx> +#include <comphelper/string.hxx> #include <vcl/toolbox.hxx> #include <osl/thread.hxx> #include <osl/mutex.hxx> @@ -1162,7 +1163,7 @@ String SvtURLBox::GetURL() #ifdef WNT // erase trailing spaces on Windows since thay are invalid on this OS and // most of the time they are inserted by accident via copy / paste - aText.EraseTrailingChars(); + aText = comphelper::string::stripEnd(aText, ' '); if ( !aText.Len() ) return aText; // #i9739# @@ -1327,7 +1328,7 @@ sal_Bool SvtURLBox_Impl::TildeParsing( else { // "blabla/" path should be converted to "blabla" - aParseTilde.EraseTrailingChars( '/' ); + aParseTilde = comphelper::string::stripEnd(aParseTilde, '/'); } } else diff --git a/svtools/source/misc/imap2.cxx b/svtools/source/misc/imap2.cxx index 1d3b7ab9f1ab..5f73c5cb00cd 100644 --- a/svtools/source/misc/imap2.cxx +++ b/svtools/source/misc/imap2.cxx @@ -382,12 +382,12 @@ long ImageMap::ImpReadCERNRadius( const char** ppStr ) String ImageMap::ImpReadCERNURL( const char** ppStr, const String& rBaseURL ) { - String aStr( String::CreateFromAscii( *ppStr ) ); + rtl::OUString aStr(rtl::OUString::createFromAscii(*ppStr)); - aStr.EraseLeadingChars( ' ' ); - aStr.EraseLeadingChars( '\t' ); - aStr.EraseTrailingChars( ' ' ); - aStr.EraseTrailingChars( '\t' ); + aStr = comphelper::string::stripStart(aStr, ' '); + aStr = comphelper::string::stripStart(aStr, '\t'); + aStr = comphelper::string::stripEnd(aStr, ' '); + aStr = comphelper::string::stripEnd(aStr, '\t'); return INetURLObject::GetAbsURL( rBaseURL, aStr ); } diff --git a/svtools/source/svhtml/htmlsupp.cxx b/svtools/source/svhtml/htmlsupp.cxx index 96cb4f154012..292d36f6a14f 100644 --- a/svtools/source/svhtml/htmlsupp.cxx +++ b/svtools/source/svhtml/htmlsupp.cxx @@ -31,11 +31,11 @@ #include <ctype.h> #include <stdio.h> -#include <tools/urlobj.hxx> - +#include <comphelper/string.hxx> #include <svtools/parhtml.hxx> #include <svtools/htmltokn.h> #include <svtools/htmlkywd.hxx> +#include <tools/urlobj.hxx> // Table for converting option values into strings static HTMLOptionEnum const aScriptLangOptEnums[] = @@ -135,7 +135,7 @@ void HTMLParser::RemoveSGMLComment( String &rString, sal_Bool bFull ) if( bFull ) { // "//" or "'", maybe preceding CR/LF - rString.EraseTrailingChars(); + rString = comphelper::string::stripEnd(rString, ' '); xub_StrLen nDel = 0, nLen = rString.Len(); if( nLen >= 2 && rString.Copy(nLen-2).CompareToAscii("//") == COMPARE_EQUAL ) |