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 /sw/source/filter/rtf | |
parent | 2106d8e648449d34b195068eef5f672a14ea64a8 (diff) |
remove EraseLeadingChars and EraseTrailingChars
Change-Id: Ib9797fe97cd008cc6508ce8cec47dc5373416892
Diffstat (limited to 'sw/source/filter/rtf')
-rw-r--r-- | sw/source/filter/rtf/rtffld.cxx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sw/source/filter/rtf/rtffld.cxx b/sw/source/filter/rtf/rtffld.cxx index 5886fcf1bf61..a22170c08a2b 100644 --- a/sw/source/filter/rtf/rtffld.cxx +++ b/sw/source/filter/rtf/rtffld.cxx @@ -136,8 +136,7 @@ static RTF_FLD_TYPES _WhichFld( String& rName, String& rNext ) if( !rName.Len() ) return RTFFLD_UNKNOWN; - String sNm( rName ); - sNm = sNm.EraseLeadingChars().GetToken(0, ' '); + String sNm(comphelper::string::stripStart(rName, ' ').getToken(0, ' ')); OSL_ENSURE( sNm.Len(), "Feldname hat keine Laenge!" ); if( !sNm.Len() ) return RTFFLD_UNKNOWN; @@ -208,9 +207,9 @@ public: }; RtfFieldSwitch::RtfFieldSwitch( const String& rParam ) - : sParam( rParam ), nCurPos( 0 ) + : nCurPos( 0 ) { - sParam.EraseTrailingChars().EraseLeadingChars(); + sParam = comphelper::string::strip(rParam, ' '); } sal_Unicode RtfFieldSwitch::GetSwitch( String& rParam ) @@ -239,7 +238,7 @@ sal_Unicode RtfFieldSwitch::GetSwitch( String& rParam ) sParam.Erase( 0, nCurPos + nOffset ); rParam = sParam.GetToken( 0, c ); - sParam.Erase( 0, rParam.Len() + nOffset ).EraseLeadingChars(); + sParam = comphelper::string::stripStart(sParam.Erase(0, rParam.Len() + nOffset), ' '); if( '\\' == c ) rParam = comphelper::string::stripEnd(rParam, ' '); nCurPos = 0; @@ -869,7 +868,7 @@ int SwRTFParser::MakeFieldInst( String& rFieldStr ) default: { // keines von den bekannten Feldern, also eine neues UserField - aSaveStr.EraseLeadingChars().EraseTrailingChars(); + aSaveStr = comphelper::string::strip(aSaveStr, ' '); SwUserFieldType aTmp( pDoc, aSaveStr ); SwUserField aUFld( (SwUserFieldType*)pDoc->InsertFldType( aTmp )); aUFld.ChangeFormat( UF_STRING ); |