diff options
Diffstat (limited to 'sw/source/filter')
-rw-r--r-- | sw/source/filter/html/css1atr.cxx | 3 | ||||
-rw-r--r-- | sw/source/filter/html/htmlatr.cxx | 3 | ||||
-rw-r--r-- | sw/source/filter/html/htmlbas.cxx | 5 | ||||
-rw-r--r-- | sw/source/filter/html/htmlfldw.cxx | 7 | ||||
-rw-r--r-- | sw/source/filter/html/htmlgrin.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/html/parcss1.cxx | 3 | ||||
-rw-r--r-- | sw/source/filter/html/swhtml.cxx | 5 | ||||
-rw-r--r-- | sw/source/filter/rtf/rtffld.cxx | 11 |
8 files changed, 19 insertions, 20 deletions
diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index c440f955bd3c..116fca8c32a1 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -27,6 +27,7 @@ ************************************************************************/ #include "hintids.hxx" +#include <comphelper/string.hxx> #include <vcl/svapp.hxx> #include <vcl/wrkwin.hxx> #include <svl/whiter.hxx> @@ -1217,7 +1218,7 @@ void SwHTMLWriter::PrepareFontList( const SvxFontItem& rFontItem, while( nStrPos != STRING_NOTFOUND ) { String aName = rName.GetToken( 0, ';', nStrPos ); - aName.EraseTrailingChars().EraseLeadingChars(); + aName = comphelper::string::strip(aName, ' '); if( !aName.Len() ) continue; diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index c72b588ae5af..389c75718e89 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -28,6 +28,7 @@ #include <hintids.hxx> #include <com/sun/star/i18n/ScriptType.hpp> +#include <comphelper/string.hxx> #include <vcl/svapp.hxx> #include <vcl/wrkwin.hxx> #include <sfx2/sfx.hrc> @@ -3005,7 +3006,7 @@ Writer& OutHTML_INetFmt( Writer& rWrt, const SwFmtINetFmt& rINetFmt, sal_Bool bO sRel = aURL.Copy( nPos+1 ); aURL.Erase( nPos ); } - aURL.EraseLeadingChars().EraseTrailingChars(); + aURL = comphelper::string::strip(aURL, ' '); sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_href).append("=\""); rWrt.Strm() << sOut.makeStringAndClear().getStr(); diff --git a/sw/source/filter/html/htmlbas.cxx b/sw/source/filter/html/htmlbas.cxx index 1ee17bb73717..9dc4cefc6954 100644 --- a/sw/source/filter/html/htmlbas.cxx +++ b/sw/source/filter/html/htmlbas.cxx @@ -27,6 +27,7 @@ ************************************************************************/ #include <hintids.hxx> +#include <comphelper/string.hxx> #include <rtl/strbuf.hxx> #include <sfx2/sfx.hrc> #include <svl/svstdarr.hxx> @@ -203,7 +204,7 @@ void SwHTMLParser::AddScriptSource() { aBasicLib = aToken.Copy( nPos + sizeof(OOO_STRING_SVTOOLS_HTML_SB_library) - 1 ); - aBasicLib.EraseLeadingChars().EraseTrailingChars(); + aBasicLib = comphelper::string::strip(aBasicLib, ' '); } } @@ -214,7 +215,7 @@ void SwHTMLParser::AddScriptSource() { aBasicModule = aToken.Copy( nPos + sizeof(OOO_STRING_SVTOOLS_HTML_SB_module) - 1 ); - aBasicModule.EraseLeadingChars().EraseTrailingChars(); + aBasicModule = comphelper::string::strip(aBasicModule, ' '); } } diff --git a/sw/source/filter/html/htmlfldw.cxx b/sw/source/filter/html/htmlfldw.cxx index 88f6df9b9337..a4fe67a21c45 100644 --- a/sw/source/filter/html/htmlfldw.cxx +++ b/sw/source/filter/html/htmlfldw.cxx @@ -27,6 +27,7 @@ ************************************************************************/ #include <com/sun/star/i18n/ScriptType.hpp> +#include <comphelper/string.hxx> #include <tools/string.hxx> #include <svtools/htmlkywd.hxx> #include <svtools/htmlout.hxx> @@ -447,8 +448,7 @@ Writer& OutHTML_SwFmtFld( Writer& rWrt, const SfxPoolItem& rHt ) else if (pFldTyp->GetName() != "HTML_OFF") return rWrt; - String rTxt( pFld->GetPar2() ); - rTxt.EraseLeadingChars().EraseTrailingChars(); + String rTxt(comphelper::string::strip(pFld->GetPar2(), ' ')); rWrt.Strm() << '<'; if( !bOn ) rWrt.Strm() << '/'; @@ -485,8 +485,7 @@ Writer& OutHTML_SwFmtFld( Writer& rWrt, const SfxPoolItem& rHt ) '>' == rComment.GetChar(rComment.Len()-1) && rComment.Copy(0,5).EqualsIgnoreCaseAscii("HTML:") ) { - String sComment( rComment.Copy(5) ); - sComment.EraseLeadingChars(); + String sComment(comphelper::string::stripStart(rComment.Copy(5), ' ')); if( '<' == sComment.GetChar(0) ) { sComment = convertLineEnd(sComment, GetSystemLineEnd()); diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index 2a3dbf29905b..789292e460cd 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -634,7 +634,7 @@ IMAGE_SETEVENT: } // Image-Map setzen - aMap.EraseTrailingChars(); + aMap = comphelper::string::stripEnd(aMap, ' '); if( aMap.Len() ) { // Da wir nur lokale Image-Maps kennen nehmen wireinfach alles diff --git a/sw/source/filter/html/parcss1.cxx b/sw/source/filter/html/parcss1.cxx index cf2adc6597b1..1bfcb6cd020f 100644 --- a/sw/source/filter/html/parcss1.cxx +++ b/sw/source/filter/html/parcss1.cxx @@ -1261,8 +1261,7 @@ sal_Bool CSS1Expression::GetURL( String& rURL ) const if( aValue.Len() > 5 ) { rURL = aValue.Copy( 4, aValue.Len()-5 ); - rURL.EraseTrailingChars(); - rURL.EraseLeadingChars(); + rURL = comphelper::string::strip(rURL, ' '); bRet = sal_True; } diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 703cef0be78d..2f0819454571 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -1963,8 +1963,7 @@ void SwHTMLParser::NextToken( int nToken ) ' ' == aToken.GetChar( aToken.Len()-3 ) ) { String aComment( aToken.Copy( 3, aToken.Len()-5 ) ); - aComment.EraseLeadingChars().EraseTrailingChars(); - InsertComment( aComment ); + InsertComment(comphelper::string::strip(aComment, ' ')); } else { @@ -3709,7 +3708,7 @@ void SwHTMLParser::NewFontAttr( int nToken ) while( nStrPos!=STRING_NOTFOUND ) { String aFName = aFace.GetToken( 0, ',', nStrPos ); - aFName.EraseTrailingChars().EraseLeadingChars(); + aFName = comphelper::string::strip(aFName, ' '); if( aFName.Len() ) { if( !bFound && pFList ) 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 ); |