diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-06-11 13:15:18 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-06-11 14:46:46 +0100 |
commit | 8f5629fd5aafc85e509a4160a11a285b0a66e7c0 (patch) | |
tree | 143883c85467b5ce9f5c665338e0f8a25067a0cd /sc/source/ui | |
parent | callcatcher: update unused code (diff) | |
download | core-8f5629fd5aafc85e509a4160a11a285b0a66e7c0.tar.gz core-8f5629fd5aafc85e509a4160a11a285b0a66e7c0.zip |
remove EraseLeadingChars and EraseTrailingChars
Change-Id: Ib9797fe97cd008cc6508ce8cec47dc5373416892
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/dbgui/dbnamdlg.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/dbgui/scendlg.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/drawfunc/drtxtob.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/optdlg/tpusrlst.cxx | 7 | ||||
-rw-r--r-- | sc/source/ui/view/editsh.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwshe.cxx | 3 |
6 files changed, 12 insertions, 19 deletions
diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx index a261ff64c4a1..d380c591ca5d 100644 --- a/sc/source/ui/dbgui/dbnamdlg.cxx +++ b/sc/source/ui/dbgui/dbnamdlg.cxx @@ -26,6 +26,7 @@ * ************************************************************************/ +#include <comphelper/string.hxx> #include <vcl/msgbox.hxx> #include "reffact.hxx" @@ -454,12 +455,9 @@ IMPL_LINK_NOARG_INLINE_END(ScDbNameDlg, CancelBtnHdl) IMPL_LINK_NOARG(ScDbNameDlg, AddBtnHdl) { - String aNewName = aEdName.GetText(); + String aNewName = comphelper::string::strip(aEdName.GetText(), ' '); String aNewArea = aEdAssign.GetText(); - aNewName.EraseLeadingChars( ' ' ); - aNewName.EraseTrailingChars( ' ' ); - if ( aNewName.Len() > 0 && aNewArea.Len() > 0 ) { if ( ScRangeData::IsNameValid( aNewName, pDoc ) && !aNewName.EqualsAscii(STR_DB_LOCAL_NONAME) ) diff --git a/sc/source/ui/dbgui/scendlg.cxx b/sc/source/ui/dbgui/scendlg.cxx index d8465839057b..b9c29649e5c1 100644 --- a/sc/source/ui/dbgui/scendlg.cxx +++ b/sc/source/ui/dbgui/scendlg.cxx @@ -32,6 +32,7 @@ #include "scitems.hxx" +#include <comphelper/string.hxx> #include <svx/drawitem.hxx> #include <svx/xtable.hxx> #include <sfx2/objsh.hxx> @@ -209,12 +210,10 @@ void ScNewScenarioDlg::SetScenarioData( const rtl::OUString& rName, const rtl::O IMPL_LINK_NOARG(ScNewScenarioDlg, OkHdl) { - String aName ( aEdName.GetText() ); + String aName = comphelper::string::strip(aEdName.GetText(), ' '); ScDocument* pDoc = ((ScTabViewShell*)SfxViewShell::Current())-> GetViewData()->GetDocument(); - aName.EraseLeadingChars( ' ' ); - aName.EraseTrailingChars( ' ' ); aEdName.SetText( aName ); if ( !pDoc->ValidTabName( aName ) ) diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx index 08245a58b91d..9029b5c7d646 100644 --- a/sc/source/ui/drawfunc/drtxtob.cxx +++ b/sc/source/ui/drawfunc/drtxtob.cxx @@ -28,7 +28,7 @@ #include <com/sun/star/linguistic2/XThesaurus.hpp> #include <com/sun/star/lang/Locale.hpp> - +#include <comphelper/string.hxx> #include "scitems.hxx" #include <editeng/adjitem.hxx> @@ -409,8 +409,7 @@ void ScDrawTextObjectBar::GetState( SfxItemSet& rSet ) // use selected text as name for urls String sReturn = pOutView->GetSelected(); sReturn.Erase(255); - sReturn.EraseTrailingChars(); - aHLinkItem.SetName(sReturn); + aHLinkItem.SetName(comphelper::string::stripEnd(sReturn, ' ')); } } rSet.Put(aHLinkItem); diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx index 3eee0085bb0e..a4f7428a836d 100644 --- a/sc/source/ui/optdlg/tpusrlst.cxx +++ b/sc/source/ui/optdlg/tpusrlst.cxx @@ -324,15 +324,12 @@ void ScTpUserLists::MakeListStr( String& rListStr ) for(xub_StrLen i=0;i<nToken;i++) { - String aString=rListStr.GetToken(i,LF); - aString.EraseLeadingChars(' '); - aString.EraseTrailingChars(' '); + rtl::OUString aString = comphelper::string::strip(rListStr.GetToken(i, LF), ' '); aStr+=aString; aStr+=cDelimiter; } - aStr.EraseLeadingChars( cDelimiter ); - aStr.EraseTrailingChars( cDelimiter ); + aStr = comphelper::string::strip(aStr, cDelimiter); xub_StrLen nLen = aStr.Len(); rListStr.Erase(); diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx index ef0308f6cd6c..e5e03c1393d4 100644 --- a/sc/source/ui/view/editsh.cxx +++ b/sc/source/ui/view/editsh.cxx @@ -27,7 +27,7 @@ ************************************************************************/ #include <com/sun/star/linguistic2/XThesaurus.hpp> - +#include <comphelper/string.hxx> #include "scitems.hxx" #include <editeng/eeitem.hxx> @@ -692,8 +692,7 @@ void ScEditShell::GetState( SfxItemSet& rSet ) // use selected text as name for urls String sReturn = pActiveView->GetSelected(); sReturn.Erase(255); - sReturn.EraseTrailingChars(); - aHLinkItem.SetName(sReturn); + aHLinkItem.SetName(comphelper::string::stripEnd(sReturn, ' ')); } rSet.Put(aHLinkItem); } diff --git a/sc/source/ui/view/tabvwshe.cxx b/sc/source/ui/view/tabvwshe.cxx index 08195cb4b0f7..f3c678f3ce16 100644 --- a/sc/source/ui/view/tabvwshe.cxx +++ b/sc/source/ui/view/tabvwshe.cxx @@ -26,6 +26,7 @@ * ************************************************************************/ +#include <comphelper/string.hxx> #include <editeng/eeitem.hxx> #include "scitems.hxx" @@ -122,7 +123,7 @@ String ScTabViewShell::GetSelectionText( sal_Bool bWholeWord ) while ( (nAt = aStrSelection.Search( '\t' )) != STRING_NOTFOUND ) aStrSelection.SetChar( nAt, ' ' ); - aStrSelection.EraseTrailingChars( ' ' ); + aStrSelection = comphelper::string::stripEnd(aStrSelection, ' '); } } } |