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 /svtools | |
parent | 2106d8e648449d34b195068eef5f672a14ea64a8 (diff) |
remove EraseLeadingChars and EraseTrailingChars
Change-Id: Ib9797fe97cd008cc6508ce8cec47dc5373416892
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/control/ctrlbox.cxx | 7 | ||||
-rw-r--r-- | svtools/source/dialogs/filedlg2.cxx | 6 | ||||
-rw-r--r-- | svtools/source/svhtml/parhtml.cxx | 6 |
3 files changed, 8 insertions, 11 deletions
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index 15eae11b366e..9b29a8274368 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -34,6 +34,7 @@ #include <vcl/helper.hxx> #include <sal/macros.h> #include <comphelper/processfactory.hxx> +#include <comphelper/string.hxx> #include <unotools/charclass.hxx> #include <svtools/sampletext.hxx> @@ -1710,8 +1711,7 @@ void FontSizeBox::Modify() if ( bRelativeMode ) { - XubString aStr = GetText(); - aStr.EraseLeadingChars(); + XubString aStr = comphelper::string::stripStart(GetText(), ' '); sal_Bool bNewMode = bRelative; sal_Bool bOldPtRelMode = bPtRelative; @@ -1876,8 +1876,7 @@ void FontSizeBox::SetRelative( sal_Bool bNewRelative ) if ( bRelativeMode ) { Selection aSelection = GetSelection(); - XubString aStr = GetText(); - aStr.EraseLeadingChars(); + XubString aStr = comphelper::string::stripStart(GetText(), ' '); if ( bNewRelative ) { diff --git a/svtools/source/dialogs/filedlg2.cxx b/svtools/source/dialogs/filedlg2.cxx index 2b7425541841..5785246090e0 100644 --- a/svtools/source/dialogs/filedlg2.cxx +++ b/svtools/source/dialogs/filedlg2.cxx @@ -81,7 +81,7 @@ KbdListBox::PreNotify( NotifyEvent& rNEvt ) for ( sal_uInt16 i = 1; i < nEntries; i++ ) { UniString aEntry = GetEntry ( (i + nCurrentPos) % nEntries ); - aEntry.EraseLeadingChars( ' ' ); + aEntry = comphelper::string::stripStart(aEntry, ' '); aEntry.ToUpperAscii(); UniString aCompare( cCharCode ); aCompare.ToUpperAscii(); @@ -266,8 +266,8 @@ IMPL_LINK( ImpPathDialog, SelectHdl, ListBox *, p ) // isolate the pure name of the entry // removing trainling stuff and leading spaces UniString aEntry( pDirList->GetSelectEntry() ); + aEntry = comphelper::string::stripStart(aEntry, ' '); - aEntry.EraseLeadingChars( ' ' ); sal_uInt16 nPos = aEntry.Search( '/' ); aEntry.Erase( nPos ); @@ -360,7 +360,7 @@ IMPL_LINK( ImpPathDialog, DblClickHdl, ListBox*, pBox ) // removing trainling stuff and leading spaces UniString aEntry( pBox->GetSelectEntry() ); - aEntry.EraseLeadingChars( ' ' ); + aEntry = comphelper::string::stripStart(aEntry, ' '); sal_uInt16 nPos = aEntry.Search( '/' ); aEntry.Erase( nPos ); diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx index d1c588cd5e81..36b81ecf73c4 100644 --- a/svtools/source/svhtml/parhtml.cxx +++ b/svtools/source/svhtml/parhtml.cxx @@ -153,8 +153,7 @@ sal_uInt32 HTMLOption::GetNumber() const nToken<HTML_OPTION_CONTEXT_END) || nToken==HTML_O_VALUE, "GetNumber: Option not numerical" ); - String aTmp( aValue ); - aTmp.EraseLeadingChars(); + String aTmp(comphelper::string::stripStart(aValue, ' ')); sal_Int32 nTmp = aTmp.ToInt32(); return nTmp >= 0 ? (sal_uInt32)nTmp : 0; } @@ -164,8 +163,7 @@ sal_Int32 HTMLOption::GetSNumber() const DBG_ASSERT( (nToken>=HTML_OPTION_NUMBER_START && nToken<HTML_OPTION_NUMBER_END) || (nToken>=HTML_OPTION_CONTEXT_START && nToken<HTML_OPTION_CONTEXT_END), "GetSNumber: Option not numerical" ); - String aTmp( aValue ); - aTmp.EraseLeadingChars(); + String aTmp(comphelper::string::stripStart(aValue, ' ')); return aTmp.ToInt32(); } |