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 /cui | |
parent | callcatcher: update unused code (diff) | |
download | core-8f5629fd5aafc85e509a4160a11a285b0a66e7c0.tar.gz core-8f5629fd5aafc85e509a4160a11a285b0a66e7c0.zip |
remove EraseLeadingChars and EraseTrailingChars
Change-Id: Ib9797fe97cd008cc6508ce8cec47dc5373416892
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/dialogs/hangulhanjadlg.cxx | 15 | ||||
-rw-r--r-- | cui/source/dialogs/hlinettp.cxx | 4 | ||||
-rw-r--r-- | cui/source/dialogs/thesdlg.cxx | 4 | ||||
-rw-r--r-- | cui/source/options/optdict.cxx | 3 | ||||
-rw-r--r-- | cui/source/options/optgenrl.cxx | 5 | ||||
-rw-r--r-- | cui/source/options/optjava.cxx | 9 |
6 files changed, 16 insertions, 24 deletions
diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx index 93705c65d19a..2deec0584c39 100644 --- a/cui/source/dialogs/hangulhanjadlg.cxx +++ b/cui/source/dialogs/hangulhanjadlg.cxx @@ -46,6 +46,7 @@ #include <com/sun/star/util/XFlushable.hpp> #include <comphelper/processfactory.hxx> +#include <comphelper/string.hxx> #define HHC editeng::HangulHanjaConversion #define LINE_CNT static_cast< sal_uInt16 >(2) @@ -1201,9 +1202,8 @@ namespace svx IMPL_LINK_NOARG(HangulHanjaNewDictDialog, OKHdl) { - String aName( m_aDictNameED.GetText() ); + String aName(comphelper::string::stripEnd(m_aDictNameED.GetText(), ' ')); - aName.EraseTrailingChars(); m_bEntered = aName.Len() > 0; if( m_bEntered ) m_aDictNameED.SetText( aName ); // do this in case of trailing chars have been deleted @@ -1214,9 +1214,8 @@ namespace svx IMPL_LINK_NOARG(HangulHanjaNewDictDialog, ModifyHdl) { - String aName( m_aDictNameED.GetText() ); + String aName(comphelper::string::stripEnd(m_aDictNameED.GetText(), ' ')); - aName.EraseTrailingChars(); m_aOkBtn.Enable( aName.Len() > 0 ); return 0; @@ -1247,10 +1246,7 @@ namespace svx bool HangulHanjaNewDictDialog::GetName( String& _rRetName ) const { if( m_bEntered ) - { - _rRetName = m_aDictNameED.GetText(); - _rRetName.EraseTrailingChars(); - } + _rRetName = comphelper::string::stripEnd(m_aDictNameED.GetText(), ' '); return m_bEntered; } @@ -1548,8 +1544,7 @@ namespace svx IMPL_LINK_NOARG(HangulHanjaEditDictDialog, OriginalModifyHdl) { m_bModifiedOriginal = true; - m_aOriginal = m_aOriginalLB.GetText(); - m_aOriginal.EraseTrailingChars(); + m_aOriginal = comphelper::string::stripEnd(m_aOriginalLB.GetText(), ' '); UpdateSuggestions(); UpdateButtonStates(); diff --git a/cui/source/dialogs/hlinettp.cxx b/cui/source/dialogs/hlinettp.cxx index d7082e6a1473..ea7f2ad19af2 100644 --- a/cui/source/dialogs/hlinettp.cxx +++ b/cui/source/dialogs/hlinettp.cxx @@ -26,6 +26,7 @@ * ************************************************************************/ +#include <comphelper/string.hxx> #include <unotools/pathoptions.hxx> #include <unotools/useroptions.hxx> #include <svl/adrparse.hxx> @@ -505,8 +506,7 @@ void SvxHyperlinkInternetTp::SetOnlineMode( sal_Bool /*bEnable*/ ) // State of target-button in subject to the current url-string // ( Can't display any targets in an document, if there is no // valid url to a document ) - String aStrCurrentTarget( maCbbTarget.GetText() ); - aStrCurrentTarget.EraseTrailingChars(); + String aStrCurrentTarget(comphelper::string::stripEnd(maCbbTarget.GetText(), ' ')); if( aStrCurrentTarget == aEmptyStr || aStrCurrentTarget.EqualsIgnoreCaseAscii( sHTTPScheme ) || diff --git a/cui/source/dialogs/thesdlg.cxx b/cui/source/dialogs/thesdlg.cxx index 17db9233e6ef..0328a592f359 100644 --- a/cui/source/dialogs/thesdlg.cxx +++ b/cui/source/dialogs/thesdlg.cxx @@ -50,6 +50,7 @@ #include <unotools/lingucfg.hxx> #include <i18npool/mslangid.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/string.hxx> #include <osl/file.hxx> #include <stack> @@ -309,8 +310,7 @@ uno::Sequence< uno::Reference< linguistic2::XMeaning > > SAL_CALL SvxThesaurusDi { // try again without trailing '.' chars. It may be a word at the // end of a sentence and not an abbreviation... - String aTxt( rTerm ); - aTxt.EraseTrailingChars( '.' ); + String aTxt(comphelper::string::stripEnd(rTerm, '.')); aMeanings = xThesaurus->queryMeanings( aTxt, rLocale, rProperties ); if (aMeanings.getLength()) { diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx index e300424756e1..b1f3dc6afe33 100644 --- a/cui/source/options/optdict.cxx +++ b/cui/source/options/optdict.cxx @@ -127,8 +127,7 @@ SvxNewDictionaryDialog::SvxNewDictionaryDialog( Window* pParent, IMPL_LINK_NOARG(SvxNewDictionaryDialog, OKHdl_Impl) { - String sDict = aNameEdit.GetText(); - sDict.EraseTrailingChars(); + String sDict = comphelper::string::stripEnd(aNameEdit.GetText(), ' '); // add extension for personal dictionaries sDict.AppendAscii(".dic"); diff --git a/cui/source/options/optgenrl.cxx b/cui/source/options/optgenrl.cxx index 093358db607f..2454f17725fe 100644 --- a/cui/source/options/optgenrl.cxx +++ b/cui/source/options/optgenrl.cxx @@ -44,7 +44,7 @@ #include <svx/strarray.hxx> #include <svx/svxids.hrc> // SID_FIELD_GRABFOCUS -#define TRIM(s) s.EraseLeadingChars().EraseTrailingChars() +#define TRIM(s) comphelper::string::strip(s, ' ') // struct GeneralTabPage_Impl -------------------------------------------- @@ -346,8 +346,7 @@ IMPL_LINK( SvxGeneralTabPage, ModifyHdl_Impl, Edit *, pEdit ) String aTxt = pEdit->GetText(); sal_Unicode cChar = ( aTxt.Len() > 0 ) ? aTxt.GetChar(0) : ' '; aShortStr.SetChar( nPos, cChar ); - aShortStr.EraseTrailingChars(); - aShortName.SetText( aShortStr ); + aShortName.SetText(comphelper::string::stripEnd(aShortStr, ' ')); } return 0; } diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx index 2e0a2f381668..843514b1a7eb 100644 --- a/cui/source/options/optjava.cxx +++ b/cui/source/options/optjava.cxx @@ -53,7 +53,6 @@ // define ---------------------------------------------------------------- #define CLASSPATH_DELIMITER SAL_PATHSEPARATOR -#define STRIM( s ) s.EraseLeadingChars().EraseTrailingChars() #define BUTTON_BORDER 2 #define RESET_TIMEOUT 300 @@ -745,8 +744,8 @@ SvxJavaParameterDlg::~SvxJavaParameterDlg() IMPL_LINK_NOARG(SvxJavaParameterDlg, ModifyHdl_Impl) { - String sParam = STRIM( m_aParameterEdit.GetText() ); - m_aAssignBtn.Enable( sParam.Len() > 0 ); + rtl::OUString sParam = comphelper::string::strip(m_aParameterEdit.GetText(), ' '); + m_aAssignBtn.Enable(!sParam.isEmpty()); return 0; } @@ -755,8 +754,8 @@ IMPL_LINK_NOARG(SvxJavaParameterDlg, ModifyHdl_Impl) IMPL_LINK_NOARG(SvxJavaParameterDlg, AssignHdl_Impl) { - String sParam = STRIM( m_aParameterEdit.GetText() ); - if ( sParam.Len() > 0 ) + rtl::OUString sParam = comphelper::string::strip(m_aParameterEdit.GetText(), ' '); + if (!sParam.isEmpty()) { sal_uInt16 nPos = m_aAssignedList.GetEntryPos( sParam ); if ( LISTBOX_ENTRY_NOTFOUND == nPos ) |