diff options
-rw-r--r-- | automation/source/testtool/objtest.cxx | 5 | ||||
-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 | ||||
-rw-r--r-- | shell/source/tools/lngconvex/lngconvex.cxx | 3 | ||||
-rw-r--r-- | shell/source/tools/lngconvex/makefile.mk | 8 | ||||
-rw-r--r-- | starmath/source/cursor.cxx | 2 | ||||
-rw-r--r-- | starmath/source/node.cxx | 4 | ||||
-rw-r--r-- | svl/source/misc/lngmisc.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/rtf/rtffld.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par5.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8scan.cxx | 2 | ||||
-rw-r--r-- | vcl/source/control/combobox.cxx | 7 | ||||
-rw-r--r-- | vcl/source/control/field.cxx | 2 | ||||
-rw-r--r-- | vcl/source/control/longcurr.cxx | 3 | ||||
-rw-r--r-- | vcl/source/window/toolbox2.cxx | 3 |
20 files changed, 45 insertions, 37 deletions
diff --git a/automation/source/testtool/objtest.cxx b/automation/source/testtool/objtest.cxx index 6659f663da5c..7da2f47d2808 100644 --- a/automation/source/testtool/objtest.cxx +++ b/automation/source/testtool/objtest.cxx @@ -43,6 +43,7 @@ #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/frame/XDesktop.hpp> #include <comphelper/processfactory.hxx> +#include <comphelper/string.hxx> #include <com/sun/star/bridge/XBridgeFactory.hpp> #include <com/sun/star/connection/XConnector.hpp> #include <com/sun/star/connection/XConnection.hpp> @@ -2897,8 +2898,8 @@ HACK("Ich gestehe alles: Ich war zu faul das richtig zu machen.") do { nOldLen = aSuffix.Len(); - aSuffix.EraseLeadingAndTrailingChars( ' ' ); - aSuffix.EraseLeadingAndTrailingChars( 0x09 ); + aSuffix = comphelper::string::strip(aSuffix, ' '); + aSuffix = comphelper::string::strip(aSuffix, 0x09); } while ( nOldLen != aSuffix.Len() ); aSource.Erase(nTestCase,nTcEnd-nTestCase); aSource.Insert(CUniString("Sub ").Append(aSuffix).AppendAscii(" CaseLog \"").Append(aSuffix).AppendAscii("\" : on error goto endcse : TestEnter "),nTestCase); 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; diff --git a/shell/source/tools/lngconvex/lngconvex.cxx b/shell/source/tools/lngconvex/lngconvex.cxx index 8ba8653ea749..005c8c742578 100644 --- a/shell/source/tools/lngconvex/lngconvex.cxx +++ b/shell/source/tools/lngconvex/lngconvex.cxx @@ -57,6 +57,7 @@ typedef unsigned short WORD; #include "cmdline.hxx" +#include <comphelper/string.hxx> #include "osl/thread.h" #include "osl/process.h" #include "osl/file.hxx" @@ -347,7 +348,7 @@ void add_group_entries( { Substitutor.set_language(iso_lang_identifier(iso_lang)); - key_value_utf8.EraseLeadingAndTrailingChars('\"'); + key_value_utf8 = comphelper::string::strip(key_value_utf8, '\"'); OUString key_value_utf16 = rtl::OStringToOUString(key_value_utf8, RTL_TEXTENCODING_UTF8); diff --git a/shell/source/tools/lngconvex/makefile.mk b/shell/source/tools/lngconvex/makefile.mk index bf711520209f..4d3971b81490 100644 --- a/shell/source/tools/lngconvex/makefile.mk +++ b/shell/source/tools/lngconvex/makefile.mk @@ -54,9 +54,11 @@ APP1TARGET=$(TARGET) APP1OBJS=$(OBJ)$/$(TARGET).obj\ $(OBJ)$/cmdline.obj APP1RPATH = NONE -APP1STDLIBS= $(SALLIB)\ - $(TOOLSLIB)\ - $(I18NISOLANGLIB) +APP1STDLIBS= \ + $(COMPHELPERLIB)\ + $(SALLIB)\ + $(TOOLSLIB)\ + $(I18NISOLANGLIB) # --- Targets ------------------------------------------------------ diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx index 72ba885992d8..1b66fa13207b 100644 --- a/starmath/source/cursor.cxx +++ b/starmath/source/cursor.cxx @@ -1112,7 +1112,7 @@ void SmCursor::InsertSpecial(XubString aString) { BeginEdit(); Delete(); - aString.EraseLeadingAndTrailingChars(); + aString = comphelper::string::strip(aString, ' '); aString = comphelper::string::stripStart(aString, '%'); //Create instance of special node diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index 156537ae8112..e7c6ebcf89de 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -1677,7 +1677,7 @@ void SmBraceNode::CreateTextFromNode(String &rText) { String aStr; GetSubNode(0)->CreateTextFromNode(aStr); - aStr.EraseLeadingAndTrailingChars(); + aStr = comphelper::string::strip(aStr, ' '); aStr = comphelper::string::stripStart(aStr, '\\'); if (aStr.Len()) { @@ -1700,7 +1700,7 @@ void SmBraceNode::CreateTextFromNode(String &rText) { String aStr; GetSubNode(2)->CreateTextFromNode(aStr); - aStr.EraseLeadingAndTrailingChars(); + aStr = comphelper::string:strip(aStr, ' '); aStr = comphelper::string::stripStart(aStr, '\\'); if (aStr.Len()) { diff --git a/svl/source/misc/lngmisc.cxx b/svl/source/misc/lngmisc.cxx index 768dc4c8913c..ca1b68a6c0e5 100644 --- a/svl/source/misc/lngmisc.cxx +++ b/svl/source/misc/lngmisc.cxx @@ -157,7 +157,7 @@ String GetThesaurusReplaceText( const String &rText ) // remove any possible remaining ' ' that may confuse the thesaurus // when it gets called with the text - aText.EraseLeadingAndTrailingChars( sal_Unicode(' ') ); + aText = comphelper::string::strip(aText, ' '); return aText; } diff --git a/sw/source/filter/rtf/rtffld.cxx b/sw/source/filter/rtf/rtffld.cxx index 44563d0c3ca3..43af25460b31 100644 --- a/sw/source/filter/rtf/rtffld.cxx +++ b/sw/source/filter/rtf/rtffld.cxx @@ -408,7 +408,7 @@ int SwRTFParser::MakeFieldInst( String& rFieldStr ) case RTFFLD_IMPORT: { - aSaveStr.EraseLeadingAndTrailingChars(); + aSaveStr = comphelper::string::strip(aSaveStr, ' '); if( aSaveStr.Len() ) { sal_Unicode c = aSaveStr.GetChar( 0 ); diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 6287d8ce3bd4..edf4c7c7de0f 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -3444,10 +3444,10 @@ eF_ResT SwWW8ImplReader::Read_F_Hyperlink( WW8FieldDesc* /*pF*/, String& rStr ) String sURL, sTarget, sMark; bool bDataImport = false; - //HYPERLINk "filename" [switches] + //HYPERLINK "filename" [switches] bool bOptions=false; - rStr.EraseTrailingChars( 1 ); + rStr = comphelper::strip::stripEnd(rStr, 1); if (!bDataImport) { diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index 1d0d189336bb..032bf4a238a6 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -6251,7 +6251,7 @@ void lcl_checkFontname( String& sString ) if( bFound ) { sString = comphelper::string::remove(sString, 1); - sString.EraseLeadingAndTrailingChars( sal_Unicode( ';' ) ); + sString = comphelper::string::strip(aString, ';'); } } diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx index 0f551bf5c648..23141b6e8505 100644 --- a/vcl/source/control/combobox.cxx +++ b/vcl/source/control/combobox.cxx @@ -29,6 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_vcl.hxx" +#include <comphelper/string.hxx> #include <tools/table.hxx> #include <tools/debug.hxx> #include <tools/rc.h> @@ -58,7 +59,7 @@ static void lcl_GetSelectedEntries( Table& rSelectedPos, const XubString& rText, for( xub_StrLen n = rText.GetTokenCount( cTokenSep ); n; ) { XubString aToken = rText.GetToken( --n, cTokenSep ); - aToken.EraseLeadingAndTrailingChars( ' ' ); + aToken = comphelper::string::strip(aToken, ' '); sal_uInt16 nPos = pEntryList->FindEntry( aToken ); if ( nPos != LISTBOX_ENTRY_NOTFOUND ) rSelectedPos.Insert( ImplCreateKey( nPos ), (void*)sal_IntPtr(1L) ); @@ -402,7 +403,7 @@ IMPL_LINK( ComboBox, ImplSelectHdl, void*, EMPTYARG ) xub_StrLen nPrevIndex = nIndex; XubString aToken = aText.GetToken( 0, mcMultiSep, nIndex ); xub_StrLen nTokenLen = aToken.Len(); - aToken.EraseLeadingAndTrailingChars( ' ' ); + aToken = comphelper::string::strip(aToken, ' '); sal_uInt16 nP = mpImplLB->GetEntryList()->FindEntry( aToken ); if ( (nP != LISTBOX_ENTRY_NOTFOUND) && (!mpImplLB->GetEntryList()->IsEntryPosSelected( nP )) ) { @@ -414,7 +415,7 @@ IMPL_LINK( ComboBox, ImplSelectHdl, void*, EMPTYARG ) nIndex--; } } - aText.EraseLeadingAndTrailingChars( ' ' ); + aText = comphelper::string::strip(aText, ' '); } // Fehlende Eintraege anhaengen... diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx index 4f56bad14046..67219131ecdd 100644 --- a/vcl/source/control/field.cxx +++ b/vcl/source/control/field.cxx @@ -119,7 +119,7 @@ static sal_Bool ImplNumericGetValue( const XubString& rStr, double& rValue, return sal_False; // Fuehrende und nachfolgende Leerzeichen entfernen - aStr.EraseLeadingAndTrailingChars( ' ' ); + aStr = comphelper::string::strip(aStr, ' '); // Position des Dezimalpunktes suchen nDecPos = aStr.Search( rLocaleDataWrappper.getNumDecimalSep() ); diff --git a/vcl/source/control/longcurr.cxx b/vcl/source/control/longcurr.cxx index 34048a1c60ce..e43e746052ff 100644 --- a/vcl/source/control/longcurr.cxx +++ b/vcl/source/control/longcurr.cxx @@ -29,6 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_vcl.hxx" +#include <comphelper/string.hxx> #include <sot/object.hxx> #define _TOOLS_BIGINT #include <sot/factory.hxx> @@ -154,7 +155,7 @@ static sal_Bool ImplNumericGetValue( const XubString& rStr, BigInt& rValue, return sal_False; // Fuehrende und nachfolgende Leerzeichen entfernen - aStr.EraseLeadingAndTrailingChars( ' ' ); + aStr = comphelper::string::strip(aStr, ' '); // Position des Dezimalpunktes suchen nDecPos = aStr.Search( rLocaleDataWrapper.getNumDecimalSep() ); diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx index 3e32f5d02bf2..3be48964636f 100644 --- a/vcl/source/window/toolbox2.cxx +++ b/vcl/source/window/toolbox2.cxx @@ -29,6 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_vcl.hxx" +#include <comphelper/string.hxx> #include <tools/debug.hxx> #include <tools/rc.h> @@ -405,7 +406,7 @@ const XubString& ToolBox::ImplConvertMenuString( const XubString& rStr ) { maCvtStr = rStr; if ( mbMenuStrings ) - maCvtStr.EraseTrailingChars( '.' ); + maCvtStr = comphelper::string::stripEnd(maCvtStr, '.'); maCvtStr = MnemonicGenerator::EraseAllMnemonicChars( maCvtStr ); return maCvtStr; } |