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 /l10ntools | |
parent | 62d880f3228c7f5c3f8a1d30f5a5c9ed390a1eb5 (diff) |
add stripStart, can replace EraseTrailingChars
Diffstat (limited to 'l10ntools')
-rw-r--r-- | l10ntools/source/export.cxx | 16 | ||||
-rw-r--r-- | l10ntools/source/gsicheck.cxx | 2 | ||||
-rw-r--r-- | l10ntools/source/helpmerge.cxx | 4 | ||||
-rw-r--r-- | l10ntools/source/lngmerge.cxx | 14 | ||||
-rw-r--r-- | l10ntools/source/xrmmerge.cxx | 2 |
5 files changed, 19 insertions, 19 deletions
diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx index 2234125a420f..d00242f5db11 100644 --- a/l10ntools/source/export.cxx +++ b/l10ntools/source/export.cxx @@ -366,8 +366,8 @@ sal_Bool ResData::SetId( const ByteString &rId, sal_uInt16 nLevel ) { YYWarning( "LocalId > 255 chars, truncating..." ); sId.Erase( 255 ); - sId.EraseTrailingChars( ' ' ); - sId.EraseTrailingChars( '\t' ); + sId = comphelper::string::stripEnd(sId, ' '); + sId = comphelper::string::stripEnd(sId, '\t'); } return sal_True; @@ -643,7 +643,7 @@ int Export::Execute( int nToken, const char * pToken ) sToken = comphelper::string::remove(sToken, '\r'); sToken = comphelper::string::remove(sToken, '{'); while( sToken.SearchAndReplace( "\t", " " ) != STRING_NOTFOUND ) {}; - sToken.EraseTrailingChars( ' ' ); + sToken = comphelper::string::stripEnd(sToken, ' '); ByteString sT = getToken(sToken, 0, ' '); pResData->sResTyp = sT.ToLowerAscii(); ByteString sId( sToken.Copy( pResData->sResTyp.Len() + 1 )); @@ -1280,7 +1280,7 @@ ByteString Export::GetPairedListID( const ByteString& sText ){ ByteString sIdent = getToken(sText, 1, ';'); sIdent.ToUpperAscii(); while( sIdent.SearchAndReplace( "\t", " " ) != STRING_NOTFOUND ) {}; - sIdent.EraseTrailingChars( ' ' ); + sIdent = comphelper::string::stripEnd(sIdent, ' '); sIdent = comphelper::string::stripStart(sIdent, ' '); return sIdent; } @@ -1288,10 +1288,10 @@ ByteString Export::GetPairedListString( const ByteString& sText ){ // < "STRING" ; IDENTIFIER ; > ; ByteString sString = getToken(sText, 0, ';'); while( sString.SearchAndReplace( "\t", " " ) != STRING_NOTFOUND ) {}; - sString.EraseTrailingChars( ' ' ); + sString = comphelper::string::stripEnd(sString, ' '); ByteString s1 = sString.Copy( sString.Search( '\"' )+1 ); sString = s1.Copy( 0 , s1.SearchBackward( '\"' ) ); - sString.EraseTrailingChars( ' ' ); + sString = comphelper::string::stripEnd(sString, ' '); sString = comphelper::string::stripStart(sString, ' '); return sString; } @@ -1311,7 +1311,7 @@ sal_Bool Export::WriteExportList( ResData *pResData, ExportList *pExportList, else { sGID += "."; sGID += pResData->sId; - sGID.EraseTrailingChars( '.' ); + sGID = comphelper::string::stripEnd(sGID, '.'); } ByteString sTimeStamp( Export::GetTimeStamp()); @@ -1548,7 +1548,7 @@ ByteString Export::GetText( const ByteString &rSource, int nToken ) while( sToken.SearchAndReplace( " ", " " ) != STRING_NOTFOUND ) {}; sToken = comphelper::string::stripStart(sToken, ' '); - sToken.EraseTrailingChars( ' ' ); + sToken = comphelper::string::stripEnd(sToken, ' '); if ( sToken.Len()) { sReturn += "\\\" "; sReturn += sToken; diff --git a/l10ntools/source/gsicheck.cxx b/l10ntools/source/gsicheck.cxx index 036edafb0601..e25870236a15 100644 --- a/l10ntools/source/gsicheck.cxx +++ b/l10ntools/source/gsicheck.cxx @@ -393,7 +393,7 @@ void GSIBlock::PrintList( ParserMessageList *pList, ByteString aPrefix, aContext = pLine->GetText().Copy( 0, 300 ); else aContext = pLine->Copy( pMsg->GetTagBegin()-150, 300 ); - aContext.EraseTrailingChars(' '); + aContext = comphelper::string::stripEnd(aContext, ' '); aContext = comphelper::string::stripStart(aContext, ' '); } diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx index efa5c0cef529..5a9f82e5fe0a 100644 --- a/l10ntools/source/helpmerge.cxx +++ b/l10ntools/source/helpmerge.cxx @@ -506,8 +506,8 @@ bool HelpParser::MergeSingleFile( XMLFile* file , MergeDataFile& aMergeDataFile ByteString HelpParser::GetOutpath( const ByteString& rPathX , const ByteString& sCur , const ByteString& rPathY ){ ByteString testpath = rPathX; static const ByteString sDelimiter( DirEntry::GetAccessDelimiter(), RTL_TEXTENCODING_ASCII_US ); - testpath.EraseTrailingChars( '/' ); - testpath.EraseTrailingChars( '\\' ); + testpath = comphelper::string::stripEnd(testpath, '/'); + testpath = comphelper::string::stripEnd(testpath, '\\'); testpath += sDelimiter; testpath += sCur; testpath += sDelimiter; diff --git a/l10ntools/source/lngmerge.cxx b/l10ntools/source/lngmerge.cxx index 57216afc6f74..83affd6baed4 100644 --- a/l10ntools/source/lngmerge.cxx +++ b/l10ntools/source/lngmerge.cxx @@ -174,13 +174,13 @@ void LngParser::WriteSDF( SvFileStream &aSDFStream , ByteStringHashMap &rText_in bool LngParser::isNextGroup( ByteString &sGroup_out , ByteString &sLine_in ) { sLine_in = comphelper::string::stripStart(sLine_in, ' '); - sLine_in.EraseTrailingChars( ' ' ); + sLine_in = comphelper::string::stripEnd(sLine_in, ' '); if (( sLine_in.GetChar( 0 ) == '[' ) && ( sLine_in.GetChar( sLine_in.Len() - 1 ) == ']' )) { sGroup_out = getToken(getToken(sLine_in, 1, '['), 0, ']'); sGroup_out = comphelper::string::stripStart(sGroup_out, ' '); - sGroup_out.EraseTrailingChars( ' ' ); + sGroup_out = comphelper::string::stripEnd(sGroup_out, ' '); return true; } return false; @@ -226,13 +226,13 @@ sal_Bool LngParser::Merge( { ByteString sLine( *(*pLines)[ nPos ] ); sLine = comphelper::string::stripStart(sLine, ' '); - sLine.EraseTrailingChars( ' ' ); + sLine = comphelper::string::stripEnd(sLine, ' '); if (( sLine.GetChar( 0 ) == '[' ) && ( sLine.GetChar( sLine.Len() - 1 ) == ']' )) { sGroup = getToken(getToken(sLine, 1, '['), 0, ']'); sGroup = comphelper::string::stripStart(sGroup, ' '); - sGroup.EraseTrailingChars( ' ' ); + sGroup = comphelper::string::stripEnd(sGroup, ' '); bGroup = sal_True; } nPos ++; @@ -255,13 +255,13 @@ sal_Bool LngParser::Merge( { ByteString sLine( *(*pLines)[ nPos ] ); sLine = comphelper::string::stripStart(sLine, ' '); - sLine.EraseTrailingChars( ' ' ); + sLine = comphelper::string::stripEnd(sLine, ' '); if (( sLine.GetChar( 0 ) == '[' ) && ( sLine.GetChar( sLine.Len() - 1 ) == ']' )) { sGroup = getToken(getToken(sLine, 1, '['), 0, ']'); sGroup = comphelper::string::stripStart(sGroup, ' '); - sGroup.EraseTrailingChars( ' ' ); + sGroup = comphelper::string::stripEnd(sGroup, ' '); bGroup = sal_True; nPos ++; sLanguagesDone = ""; @@ -270,7 +270,7 @@ sal_Bool LngParser::Merge( { ByteString sLang = getToken(sLine, 0, '='); sLang = comphelper::string::stripStart(sLang, ' '); - sLang.EraseTrailingChars( ' ' ); + sLang = comphelper::string::stripEnd(sLang, ' '); ByteString sSearch( ";" ); sSearch += sLang; diff --git a/l10ntools/source/xrmmerge.cxx b/l10ntools/source/xrmmerge.cxx index 0d49e84e1545..e390fdd6b36b 100644 --- a/l10ntools/source/xrmmerge.cxx +++ b/l10ntools/source/xrmmerge.cxx @@ -442,7 +442,7 @@ void XRMResParser::ConvertStringToDBFormat( ByteString &rString ) sResult = rString; rString = comphelper::string::stripStart(rString, _LF); rString = comphelper::string::stripStart(rString, '\t'); - rString.EraseTrailingChars( '\t' ); + rString = comphelper::string::stripEnd(rString, '\t'); } while ( sResult != rString ); rString.SearchAndReplaceAll( "\t", "\\t" ); |