summaryrefslogtreecommitdiff
path: root/sw/source/filter/rtf
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-11-22 23:40:24 +0000
committerCaolán McNamara <caolanm@redhat.com>2011-11-23 10:10:09 +0000
commitb7ea36101497c275cb08b0e37facbde656197d9b (patch)
treea05e25d4f01c94c69712d17a1ab4cdbc925ef355 /sw/source/filter/rtf
parent62d880f3228c7f5c3f8a1d30f5a5c9ed390a1eb5 (diff)
add stripStart, can replace EraseTrailingChars
Diffstat (limited to 'sw/source/filter/rtf')
-rw-r--r--sw/source/filter/rtf/rtffld.cxx5
-rw-r--r--sw/source/filter/rtf/swparrtf.cxx3
2 files changed, 5 insertions, 3 deletions
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