summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-11-18 21:03:31 +0000
committerCaolán McNamara <caolanm@redhat.com>2011-11-19 21:11:02 +0000
commitca02d728082a86780d68ede7b9d565128dbc0434 (patch)
tree8c0a857ad73f89d592295f99e5f72a0c96e55e57 /svl
parente4ff699291ddab16d70aa9b11c717e34dfbe5414 (diff)
remove [Byte]String::EraseAllChars
Diffstat (limited to 'svl')
-rw-r--r--svl/source/numbers/zforfind.cxx9
-rw-r--r--svl/source/numbers/zformat.cxx18
-rw-r--r--svl/source/svdde/ddesvr.cxx4
3 files changed, 18 insertions, 13 deletions
diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx
index bb249be090a4..3fa6908b1d4f 100644
--- a/svl/source/numbers/zforfind.cxx
+++ b/svl/source/numbers/zforfind.cxx
@@ -33,6 +33,7 @@
#include <stdlib.h>
#include <float.h>
#include <errno.h>
+#include <comphelper/string.hxx>
#include <tools/date.hxx>
#include <tools/debug.hxx>
#include <rtl/math.hxx>
@@ -2073,7 +2074,7 @@ bool ImpSvNumberInputScan::ScanStringNumFor(
return false;
const ::utl::TransliterationWrapper* pTransliteration = pFormatter->GetTransliteration();
const String* pStr;
- String aString( rString );
+ rtl::OUString aString( rString );
bool bFound = false;
bool bFirst = true;
bool bContinue = true;
@@ -2100,7 +2101,7 @@ bool ImpSvNumberInputScan::ScanStringNumFor(
if ( !bFound && bFirst && nPos )
{ // try remaining substring
bFirst = false;
- aString.Erase( 0, nPos );
+ aString = aString.copy(nPos);
bContinue = true;
}
} while ( bContinue );
@@ -2110,8 +2111,8 @@ bool ImpSvNumberInputScan::ScanStringNumFor(
if ( !bDontDetectNegation && (nString == 0) && !bFirst && (nSign < 0)
&& pFormat->IsNegativeRealNegative() )
{ // simply negated twice? --1
- aString.EraseAllChars( ' ' );
- if ( (aString.Len() == 1) && (aString.GetChar(0) == '-') )
+ aString = comphelper::string::remove(aString, ' ');
+ if ( (aString.getLength() == 1) && (aString[0] == '-') )
{
bFound = true;
nStringScanSign = -1;
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index a56abdc3b0dd..c4315d3a007d 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -33,6 +33,7 @@
#include <float.h>
#include <errno.h>
#include <stdlib.h>
+#include <comphelper/string.hxx>
#include <tools/debug.hxx>
#include <osl/diagnose.h>
#include <i18npool/mslangid.hxx>
@@ -1358,7 +1359,7 @@ short SvNumberformat::ImpNextSymbol(String& rString,
case '>':
case '=':
{
- sSymbol.EraseAllChars('[');
+ sSymbol = comphelper::string::remove(sSymbol, '[');
sSymbol += cToken;
cLetter = cToken;
eState = SsGetCon;
@@ -1382,7 +1383,7 @@ short SvNumberformat::ImpNextSymbol(String& rString,
{
if ( rString.GetChar(nPos) == '-' )
{ // [$-xxx] locale
- sSymbol.EraseAllChars('[');
+ sSymbol = comphelper::string::remove(sSymbol, '[');
eSymbolType = BRACKET_SYMBOLTYPE_LOCALE;
eState = SsGetPrefix;
}
@@ -1412,7 +1413,7 @@ short SvNumberformat::ImpNextSymbol(String& rString,
sal_Unicode cDBNum = rString.GetChar( nPos-1+aDBNum.Len() );
if ( aUpperNatNum == aNatNum && 0 <= nNatNumNum && nNatNumNum <= 19 )
{
- sSymbol.EraseAllChars('[');
+ sSymbol = comphelper::string::remove(sSymbol, '[');
sSymbol += rString.Copy( --nPos, aNatNum.Len()+1 );
nPos += aNatNum.Len()+1;
//! SymbolType is negative
@@ -1421,7 +1422,7 @@ short SvNumberformat::ImpNextSymbol(String& rString,
}
else if ( aUpperDBNum == aDBNum && '1' <= cDBNum && cDBNum <= '9' )
{
- sSymbol.EraseAllChars('[');
+ sSymbol = comphelper::string::remove(sSymbol, '[');
sSymbol += rString.Copy( --nPos, aDBNum.Len()+1 );
nPos += aDBNum.Len()+1;
//! SymbolType is negative
@@ -1439,7 +1440,7 @@ short SvNumberformat::ImpNextSymbol(String& rString,
}
else
{
- sSymbol.EraseAllChars('[');
+ sSymbol = comphelper::string::remove(sSymbol, '[');
sSymbol += cToken;
eSymbolType = BRACKET_SYMBOLTYPE_COLOR;
eState = SsGetPrefix;
@@ -1479,14 +1480,14 @@ short SvNumberformat::ImpNextSymbol(String& rString,
}
else
{
- sSymbol.EraseAllChars('[');
+ sSymbol = comphelper::string::remove(sSymbol, '[');
sSymbol += cToken;
eState = SsGetPrefix;
}
}
else
{
- sSymbol.EraseAllChars('[');
+ sSymbol = comphelper::string::remove(sSymbol, '[');
sSymbol += cToken;
eSymbolType = BRACKET_SYMBOLTYPE_COLOR;
eState = SsGetPrefix;
@@ -2674,7 +2675,8 @@ bool SvNumberformat::GetOutputString(double fNumber,
}
ExpStr = sStr.Copy( nExpStart ); // part following the "E+"
sStr.Erase( nExPos );
- sStr.EraseAllChars('.'); // cut any decimal delimiter
+ // cut any decimal delimiter
+ sStr = comphelper::string::remove(sStr, '.');
if ( rInfo.nCntPre != 1 ) // rescale Exp
{
sal_Int32 nExp = ExpStr.ToInt32() * nExpSign;
diff --git a/svl/source/svdde/ddesvr.cxx b/svl/source/svdde/ddesvr.cxx
index 7e114c3d06ac..80bfb2e8be88 100644
--- a/svl/source/svdde/ddesvr.cxx
+++ b/svl/source/svdde/ddesvr.cxx
@@ -32,6 +32,7 @@
#define UNICODE
#include "ddeimp.hxx"
#include <algorithm>
+#include <comphelper/string.hxx>
#include <svl/svdde.hxx>
#include <svl/svarray.hxx>
#include <tools/debug.hxx>
@@ -133,7 +134,8 @@ HDDEDATA CALLBACK _export DdeInternal::SvrCallback(
while( STRING_NOTFOUND != n )
{
String s( sTopics.GetToken( 0, '\t', n ));
- s.EraseAllChars( '\n' ).EraseAllChars( '\r' );
+ s = comphelper::string::remove(s, '\n');
+ s = comphelper::string::remove(s, '\r');
if( !hText1 || s == reinterpret_cast<const sal_Unicode*>(chTopicBuf) )
{
DdeString aDStr( pInst->hDdeInstSvr, s );