summaryrefslogtreecommitdiff
path: root/sw/source/filter
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 /sw/source/filter
parente4ff699291ddab16d70aa9b11c717e34dfbe5414 (diff)
remove [Byte]String::EraseAllChars
Diffstat (limited to 'sw/source/filter')
-rw-r--r--sw/source/filter/ascii/ascatr.cxx3
-rw-r--r--sw/source/filter/html/htmlfly.cxx6
-rw-r--r--sw/source/filter/html/htmlform.cxx5
-rw-r--r--sw/source/filter/html/htmlgrin.cxx4
-rw-r--r--sw/source/filter/html/swhtml.cxx17
-rw-r--r--sw/source/filter/html/wrthtml.cxx4
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx6
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx4
-rw-r--r--sw/source/filter/ww8/ww8graf.cxx7
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx6
-rw-r--r--sw/source/filter/ww8/ww8scan.cxx3
11 files changed, 39 insertions, 26 deletions
diff --git a/sw/source/filter/ascii/ascatr.cxx b/sw/source/filter/ascii/ascatr.cxx
index 9142689b1c87..35d5ea18f65d 100644
--- a/sw/source/filter/ascii/ascatr.cxx
+++ b/sw/source/filter/ascii/ascatr.cxx
@@ -30,6 +30,7 @@
#include "precompiled_sw.hxx"
#include <hintids.hxx>
#include <tools/stream.hxx>
+#include <comphelper/string.hxx>
#ifndef _SVSTDARR_HXX
#define _SVSTDARR_USHORTS
#include <svl/svstdarr.hxx>
@@ -197,7 +198,7 @@ static Writer& OutASC_SwTxtNode( Writer& rWrt, SwCntntNode& rNode )
{
String aOutStr( aStr.Copy( nStrPos, nNextAttr - nStrPos ) );
if ( !bExportSoftHyphens )
- aOutStr.EraseAllChars( CHAR_SOFTHYPHEN );
+ aOutStr = comphelper::string::remove(aOutStr, CHAR_SOFTHYPHEN);
rWrt.Strm().WriteUnicodeOrByteText( aOutStr );
}
diff --git a/sw/source/filter/html/htmlfly.cxx b/sw/source/filter/html/htmlfly.cxx
index b07e98f6d343..0830c1f8fd0f 100644
--- a/sw/source/filter/html/htmlfly.cxx
+++ b/sw/source/filter/html/htmlfly.cxx
@@ -32,6 +32,7 @@
#include <com/sun/star/text/HoriOrientation.hpp>
#include <com/sun/star/text/VertOrientation.hpp>
#include <com/sun/star/text/RelOrientation.hpp>
+#include <comphelper/string.hxx>
#include <svx/svxids.hrc>
#include "hintids.hxx"
#include <tools/string.hxx>
@@ -1803,8 +1804,9 @@ void SwHTMLWriter::AddLinkTarget( const String& rURL )
String aURL( rURL.Copy( 1 ) );
- String sCmp( aURL.Copy( bEncoded ? nPos+2 : nPos ) ); // nPos-1+1/3 (-1 wg. Erase)
- sCmp.EraseAllChars();
+ // nPos-1+1/3 (-1 wg. Erase)
+ String sCmp(comphelper::string::remove(aURL.Copy(bEncoded ? nPos+2 : nPos),
+ ' '));
if( !sCmp.Len() )
return;
diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx
index 7fc91799d7a5..7f234e8fd577 100644
--- a/sw/source/filter/html/htmlform.cxx
+++ b/sw/source/filter/html/htmlform.cxx
@@ -31,6 +31,7 @@
#include <hintids.hxx>
+#include <comphelper/string.hxx>
#include <vcl/svapp.hxx>
#include <vcl/wrkwin.hxx>
@@ -1696,8 +1697,8 @@ void SwHTMLParser::InsertInput()
// geloescht werden.
if( !bKeepCRLFInValue )
{
- sText.EraseAllChars( _CR );
- sText.EraseAllChars( _LF );
+ sText = comphelper::string::remove(sText, _CR);
+ sText = comphelper::string::remove(sText, _LF);
}
const uno::Reference< XMultiServiceFactory > & rServiceFactory =
diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx
index 59759eced76b..7e6c1ff109fe 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -30,6 +30,7 @@
#include "precompiled_sw.hxx"
#include "hintids.hxx"
+#include <comphelper/string.hxx>
#include <vcl/svapp.hxx>
#include <vcl/wrkwin.hxx>
#include <svx/svxids.hrc>
@@ -1134,8 +1135,7 @@ ANCHOR_SETEVENT:
xub_StrLen nPos = sDecoded.SearchBackward( cMarkSeperator );
if( STRING_NOTFOUND != nPos )
{
- String sCmp( sDecoded.Copy( nPos+1 ) );
- sCmp.EraseAllChars();
+ String sCmp(comphelper::string::remove(sDecoded.Copy(nPos+1), ' '));
if( sCmp.Len() )
{
sCmp.ToLowerAscii();
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index 29a4da1f0c32..f22418d27bc1 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -29,10 +29,10 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
-
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <com/sun/star/i18n/ScriptType.hpp>
+#include <comphelper/string.hxx>
#include <sfx2/sfx.hrc>
#include <svx/svxids.hrc>
#if OSL_DEBUG_LEVEL > 1
@@ -394,14 +394,19 @@ SwHTMLParser::SwHTMLParser( SwDoc* pD, const SwPaM& rCrsr, SvStream& rIn,
if( sJmpMark.Len() )
{
eJumpTo = JUMPTO_MARK;
- String sCmp;
xub_StrLen nLastPos, nPos = 0;
while( STRING_NOTFOUND != ( nLastPos =
sJmpMark.Search( cMarkSeperator, nPos + 1 )) )
nPos = nLastPos;
- if( nPos && ( sCmp = sJmpMark.Copy( nPos + 1 ) ).
- EraseAllChars().Len() )
+ String sCmp;
+ if (nPos)
+ {
+ sCmp = comphelper::string::remove(
+ sJmpMark.Copy(nPos + 1), ' ');
+ }
+
+ if( sCmp.Len() )
{
sCmp.ToLowerAscii();
if( sCmp.EqualsAscii( pMarkToRegion ) )
@@ -5346,8 +5351,8 @@ void SwHTMLParser::ParseMoreMetaOptions()
aName.EqualsIgnoreCaseAscii( OOO_STRING_SVTOOLS_HTML_META_content_script_type ) )
return;
- aContent.EraseAllChars( _CR );
- aContent.EraseAllChars( _LF );
+ aContent = comphelper::string::remove(aContent, _CR);
+ aContent = comphelper::string::remove(aContent, _LF);
if( aName.EqualsIgnoreCaseAscii( OOO_STRING_SVTOOLS_HTML_META_sdendnote ) )
{
diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx
index d4d9f4e84d57..cfb651ac4507 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -32,6 +32,7 @@
#include <stdlib.h>
#include <hintids.hxx>
+#include <comphelper/string.hxx>
#include <svl/urihelper.hxx>
#include <rtl/tencinfo.h>
#include <vcl/wrkwin.hxx>
@@ -1092,8 +1093,7 @@ void SwHTMLWriter::OutHyperlinkHRefValue( const String& rURL )
xub_StrLen nPos = sURL.SearchBackward( cMarkSeperator );
if( STRING_NOTFOUND != nPos )
{
- String sCmp( sURL.Copy( nPos+1 ) );
- sCmp.EraseAllChars();
+ String sCmp(comphelper::string::remove(sURL.Copy(nPos+1), ' '));
if( sCmp.Len() )
{
sCmp.ToLowerAscii();
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index e7088a4da9d5..43d7c0a3189d 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -41,6 +41,7 @@
#endif
#include <hintids.hxx>
+#include <comphelper/string.hxx>
#include <tools/urlobj.hxx>
#include <editeng/boxitem.hxx>
#include <editeng/cmapitem.hxx>
@@ -783,10 +784,9 @@ bool AttributeOutputBase::AnalyzeURL( const String& rUrl, const String& /*rTarge
xub_StrLen nPos = sMark.SearchBackward( cMarkSeperator );
- String sRefType( sMark.Copy( nPos+1 ) );
- sRefType.EraseAllChars();
+ String sRefType(comphelper::string::remove(sMark.Copy(nPos+1), ' '));
- // i21465 Only interested in outline references
+ // #i21465# Only interested in outline references
if ( sRefType.EqualsAscii( pMarkToOutline ) )
{
String sLink = sMark.Copy(0, nPos);
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index f9286353d9cc..6c0b88d5fb8f 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -93,6 +93,7 @@
#include <fmtfsize.hxx>
#include <comphelper/extract.hxx>
#include <comphelper/stlunosequence.hxx>
+#include <comphelper/string.hxx>
#include <writerfilter/doctok/sprmids.hxx>
#include "writerhelper.hxx"
@@ -2730,8 +2731,7 @@ void MSWordExportBase::AddLinkTarget(const String& rURL)
if( nPos < 2 )
return;
- String sCmp( aURL.Copy( nPos+1 ) );
- sCmp.EraseAllChars();
+ String sCmp(comphelper::string::remove(aURL.Copy(nPos+1), ' '));
if( !sCmp.Len() )
return;
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index c049b7be0f13..236ff87dc271 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -28,6 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <comphelper/string.hxx>
#include <svl/urihelper.hxx>
#include <hintids.hxx>
#include <osl/endian.h>
@@ -966,9 +967,9 @@ OutlinerParaObject* SwWW8ImplReader::ImportAsOutliner(String &rString, WW8_CP nS
long nDummy(0);
lcl_StripFields(rString, nDummy);
//Strip out word's special characters for the simple string
- rString.EraseAllChars(0x1);
- rString.EraseAllChars(0x5);
- rString.EraseAllChars(0x8);
+ rString = comphelper::string::remove(rString, 0x1);
+ rString = comphelper::string::remove(rString, 0x5);
+ rString = comphelper::string::remove(rString, 0x8);
rString.SearchAndReplaceAllAscii("\007\007", String::CreateFromAscii("\007\012"));
rString.SearchAndReplaceAll(0x7, ' ');
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 9c87f1a5268d..6287d8ce3bd4 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -36,6 +36,7 @@
#include <tools/solar.h>
#include <comphelper/storagehelper.hxx>
+#include <comphelper/string.hxx>
#include <sot/storinfo.hxx>
#include <com/sun/star/embed/XStorage.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
@@ -1112,7 +1113,7 @@ long SwWW8ImplReader::Read_Field(WW8PLCFManResult* pRes)
// Thus, delete character 0x01, which stands for such a graphic.
if (aF.nId==51) //#i56768# only do it for the MACROBUTTON field, since DropListFields need the 0x01.
{
- aStr.EraseAllChars( 0x01 );
+ aStr = comphelper::string::remove(aStr, 0x01);
}
eF_ResT eRes = (this->*aWW8FieldTab[aF.nId])( &aF, aStr );
@@ -1620,7 +1621,8 @@ eF_ResT SwWW8ImplReader::Read_F_DocInfo( WW8FieldDesc* pF, String& rStr )
break;
}
}
- aDocProperty.EraseAllChars('"');
+
+ aDocProperty = comphelper::string::remove(aDocProperty, '"');
/*
There are up to 26 fields that may be meant by 'DocumentProperty'.
diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index 8b32b9906372..1d0d189336bb 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -48,6 +48,7 @@
#endif // dump
#include <comphelper/processfactory.hxx>
+#include <comphelper/string.hxx>
#include <unotools/localedatawrapper.hxx>
#include <i18npool/lang.h>
#include <editeng/unolingu.hxx>
@@ -6249,7 +6250,7 @@ void lcl_checkFontname( String& sString )
// if anything was found, remove \u0001 + leading/trailing ';'
if( bFound )
{
- sString.EraseAllChars( sal_Unicode( 1 ) );
+ sString = comphelper::string::remove(sString, 1);
sString.EraseLeadingAndTrailingChars( sal_Unicode( ';' ) );
}
}