summaryrefslogtreecommitdiff
path: root/sw/source/ui
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/ui
parente4ff699291ddab16d70aa9b11c717e34dfbe5414 (diff)
remove [Byte]String::EraseAllChars
Diffstat (limited to 'sw/source/ui')
-rw-r--r--sw/source/ui/app/appenv.cxx5
-rw-r--r--sw/source/ui/cctrl/actctrl.cxx3
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.cxx3
-rw-r--r--sw/source/ui/docvw/edtwin2.cxx3
-rw-r--r--sw/source/ui/fldui/inpdlg.cxx4
-rw-r--r--sw/source/ui/misc/bookmark.cxx7
-rw-r--r--sw/source/ui/ribbar/workctrl.cxx4
-rw-r--r--sw/source/ui/table/instable.cxx4
-rw-r--r--sw/source/ui/uiview/view2.cxx9
-rw-r--r--sw/source/ui/utlui/swrenamexnameddlg.cxx3
-rw-r--r--sw/source/ui/vba/vbafield.cxx5
11 files changed, 29 insertions, 21 deletions
diff --git a/sw/source/ui/app/appenv.cxx b/sw/source/ui/app/appenv.cxx
index c08bfb5bf6df..0fb63d5afeb3 100644
--- a/sw/source/ui/app/appenv.cxx
+++ b/sw/source/ui/app/appenv.cxx
@@ -33,6 +33,7 @@
#include <hintids.hxx>
+#include <comphelper/string.hxx>
#include <sfx2/request.hxx>
#include <svx/svxids.hrc>
@@ -88,9 +89,7 @@
String InsertLabEnvText( SwWrtShell& rSh, SwFldMgr& rFldMgr, const String& rText )
{
String sRet;
- String aText(rText);
- aText.EraseAllChars( '\r' );
-
+ String aText(comphelper::string::remove(rText, '\r'));
sal_uInt16 nTokenPos = 0;
while( STRING_NOTFOUND != nTokenPos )
diff --git a/sw/source/ui/cctrl/actctrl.cxx b/sw/source/ui/cctrl/actctrl.cxx
index 105691be41ce..fc6fbb347764 100644
--- a/sw/source/ui/cctrl/actctrl.cxx
+++ b/sw/source/ui/cctrl/actctrl.cxx
@@ -29,6 +29,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <comphelper/string.hxx>
#include "actctrl.hxx"
void NumEditAction::Action()
@@ -88,7 +89,7 @@ void NoSpaceEdit::Modify()
String sTemp = GetText();
for(sal_uInt16 i = 0; i < sForbiddenChars.Len(); i++)
{
- sTemp.EraseAllChars( sForbiddenChars.GetChar(i) );
+ sTemp = comphelper::string::remove(sTemp, sForbiddenChars.GetChar(i));
}
sal_uInt16 nDiff = GetText().Len() - sTemp.Len();
if(nDiff)
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx
index 8dbd080f39c7..bcd1bbf2a4da 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -42,6 +42,7 @@
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
#include <com/sun/star/sdb/XColumn.hpp>
+#include <comphelper/string.hxx>
#include <vector>
#include <boost/scoped_ptr.hpp>
@@ -532,7 +533,7 @@ void SwRestrictedComboBox::Modify()
String sTemp = GetText();
for(sal_uInt16 i = 0; i < sForbiddenChars.Len(); i++)
{
- sTemp.EraseAllChars( sForbiddenChars.GetChar(i) );
+ sTemp = comphelper::string::remove(sTemp, sForbiddenChars.GetChar(i));
}
sal_uInt16 nDiff = GetText().Len() - sTemp.Len();
if(nDiff)
diff --git a/sw/source/ui/docvw/edtwin2.cxx b/sw/source/ui/docvw/edtwin2.cxx
index f4900be44a48..a49674d3936c 100644
--- a/sw/source/ui/docvw/edtwin2.cxx
+++ b/sw/source/ui/docvw/edtwin2.cxx
@@ -28,6 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
+#include <comphelper/string.hxx>
#include <tools/ref.hxx>
#include <hintids.hxx>
@@ -209,7 +210,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
if( sTxt.Len() )
{
- sTxt.EraseAllChars( 0xad );
+ sTxt = comphelper::string::remove(sTxt, 0xad);
for( sal_Unicode* p = sTxt.GetBufferAccess(); *p; ++p )
{
if( *p < 0x20 )
diff --git a/sw/source/ui/fldui/inpdlg.cxx b/sw/source/ui/fldui/inpdlg.cxx
index ed1b04bc45da..50f730a3a4d9 100644
--- a/sw/source/ui/fldui/inpdlg.cxx
+++ b/sw/source/ui/fldui/inpdlg.cxx
@@ -33,6 +33,7 @@
#undef SW_DLLIMPLEMENTATION
#endif
+#include <comphelper/string.hxx>
#include <vcl/msgbox.hxx>
#include <unotools/charclass.hxx>
#include <editeng/unolingu.hxx>
@@ -156,8 +157,7 @@ void SwFldInputDlg::StateChanged( StateChangedType nType )
void SwFldInputDlg::Apply()
{
- String aTmp( aEditED.GetText() );
- aTmp.EraseAllChars( '\r' );
+ String aTmp(comphelper::string::remove(aEditED.GetText(), '\r'));
rSh.StartAllAction();
sal_Bool bModified = sal_False;
diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index 4bbcda92318c..45e11c4af476 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -34,6 +34,7 @@
#endif
+#include <comphelper/string.hxx>
#include <sfx2/request.hxx>
#include <svl/stritem.hxx>
#include <vcl/msgbox.hxx>
@@ -63,7 +64,7 @@ IMPL_LINK( SwInsertBookmarkDlg, ModifyHdl, BookmarkCombo *, pBox )
for(sal_uInt16 i = 0; i < BookmarkCombo::aForbiddenChars.Len(); i++)
{
sal_uInt16 nTmpLen = sTmp.Len();
- sTmp.EraseAllChars(BookmarkCombo::aForbiddenChars.GetChar(i));
+ sTmp = comphelper::string::remove(sTmp, BookmarkCombo::aForbiddenChars.GetChar(i));
if(sTmp.Len() != nTmpLen)
sMsg += BookmarkCombo::aForbiddenChars.GetChar(i);
}
@@ -125,8 +126,8 @@ void SwInsertBookmarkDlg::Apply()
if ( nLen && (aBookmarkBox.GetEntryPos(aTmpEntry) == COMBOBOX_ENTRY_NOTFOUND) )
{
- String sEntry(aBookmarkBox.GetText());
- sEntry.EraseAllChars(aBookmarkBox.GetMultiSelectionSeparator());
+ String sEntry(comphelper::string::remove(aBookmarkBox.GetText(),
+ aBookmarkBox.GetMultiSelectionSeparator()));
rSh.SetBookmark( KeyCode(), sEntry, aEmptyStr );
rReq.AppendItem( SfxStringItem( FN_INSERT_BOOKMARK, sEntry ) );
diff --git a/sw/source/ui/ribbar/workctrl.cxx b/sw/source/ui/ribbar/workctrl.cxx
index 6cf63fe81ce5..7fc40b06f1ff 100644
--- a/sw/source/ui/ribbar/workctrl.cxx
+++ b/sw/source/ui/ribbar/workctrl.cxx
@@ -31,6 +31,7 @@
#include <string>
+#include <comphelper/string.hxx>
#include <svl/eitem.hxx>
#include <svx/htmlmode.hxx>
#include <sfx2/dispatch.hxx>
@@ -685,8 +686,7 @@ void SwZoomBox_Impl::Select()
{
if ( !IsTravelSelect() )
{
- String sEntry(GetText());
- sEntry.EraseAllChars( '%' );
+ String sEntry(comphelper::string::remove(GetText(), '%'));
sal_uInt16 nZoom = (sal_uInt16)sEntry.ToInt32();
if(nZoom < MINZOOM)
nZoom = MINZOOM;
diff --git a/sw/source/ui/table/instable.cxx b/sw/source/ui/table/instable.cxx
index 9f8a711c4533..727fceb61242 100644
--- a/sw/source/ui/table/instable.cxx
+++ b/sw/source/ui/table/instable.cxx
@@ -33,7 +33,7 @@
#undef SW_DLLIMPLEMENTATION
#endif
-
+#include <comphelper/string.hxx>
#include <vcl/msgbox.hxx>
#include "wrtsh.hxx"
@@ -176,7 +176,7 @@ IMPL_LINK_INLINE_START( SwInsTableDlg, ModifyName, Edit *, pEdit )
String sTblName = pEdit->GetText();
if(sTblName.Search(' ') != STRING_NOTFOUND)
{
- sTblName.EraseAllChars( );
+ sTblName = comphelper::string::remove(sTblName, ' ');
pEdit->SetText(sTblName);
}
diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx
index 8c04deb68c51..e986f69b7059 100644
--- a/sw/source/ui/uiview/view2.cxx
+++ b/sw/source/ui/uiview/view2.cxx
@@ -132,9 +132,10 @@
#include <PostItMgr.hxx>
-#include <ndtxt.hxx> //#outline level,added by zhaojianwei
+#include <ndtxt.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/string.hxx>
#include <svx/svxdlg.hxx>
#include <svx/dialogs.hrc>
@@ -1783,8 +1784,10 @@ sal_Bool SwView::JumpToSwMark( const String& rMark )
IDocumentMarkAccess::const_iterator_t ppMark;
IDocumentMarkAccess* const pMarkAccess = pWrtShell->getIDocumentMarkAccess();
- if( STRING_NOTFOUND != nPos &&
- ( sCmp = sMark.Copy( nPos + 1 ) ).EraseAllChars().Len() )
+ if( STRING_NOTFOUND != nPos )
+ sCmp = comphelper::string::remove(sMark.Copy(nPos + 1), ' ');
+
+ if( sCmp.Len() )
{
String sName( sMark.Copy( 0, nPos ) );
sCmp.ToLowerAscii();
diff --git a/sw/source/ui/utlui/swrenamexnameddlg.cxx b/sw/source/ui/utlui/swrenamexnameddlg.cxx
index 86c2a00b10f4..143f3ca94789 100644
--- a/sw/source/ui/utlui/swrenamexnameddlg.cxx
+++ b/sw/source/ui/utlui/swrenamexnameddlg.cxx
@@ -54,6 +54,7 @@
#include <com/sun/star/view/XViewSettingsSupplier.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <comphelper/processfactory.hxx>
+#include <comphelper/string.hxx>
#include <sfx2/dispatch.hxx>
#include <svl/stritem.hxx>
#include <shellio.hxx>
@@ -120,7 +121,7 @@ IMPL_LINK(SwRenameXNamedDlg, ModifyHdl, NoSpaceEdit*, pEdit)
for(sal_uInt16 i = 0; i < pEdit->GetForbiddenChars().Len(); i++)
{
sal_uInt16 nTmpLen = sTmp.Len();
- sTmp.EraseAllChars(pEdit->GetForbiddenChars().GetChar(i));
+ sTmp = comphelper::string::remove(sTmp, pEdit->GetForbiddenChars().GetChar(i));
if(sTmp.Len() != nTmpLen)
sMsg += pEdit->GetForbiddenChars().GetChar(i);
}
diff --git a/sw/source/ui/vba/vbafield.cxx b/sw/source/ui/vba/vbafield.cxx
index 27a682ebe762..d83f5705b926 100644
--- a/sw/source/ui/vba/vbafield.cxx
+++ b/sw/source/ui/vba/vbafield.cxx
@@ -31,10 +31,11 @@
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
#include <com/sun/star/view/XSelectionSupplier.hpp>
#include <com/sun/star/text/XTextFieldsSupplier.hpp>
-#include <ooo/vba/word/WdFieldType.hpp>
#include <com/sun/star/text/FilenameDisplayFormat.hpp>
#include <com/sun/star/util/XRefreshable.hpp>
#include <com/sun/star/util/XUpdatable.hpp>
+#include <comphelper/string.hxx>
+#include <ooo/vba/word/WdFieldType.hpp>
#include <swtypes.hxx>
using namespace ::ooo::vba;
@@ -491,7 +492,7 @@ uno::Reference< text::XTextField > SwVbaFields::Create_Field_DocProperty( const
break;
}
}
- aDocProperty.EraseAllChars('"');
+ aDocProperty = comphelper::string::remove(aDocProperty, '"');
OSL_TRACE("SwVbaFields::Create_Field_DocProperty, the document property name is %s ",rtl::OUStringToOString( aDocProperty, RTL_TEXTENCODING_UTF8 ).getStr() );
if( aDocProperty.Len() == 0 )
{