diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-11-22 23:40:24 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-11-23 10:10:09 +0000 |
commit | b7ea36101497c275cb08b0e37facbde656197d9b (patch) | |
tree | a05e25d4f01c94c69712d17a1ab4cdbc925ef355 /sw | |
parent | 62d880f3228c7f5c3f8a1d30f5a5c9ed390a1eb5 (diff) |
add stripStart, can replace EraseTrailingChars
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/html/htmlform.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/rtf/rtffld.cxx | 5 | ||||
-rw-r--r-- | sw/source/filter/rtf/swparrtf.cxx | 3 |
3 files changed, 7 insertions, 5 deletions
diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx index 7f234e8fd577..857395fa3f92 100644 --- a/sw/source/filter/html/htmlform.cxx +++ b/sw/source/filter/html/htmlform.cxx @@ -2523,8 +2523,8 @@ void SwHTMLParser::EndSelect() for( i = 0; i < nEntryCnt; i++ ) { - String sText( *pFormImpl->GetStringList()[i] ); - sText.EraseTrailingChars(); + rtl::OUString sText( *pFormImpl->GetStringList()[i] ); + sText = comphelper::string::stripEnd(sText, ' '); pStrings[i] = sText; sText = *pFormImpl->GetValueList()[i]; diff --git a/sw/source/filter/rtf/rtffld.cxx b/sw/source/filter/rtf/rtffld.cxx index 7bb6210714a8..44563d0c3ca3 100644 --- a/sw/source/filter/rtf/rtffld.cxx +++ b/sw/source/filter/rtf/rtffld.cxx @@ -34,6 +34,7 @@ #include <sal/macros.h> #include <com/sun/star/i18n/ScriptType.hdl> +#include <comphelper/string.hxx> #include <vcl/graph.hxx> #include <svl/urihelper.hxx> #include <svtools/rtftoken.h> @@ -159,7 +160,7 @@ static RTF_FLD_TYPES _WhichFld( String& rName, String& rNext ) nFndPos += nTokenStt + static_cast< xub_StrLen >(nLen); while( rNext.GetChar( nFndPos ) == ' ' ) ++nFndPos; rNext.Erase( 0, nFndPos ); - rNext.EraseTrailingChars(); + rNext = comphelper::string::stripEnd(rNext, ' '); return aFldNmArr[n].eFldType; } } @@ -242,7 +243,7 @@ sal_Unicode RtfFieldSwitch::GetSwitch( String& rParam ) rParam = sParam.GetToken( 0, c ); sParam.Erase( 0, rParam.Len() + nOffset ).EraseLeadingChars(); if( '\\' == c ) - rParam.EraseTrailingChars(); + rParam = comphelper::string::stripEnd(rParam, ' '); nCurPos = 0; return cKey; diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx index 38236e6ccee8..b381ad08fba6 100644 --- a/sw/source/filter/rtf/swparrtf.cxx +++ b/sw/source/filter/rtf/swparrtf.cxx @@ -105,6 +105,7 @@ #include <svx/svdoutl.hxx> #include <unotools/streamwrap.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/string.hxx> #include <editeng/outlobj.hxx> #include <editeng/paperinf.hxx> @@ -1583,7 +1584,7 @@ sal_uInt16 SwRTFParser::ReadRevTbl() break; case RTF_TEXTTOKEN: - aToken.EraseTrailingChars(';'); + aToken = comphelper::string::stripEnd(aToken, ';'); sal_uInt16 nSWId = pDoc->InsertRedlineAuthor(aToken); // Store matchpair |