diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-11-18 21:03:31 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-11-19 21:11:02 +0000 |
commit | ca02d728082a86780d68ede7b9d565128dbc0434 (patch) | |
tree | 8c0a857ad73f89d592295f99e5f72a0c96e55e57 /vcl | |
parent | e4ff699291ddab16d70aa9b11c717e34dfbe5414 (diff) |
remove [Byte]String::EraseAllChars
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/aqua/source/window/salmenu.cxx | 10 | ||||
-rw-r--r-- | vcl/source/app/svdata.cxx | 9 | ||||
-rw-r--r-- | vcl/source/control/edit.cxx | 11 | ||||
-rw-r--r-- | vcl/source/control/field.cxx | 8 |
4 files changed, 20 insertions, 18 deletions
diff --git a/vcl/aqua/source/window/salmenu.cxx b/vcl/aqua/source/window/salmenu.cxx index 509ef731ab75..368ca6ed9154 100644 --- a/vcl/aqua/source/window/salmenu.cxx +++ b/vcl/aqua/source/window/salmenu.cxx @@ -26,6 +26,8 @@ * ************************************************************************/ +#include <comphelper/string.hxx> + #include "rtl/ustrbuf.hxx" #include "vcl/cmdevt.hxx" @@ -682,10 +684,8 @@ void AquaSalMenu::SetItemText( unsigned /*i_nPos*/, SalMenuItem* i_pSalMenuItem, AquaSalMenuItem *pAquaSalMenuItem = (AquaSalMenuItem *) i_pSalMenuItem; - String aText( i_rText ); - // Delete mnemonics - aText.EraseAllChars( '~' ); + String aText( comphelper::string::remove(i_rText, '~') ); /* #i90015# until there is a correct solution strip out any appended (.*) in menubar entries @@ -933,10 +933,8 @@ AquaSalMenuItem::AquaSalMenuItem( const SalItemParams* pItemData ) : mpSubMenu( NULL ), mpMenuItem( nil ) { - String aText( pItemData->aText ); - // Delete mnemonics - aText.EraseAllChars( '~' ); + String aText( comphelper::string::remove(pItemData->aText, '~') ); if (pItemData->eType == MENUITEM_SEPARATOR) { diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx index 10f7e50d9aad..f076bea45ee6 100644 --- a/vcl/source/app/svdata.cxx +++ b/vcl/source/app/svdata.cxx @@ -33,6 +33,7 @@ #include <boost/ptr_container/ptr_vector.hpp> +#include <comphelper/string.hxx> #include <osl/file.hxx> #include <osl/mutex.hxx> @@ -290,11 +291,11 @@ FieldUnitStringList* ImplGetCleanedFieldUnits() size_t nUnits = pUnits->size(); pSVData->maCtrlData.mpCleanUnitStrings = new FieldUnitStringList(); pSVData->maCtrlData.mpCleanUnitStrings->reserve( nUnits ); - for( size_t i = 0; i < nUnits; i++ ) + for( size_t i = 0; i < nUnits; ++i ) { - String aUnit( (*pUnits)[i].first ); - aUnit.EraseAllChars( sal_Unicode( ' ' ) ); - aUnit.ToLowerAscii(); + rtl::OUString aUnit( (*pUnits)[i].first ); + aUnit = comphelper::string::remove(aUnit, ' '); + aUnit = aUnit.toAsciiLowerCase(); std::pair< String, FieldUnit > aElement( aUnit, (*pUnits)[i].second ); pSVData->maCtrlData.mpCleanUnitStrings->push_back( aElement ); } diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index a0a81e93a573..35b35cafc66a 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -68,8 +68,9 @@ #include <com/sun/star/uno/Any.hxx> -#include <comphelper/processfactory.hxx> #include <comphelper/configurationhelper.hxx> +#include <comphelper/processfactory.hxx> +#include <comphelper/string.hxx> #include <sot/exchange.hxx> #include <sot/formats.hxx> @@ -781,10 +782,10 @@ void Edit::ImplDelete( const Selection& rSelection, sal_uInt8 nDirection, sal_uI String Edit::ImplGetValidString( const String& rString ) const { - String aValidString( rString ); - aValidString.EraseAllChars( _LF ); - aValidString.EraseAllChars( _CR ); - aValidString.SearchAndReplaceAll( '\t', ' ' ); + rtl::OUString aValidString( rString ); + aValidString = comphelper::string::remove(aValidString, _LF); + aValidString = comphelper::string::remove(aValidString, _CR); + aValidString = aValidString.replace('\t', ' '); return aValidString; } diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx index 54e900c7bef1..4f56bad14046 100644 --- a/vcl/source/control/field.cxx +++ b/vcl/source/control/field.cxx @@ -29,6 +29,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_vcl.hxx" +#include <comphelper/string.hxx> + #ifndef _BIGINT_HXX #define _TOOLS_BIGINT #include "tools/bigint.hxx" @@ -1140,9 +1142,9 @@ static FieldUnit ImplStringToMetric( const String &rMetricString ) if( pList ) { // return FieldUnit - String aStr( rMetricString ); - aStr.ToLowerAscii(); - aStr.EraseAllChars( sal_Unicode( ' ' ) ); + rtl::OUString aStr( rMetricString ); + aStr = aStr.toAsciiLowerCase(); + aStr = comphelper::string::remove(aStr, ' '); for( FieldUnitStringList::const_iterator it = pList->begin(); it != pList->end(); ++it ) { if ( it->first.Equals( aStr ) ) |