summaryrefslogtreecommitdiffstats
path: root/sw/source/ui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-06-11 13:15:18 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-06-11 14:46:46 +0100
commit8f5629fd5aafc85e509a4160a11a285b0a66e7c0 (patch)
tree143883c85467b5ce9f5c665338e0f8a25067a0cd /sw/source/ui
parentcallcatcher: update unused code (diff)
downloadcore-8f5629fd5aafc85e509a4160a11a285b0a66e7c0.tar.gz
core-8f5629fd5aafc85e509a4160a11a285b0a66e7c0.zip
remove EraseLeadingChars and EraseTrailingChars
Change-Id: Ib9797fe97cd008cc6508ce8cec47dc5373416892
Diffstat (limited to 'sw/source/ui')
-rw-r--r--sw/source/ui/config/optload.cxx8
-rw-r--r--sw/source/ui/dbui/dbmgr.cxx6
-rw-r--r--sw/source/ui/dbui/mmaddressblockpage.cxx3
-rw-r--r--sw/source/ui/dbui/mmlayoutpage.cxx4
-rw-r--r--sw/source/ui/fldui/fldmgr.cxx4
-rw-r--r--sw/source/ui/frmdlg/cption.cxx8
-rw-r--r--sw/source/ui/misc/bookmark.cxx9
-rw-r--r--sw/source/ui/misc/glosdoc.cxx3
-rw-r--r--sw/source/ui/ribbar/inputwin.cxx4
-rw-r--r--sw/source/ui/shells/annotsh.cxx5
-rw-r--r--sw/source/ui/shells/drwtxtex.cxx4
-rw-r--r--sw/source/ui/shells/textsh.cxx5
-rw-r--r--sw/source/ui/uiview/view.cxx2
-rw-r--r--sw/source/ui/uno/unomailmerge.cxx4
-rw-r--r--sw/source/ui/utlui/content.cxx5
-rw-r--r--sw/source/ui/utlui/navipi.cxx3
-rw-r--r--sw/source/ui/vba/vbatemplate.cxx8
17 files changed, 34 insertions, 51 deletions
diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx
index 780f1f081228..db1991f4a628 100644
--- a/sw/source/ui/config/optload.cxx
+++ b/sw/source/ui/config/optload.cxx
@@ -30,7 +30,7 @@
#undef SW_DLLIMPLEMENTATION
#endif
-
+#include <comphelper/string.hxx>
#include <tools/shl.hxx>
#include <swtypes.hxx>
#include <helpid.h>
@@ -753,11 +753,7 @@ void SwCaptionOptPage::SaveEntry(SvLBoxEntry* pEntry)
if(aName == sNone)
pOpt->SetCategory(aEmptyStr);
else
- {
- aName.EraseLeadingChars (' ');
- aName.EraseTrailingChars(' ');
- pOpt->SetCategory(aName);
- }
+ pOpt->SetCategory(comphelper::string::strip(aName, ' '));
pOpt->SetNumType((sal_uInt16)(sal_uLong)aFormatBox.GetEntryData(aFormatBox.GetSelectEntryPos()));
pOpt->SetCaption(aTextEdit.IsEnabled() ? aTextEdit.GetText() : aEmptyStr );
pOpt->SetPos(aPosBox.GetSelectEntryPos());
diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx
index eada5cc81b4d..6cb447382c3b 100644
--- a/sw/source/ui/dbui/dbmgr.cxx
+++ b/sw/source/ui/dbui/dbmgr.cxx
@@ -102,8 +102,9 @@
#include <com/sun/star/sdbc/ResultSetType.hpp>
#include <com/sun/star/mail/MailAttachment.hpp>
#include <comphelper/processfactory.hxx>
-#include <comphelper/types.hxx>
#include <comphelper/property.hxx>
+#include <comphelper/string.hxx>
+#include <comphelper/types.hxx>
#include <mailmergehelper.hxx>
#include <maildispatcher.hxx>
#include <svtools/htmlcfg.hxx>
@@ -1012,8 +1013,7 @@ sal_Bool SwNewDBMgr::MergeMailFiles(SwWrtShell* pSourceShell,
sLeading = aEntry.GetBase();
aEntry.removeSegment();
sPath = aEntry.GetMainURL( INetURLObject::NO_DECODE );
- String sExt( pStoreToFilter->GetDefaultExtension() );
- sExt.EraseLeadingChars('*');
+ String sExt(comphelper::string::stripStart(pStoreToFilter->GetDefaultExtension(), '*'));
aTempFile = std::auto_ptr< utl::TempFile >(
new utl::TempFile(sLeading,&sExt,&sPath ));
if( bAsSingleFile )
diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx
index 28bf2e75be43..d9734eefb0fc 100644
--- a/sw/source/ui/dbui/mmaddressblockpage.cxx
+++ b/sw/source/ui/dbui/mmaddressblockpage.cxx
@@ -1684,8 +1684,7 @@ String AddressMultiLineEdit::GetAddress()
sal_uLong nParaCount = pTextEngine->GetParagraphCount();
for(sal_uLong nPara = nParaCount; nPara; --nPara)
{
- String sPara = pTextEngine->GetText( nPara - 1);
- sPara.EraseTrailingChars(' ');
+ String sPara = comphelper::string::stripEnd(pTextEngine->GetText(nPara - 1), ' ');
//don't add empty trailing paragraphs
if(sRet.Len() || sPara.Len())
{
diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx
index d9d96d92fbaf..2e3403e7afbb 100644
--- a/sw/source/ui/dbui/mmlayoutpage.cxx
+++ b/sw/source/ui/dbui/mmlayoutpage.cxx
@@ -35,6 +35,7 @@
#include <mmconfigitem.hxx>
#include <mailmergehelper.hxx>
#include <unotools.hxx>
+#include <comphelper/string.hxx>
#include <unotools/tempfile.hxx>
#include <uitool.hxx>
#include <svx/dlgutil.hxx>
@@ -126,8 +127,7 @@ SwMailMergeLayoutPage::SwMailMergeLayoutPage( SwMailMergeWizard* _pParent) :
//temp file needs it's own block
//creating with extension is not supported by a static method :-(
String sLeading;
- String sExt(pSfxFlt->GetDefaultExtension());
- sExt.EraseLeadingChars('*');
+ String sExt(comphelper::string::stripStart(pSfxFlt->GetDefaultExtension(), '*'));
utl::TempFile aTempFile( sLeading, &sExt );
m_sExampleURL = aTempFile.GetURL();
aTempFile.EnableKillingFile();
diff --git a/sw/source/ui/fldui/fldmgr.cxx b/sw/source/ui/fldui/fldmgr.cxx
index 3d1bae935b81..71c2c7396e85 100644
--- a/sw/source/ui/fldui/fldmgr.cxx
+++ b/sw/source/ui/fldui/fldmgr.cxx
@@ -1315,8 +1315,8 @@ sal_Bool SwFldMgr::InsertFld( const SwInsertFld_Data& rData )
SfxItemSet aBoxSet( pCurShell->GetAttrPool(),
RES_BOXATR_FORMULA, RES_BOXATR_FORMULA );
- String sFml( rData.sPar2 );
- if( sFml.EraseLeadingChars().Len() &&
+ String sFml(comphelper::string::stripStart(rData.sPar2, ' '));
+ if( sFml.Len() &&
'=' == sFml.GetChar( 0 ) )
sFml.Erase( 0, 1 );
diff --git a/sw/source/ui/frmdlg/cption.cxx b/sw/source/ui/frmdlg/cption.cxx
index 0a16423f06df..534297a48060 100644
--- a/sw/source/ui/frmdlg/cption.cxx
+++ b/sw/source/ui/frmdlg/cption.cxx
@@ -57,7 +57,7 @@
#include <com/sun/star/text/XTextEmbeddedObject.hpp>
#include <com/sun/star/text/XTextFramesSupplier.hpp>
#include <com/sun/star/text/XTextFrame.hpp>
-
+#include <comphelper/string.hxx>
#include <frmui.hrc>
#include <cption.hrc>
#include <SwStyleNameMapper.hxx>
@@ -296,11 +296,7 @@ void SwCaptionDialog::Apply()
if ( aName == sNone )
aOpt.SetCategory( aEmptyStr );
else
- {
- aName.EraseLeadingChars( ' ' );
- aName.EraseTrailingChars( ' ' );
- aOpt.SetCategory( aName );
- }
+ aOpt.SetCategory(comphelper::string::strip(aName, ' '));
aOpt.SetNumType( (sal_uInt16)(sal_uIntPtr)aFormatBox.GetEntryData( aFormatBox.GetSelectEntryPos() ) );
aOpt.SetSeparator( aSepEdit.IsEnabled() ? aSepEdit.GetText() : String() );
aOpt.SetNumSeparator( aNumberingSeparatorED.GetText() );
diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index 180c3d142b6b..fe056ee6f36e 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -198,9 +198,7 @@ sal_uInt16 BookmarkCombo::GetSelEntryPos(sal_uInt16 nPos) const
for (; nPos < nCnt; nPos++)
{
- String sEntry(GetText().GetToken(nPos, cSep));
- sEntry.EraseLeadingChars();
- sEntry.EraseTrailingChars();
+ String sEntry(comphelper::string::strip(GetText().GetToken(nPos, cSep), ' '));
if (GetEntryPos(sEntry) != COMBOBOX_ENTRY_NOTFOUND)
return nPos;
}
@@ -235,10 +233,7 @@ sal_uInt16 BookmarkCombo::GetSelectEntryPos( sal_uInt16 nSelIndex ) const
if (nSelIndex == nCnt)
{
sal_Unicode cSep = GetMultiSelectionSeparator();
- String sEntry(GetText().GetToken(nPos, cSep));
- sEntry.EraseLeadingChars();
- sEntry.EraseTrailingChars();
-
+ String sEntry(comphelper::string::strip(GetText().GetToken(nPos, cSep), ' '));
return GetEntryPos(sEntry);
}
nPos = GetNextSelEntryPos(nPos);
diff --git a/sw/source/ui/misc/glosdoc.cxx b/sw/source/ui/misc/glosdoc.cxx
index f07fe52cc9f4..95e6f547bbb8 100644
--- a/sw/source/ui/misc/glosdoc.cxx
+++ b/sw/source/ui/misc/glosdoc.cxx
@@ -72,8 +72,7 @@ String lcl_CheckFileName( const String& rNewFilePath,
sRet += cChar;
}
}
- sRet.EraseLeadingChars();
- sRet.EraseTrailingChars();
+ sRet = comphelper::string::strip(sRet, ' ');
sal_Bool bOk = sal_False;
if( sRet.Len() )
diff --git a/sw/source/ui/ribbar/inputwin.cxx b/sw/source/ui/ribbar/inputwin.cxx
index c6b0f220fb13..0693340291be 100644
--- a/sw/source/ui/ribbar/inputwin.cxx
+++ b/sw/source/ui/ribbar/inputwin.cxx
@@ -28,6 +28,7 @@
#include "sal/config.h"
+#include <comphelper/string.hxx>
#include <officecfg/Office/Common.hxx>
#include <tools/gen.hxx>
#include <sfx2/imgmgr.hxx>
@@ -393,8 +394,7 @@ void SwInputWindow::ApplyFormula()
// Formel soll immer mit einem "=" beginnen, hier
// also wieder entfernen
- String sEdit( aEdit.GetText() );
- sEdit.EraseLeadingChars().EraseTrailingChars();
+ String sEdit(comphelper::string::strip(aEdit.GetText(), ' '));
if( sEdit.Len() && '=' == sEdit.GetChar( 0 ) )
sEdit.Erase( 0, 1 );
SfxStringItem aParam(FN_EDIT_FORMULA, sEdit);
diff --git a/sw/source/ui/shells/annotsh.cxx b/sw/source/ui/shells/annotsh.cxx
index 431de8bda43e..5f9e7d3f9d9d 100644
--- a/sw/source/ui/shells/annotsh.cxx
+++ b/sw/source/ui/shells/annotsh.cxx
@@ -124,7 +124,7 @@
#include <app.hrc>
#include <comphelper/processfactory.hxx>
-
+#include <comphelper/string.hxx>
#include <cppuhelper/bootstrap.hxx>
#include <langhelper.hxx>
@@ -966,8 +966,7 @@ void SwAnnotationShell::StateInsert(SfxItemSet &rSet)
{
String sSel(pOLV->GetSelected());
sSel.Erase(255);
- sSel.EraseTrailingChars();
- aHLinkItem.SetName(sSel);
+ aHLinkItem.SetName(comphelper::string::stripEnd(sSel, ' '));
}
sal_uInt16 nHtmlMode = ::GetHtmlMode(rView.GetDocShell());
diff --git a/sw/source/ui/shells/drwtxtex.cxx b/sw/source/ui/shells/drwtxtex.cxx
index be020a989bb2..321ce0aec7e4 100644
--- a/sw/source/ui/shells/drwtxtex.cxx
+++ b/sw/source/ui/shells/drwtxtex.cxx
@@ -30,6 +30,7 @@
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
#include <comphelper/processfactory.hxx>
+#include <comphelper/string.hxx>
#include <i18npool/mslangid.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx>
@@ -940,8 +941,7 @@ void SwDrawTextShell::StateInsert(SfxItemSet &rSet)
{
String sSel(pOLV->GetSelected());
sSel.Erase(255);
- sSel.EraseTrailingChars();
- aHLinkItem.SetName(sSel);
+ aHLinkItem.SetName(comphelper::string::stripEnd(sSel, ' '));
}
sal_uInt16 nHtmlMode = ::GetHtmlMode(GetView().GetDocShell());
diff --git a/sw/source/ui/shells/textsh.cxx b/sw/source/ui/shells/textsh.cxx
index 07b562214fdb..3ad1e1ff61cb 100644
--- a/sw/source/ui/shells/textsh.cxx
+++ b/sw/source/ui/shells/textsh.cxx
@@ -30,7 +30,7 @@
#define _SW_FRMVALID_HXX
#include <hintids.hxx>
-
+#include <comphelper/string.hxx>
#include <svl/globalnameitem.hxx>
#include <svl/ownlist.hxx>
#include <sfx2/frmdescr.hxx>
@@ -850,8 +850,7 @@ void SwTextShell::StateInsert( SfxItemSet &rSet )
{
String sReturn = rSh.GetSelTxt();
sReturn.Erase(255);
- sReturn.EraseTrailingChars();
- aHLinkItem.SetName(sReturn);
+ aHLinkItem.SetName(comphelper::string::stripEnd(sReturn, ' '));
}
aHLinkItem.SetInsertMode((SvxLinkInsertMode)(aHLinkItem.GetInsertMode() |
diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx
index 93e643a0c606..10d7fa98c22c 100644
--- a/sw/source/ui/uiview/view.cxx
+++ b/sw/source/ui/uiview/view.cxx
@@ -1582,7 +1582,7 @@ String SwView::GetSelectionTextParam( sal_Bool bCompleteWrds,
GetWrtShell().GetSelectedText( sReturn );
if( bEraseTrail )
- sReturn.EraseTrailingChars();
+ sReturn = comphelper::string::stripEnd(sReturn, ' ');
return sReturn;
}
diff --git a/sw/source/ui/uno/unomailmerge.cxx b/sw/source/ui/uno/unomailmerge.cxx
index ebcbb354846e..e224320bf23c 100644
--- a/sw/source/ui/uno/unomailmerge.cxx
+++ b/sw/source/ui/uno/unomailmerge.cxx
@@ -37,6 +37,7 @@
#include <sfx2/docfile.hxx>
#include <sfx2/docfilt.hxx>
#include <comphelper/processfactory.hxx>
+#include <comphelper/string.hxx>
#include <vcl/timer.hxx>
#include <com/sun/star/sdb/CommandType.hpp>
#include <com/sun/star/text/MailMergeType.hpp>
@@ -787,8 +788,7 @@ uno::Any SAL_CALL SwXMailMerge::execute(
const SfxFilter *pSfxFlt = SwIoSystem::GetFilterOfFormat(
String::CreateFromAscii( FILTER_XML ),
SwDocShell::Factory().GetFilterContainer() );
- String aExtension( pSfxFlt->GetDefaultExtension() );
- aExtension.EraseLeadingChars( '*' );
+ String aExtension(comphelper::string::stripStart(pSfxFlt->GetDefaultExtension(), '*'));
TempFile aTempFile( C2U("SwMM"), &aExtension );
aTmpFileName = aTempFile.GetName();
diff --git a/sw/source/ui/utlui/content.cxx b/sw/source/ui/utlui/content.cxx
index b90d3f78755d..a0497aa8ea3b 100644
--- a/sw/source/ui/utlui/content.cxx
+++ b/sw/source/ui/utlui/content.cxx
@@ -26,6 +26,7 @@
*
************************************************************************/
+#include <comphelper/string.hxx>
#include <svl/svstdarr.hxx>
#include <svl/urlbmk.hxx>
#include <tools/urlobj.hxx>
@@ -510,8 +511,8 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibilityChanged)
nMemberCount--;
else
{
- String aEntry(pWrtShell->getIDocumentOutlineNodesAccess()->getOutlineText(i));
- aEntry.EraseLeadingChars();
+ String aEntry(comphelper::string::stripStart(
+ pWrtShell->getIDocumentOutlineNodesAccess()->getOutlineText(i), ' '));
SwNavigationPI::CleanEntry( aEntry );
SwOutlineContent* pCnt = new SwOutlineContent(this, aEntry, i, nLevel,
pWrtShell->IsOutlineMovable( i ), nPos );
diff --git a/sw/source/ui/utlui/navipi.cxx b/sw/source/ui/utlui/navipi.cxx
index f53b4f77bdc1..827b47e79157 100644
--- a/sw/source/ui/utlui/navipi.cxx
+++ b/sw/source/ui/utlui/navipi.cxx
@@ -30,6 +30,7 @@
#define NAVIPI_CXX
#include <string>
+#include <comphelper/string.hxx>
#include <svl/urlbmk.hxx>
#include <svl/stritem.hxx>
#include <svtools/filter.hxx>
@@ -1238,7 +1239,7 @@ sal_Int8 SwNavigationPI::ExecuteDrop( const ExecuteDropEvent& rEvt )
&& (!sContentFileName.Len() || sContentFileName != sFileName ))
{
nRet = rEvt.mnAction;
- sFileName.EraseTrailingChars( char(0) );
+ sFileName = comphelper::string::stripEnd(sFileName, 0);
sContentFileName = sFileName;
if(pxObjectShell)
{
diff --git a/sw/source/ui/vba/vbatemplate.cxx b/sw/source/ui/vba/vbatemplate.cxx
index 2071ebdd223a..0ce1817911f3 100644
--- a/sw/source/ui/vba/vbatemplate.cxx
+++ b/sw/source/ui/vba/vbatemplate.cxx
@@ -29,10 +29,10 @@
#include <vbahelper/vbahelper.hxx>
#include "wordvbahelper.hxx"
#include "vbaautotextentry.hxx"
-#include <comphelper/processfactory.hxx>
#include <com/sun/star/text/XAutoTextContainer.hpp>
-#include <tools/urlobj.hxx>
+#include <comphelper/processfactory.hxx>
#include <comphelper/string.hxx>
+#include <tools/urlobj.hxx>
#include <osl/file.hxx>
using namespace ::ooo::vba;
@@ -51,9 +51,7 @@ String lcl_CheckGroupName( const String& rGroupName )
sRet += cChar;
}
}
- sRet.EraseLeadingChars();
- sRet.EraseTrailingChars();
- return sRet;
+ return comphelper::string::strip(sRet, ' ');
}