diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-11-23 22:17:24 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-11-23 23:16:45 +0000 |
commit | 709c1f365b3bdd0d46ec4f1ddc244580a0dfa637 (patch) | |
tree | 63668e23e125bf3fd1921f906cc269ed6ece8f38 /sc | |
parent | 868bd3b778b6c7b970c67d1dacc469967f69e551 (diff) |
remove various EraseLeadingAndTrailingChars
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/dpobject.cxx | 6 | ||||
-rw-r--r-- | sc/source/filter/html/htmlpars.cxx | 4 | ||||
-rw-r--r-- | sc/source/filter/rtf/eeimpars.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/cctrl/editfield.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/dbgui/validate.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/formdlg/dwfunctr.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/conflictsdlg.cxx | 4 |
7 files changed, 18 insertions, 17 deletions
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index 9c0663df45fa..afa8148f8469 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -73,6 +73,7 @@ #include <com/sun/star/sheet/XDrillDownDataSupplier.hpp> #include <comphelper/processfactory.hxx> +#include <comphelper/string.hxx> #include <comphelper/types.hxx> #include <sal/macros.h> #include <tools/debug.hxx> @@ -1210,7 +1211,7 @@ bool lcl_ParseFunction( const String& rList, xub_StrLen nStartPos, xub_StrLen& r if ( bParsed ) { - aFuncStr.EraseLeadingAndTrailingChars( ' ' ); + aFuncStr = comphelper::string::strip(aFuncStr, ' '); const sal_Int32 nFuncCount = SAL_N_ELEMENTS(aFunctions); for ( sal_Int32 nFunc=0; nFunc<nFuncCount && !bFound; nFunc++ ) @@ -1429,8 +1430,7 @@ bool ScDPObject::ParseFilters( ScDPGetPivotDataField& rTarget, bool bError = false; bool bHasData = false; - String aRemaining( rFilterList ); - aRemaining.EraseLeadingAndTrailingChars( ' ' ); + String aRemaining(comphelper::string::strip(rFilterList, ' ')); while ( aRemaining.Len() && !bError ) { bool bUsed = false; diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx index ec64e46d2c78..a2486a1ca3bd 100644 --- a/sc/source/filter/html/htmlpars.cxx +++ b/sc/source/filter/html/htmlpars.cxx @@ -30,6 +30,7 @@ #include "precompiled_sc.hxx" #include <boost/shared_ptr.hpp> +#include <comphelper/string.hxx> #define SC_HTMLPARS_CXX #include "scitems.hxx" @@ -3052,8 +3053,7 @@ void ScHTMLQueryParser::FontOn( const ImportInfo& rInfo ) while( nPos != STRING_NOTFOUND ) { // font list separator: VCL = ';' HTML = ',' - String aFName = rFace.GetToken( 0, ',', nPos ); - aFName.EraseLeadingAndTrailingChars(); + String aFName = comphelper::string::strip(rFace.GetToken(0, ',', nPos), ' '); ScGlobal::AddToken( aFontName, aFName, ';' ); } if ( aFontName.Len() ) diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx index 983e88c44abb..050ac57b4889 100644 --- a/sc/source/filter/rtf/eeimpars.cxx +++ b/sc/source/filter/rtf/eeimpars.cxx @@ -53,6 +53,7 @@ #include <vcl/svapp.hxx> #include <unotools/syslocale.hxx> #include <unotools/charclass.hxx> +#include <comphelper/string.hxx> #include "eeimport.hxx" #include "global.hxx" @@ -358,8 +359,7 @@ void ScEEImport::WriteToDocument( sal_Bool bSizeColsRows, double nOutputFactor, } else { - aStr = mpEngine->GetText( pE->aSel ); - aStr.EraseLeadingAndTrailingChars(); + aStr = comphelper::string::strip(mpEngine->GetText(pE->aSel), ' '); } bool bTextFormat = false; diff --git a/sc/source/ui/cctrl/editfield.cxx b/sc/source/ui/cctrl/editfield.cxx index d52ccefea685..78597121de7d 100644 --- a/sc/source/ui/cctrl/editfield.cxx +++ b/sc/source/ui/cctrl/editfield.cxx @@ -33,6 +33,7 @@ #undef SC_DLLIMPLEMENTATION #endif #include "editfield.hxx" +#include <comphelper/string.hxx> #include <rtl/math.hxx> #include <unotools/localedatawrapper.hxx> #include "global.hxx" @@ -62,15 +63,14 @@ ScDoubleField::ScDoubleField( Window* pParent, const ResId& rResId ) : bool ScDoubleField::GetValue( double& rfValue ) const { - String aStr( GetText() ); - aStr.EraseLeadingAndTrailingChars( ' ' ); - bool bOk = aStr.Len() > 0; + rtl::OUString aStr(comphelper::string::strip(GetText(), ' ')); + bool bOk = aStr.getLength() > 0; if( bOk ) { rtl_math_ConversionStatus eStatus; sal_Int32 nEnd; rfValue = rtl::math::stringToDouble( aStr, lclGetDecSep(), lclGetGroupSep(), &eStatus, &nEnd ); - bOk = (eStatus == rtl_math_ConversionStatus_Ok) && (nEnd == static_cast< sal_Int32 >( aStr.Len() )); + bOk = (eStatus == rtl_math_ConversionStatus_Ok) && (nEnd == aStr.getLength() ); } return bOk; } diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx index deafffa06116..b1eec3974436 100644 --- a/sc/source/ui/dbgui/validate.cxx +++ b/sc/source/ui/dbgui/validate.cxx @@ -33,6 +33,7 @@ #undef SC_DLLIMPLEMENTATION #endif +#include <comphelper/string.hxx> #include <vcl/svapp.hxx> #include <svl/aeitem.hxx> #include <svl/stritem.hxx> @@ -293,7 +294,7 @@ bool lclGetStringListFromFormula( String& rStringList, const String& rFmlaStr, s for( xub_StrLen nToken = 0, nStringIx = 0; bIsStringList && (nToken < nTokenCnt); ++nToken ) { String aToken( rFmlaStr.GetQuotedToken( 0, aQuotes, cFmlaSep, nStringIx ) ); - aToken.EraseLeadingAndTrailingChars(); + aToken = comphelper::string::strip(aToken, ' '); if( aToken.Len() ) // ignore empty tokens, i.e. "a";;"b" { bIsStringList = ScGlobal::IsQuoted( aToken, '"' ); diff --git a/sc/source/ui/formdlg/dwfunctr.cxx b/sc/source/ui/formdlg/dwfunctr.cxx index e923f66b31d0..6c619a699bc8 100644 --- a/sc/source/ui/formdlg/dwfunctr.cxx +++ b/sc/source/ui/formdlg/dwfunctr.cxx @@ -29,7 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sc.hxx" -// INCLUDE --------------------------------------------------------------- +#include <comphelper/string.hxx> #include <editeng/editview.hxx> #include <sfx2/bindings.hxx> #include <sfx2/dispatch.hxx> @@ -877,7 +877,7 @@ void ScFunctionDockWin::DoEnter(sal_Bool /* bOk */) //@@ ??? // NOTE: Theoretically the first parameter could have the // suppress flag as well, but practically it doesn't. aFirstArgStr = *(pDesc->ppDefArgNames[0]); - aFirstArgStr.EraseLeadingAndTrailingChars(); + aFirstArgStr = comphelper::string::strip(aFirstArgStr, ' '); aFirstArgStr.SearchAndReplaceAll(' ', '_'); aArgStr = aFirstArgStr; if ( nArgs != VAR_ARGS ) @@ -891,7 +891,7 @@ void ScFunctionDockWin::DoEnter(sal_Bool /* bOk */) //@@ ??? { aArgStr += aArgSep; String sTmp(*(pDesc->ppDefArgNames[nArg])); - sTmp.EraseLeadingAndTrailingChars(); + sTmp = comphelper::string::strip(sTmp, ' '); sTmp.SearchAndReplaceAll(' ', '_'); aArgStr += sTmp; } diff --git a/sc/source/ui/miscdlgs/conflictsdlg.cxx b/sc/source/ui/miscdlgs/conflictsdlg.cxx index b2bfe045b7ff..1b617e023050 100644 --- a/sc/source/ui/miscdlgs/conflictsdlg.cxx +++ b/sc/source/ui/miscdlgs/conflictsdlg.cxx @@ -31,6 +31,7 @@ //----------------------------------------------------------------------------- +#include <comphelper/string.hxx> #include <vcl/msgbox.hxx> #include "conflictsdlg.hxx" @@ -503,8 +504,7 @@ String ScConflictsDlg::GetActionString( const ScChangeAction* pAction, ScDocumen aString += aDesc; aString += '\t'; - String aUser = pAction->GetUser(); - aUser.EraseLeadingAndTrailingChars(); + String aUser = comphelper::string::strip(pAction->GetUser(), ' '); if ( aUser.Len() == 0 ) { aUser = maStrUnknownUser; |