summaryrefslogtreecommitdiff
path: root/dtrans
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-07-28 18:01:28 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-29 12:14:22 +0200
commite593b623dad9456d3452c4c537479596bcd0b00b (patch)
treed9d21031cdd75df25749de8c6ae5b9c0afb1c196 /dtrans
parenta612d738a8c909e18ed89675432ca42b376ef624 (diff)
loplugin:stringloop in various
Change-Id: Ic2436c6d94729211cd5bc72fee18af228381e4a3 Reviewed-on: https://gerrit.libreoffice.org/58250 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dtrans')
-rw-r--r--dtrans/source/cnttype/mcnttype.cxx19
1 files changed, 10 insertions, 9 deletions
diff --git a/dtrans/source/cnttype/mcnttype.cxx b/dtrans/source/cnttype/mcnttype.cxx
index 3f982dd8a62c..f844c7998dd7 100644
--- a/dtrans/source/cnttype/mcnttype.cxx
+++ b/dtrans/source/cnttype/mcnttype.cxx
@@ -20,6 +20,7 @@
#include <sal/config.h>
#include <com/sun/star/container/NoSuchElementException.hpp>
+#include <rtl/ustrbuf.hxx>
#include "mcnttype.hxx"
@@ -223,13 +224,13 @@ void CMimeContentType::trailer()
OUString CMimeContentType::pName( )
{
- OUString pname;
+ OUStringBuffer pname;
OUString sToken(TOKEN);
while( !m_nxtSym.isEmpty( ) )
{
if ( isInRange( m_nxtSym, sToken ) )
- pname += m_nxtSym;
+ pname.append(m_nxtSym);
else if ( isInRange( m_nxtSym, "= " ) )
break;
else
@@ -237,7 +238,7 @@ OUString CMimeContentType::pName( )
getSym( );
}
- return pname;
+ return pname.makeStringAndClear();
}
OUString CMimeContentType::pValue( )
@@ -276,7 +277,7 @@ OUString CMimeContentType::pValue( )
OUString CMimeContentType::quotedPValue( )
{
- OUString pvalue;
+ OUStringBuffer pvalue;
bool bAfterQuoteSign = false;
while ( !m_nxtSym.isEmpty( ) )
@@ -290,7 +291,7 @@ OUString CMimeContentType::quotedPValue( )
}
else if ( isInRange( m_nxtSym, OUStringLiteral(TOKEN) + TSPECIALS + SPACE ) )
{
- pvalue += m_nxtSym;
+ pvalue.append(m_nxtSym);
bAfterQuoteSign = m_nxtSym == "\"";
}
else
@@ -298,18 +299,18 @@ OUString CMimeContentType::quotedPValue( )
getSym( );
}
- return pvalue;
+ return pvalue.makeStringAndClear();
}
OUString CMimeContentType::nonquotedPValue( )
{
- OUString pvalue;
+ OUStringBuffer pvalue;
OUString sToken(TOKEN);
while ( !m_nxtSym.isEmpty( ) )
{
if ( isInRange( m_nxtSym, sToken ) )
- pvalue += m_nxtSym;
+ pvalue.append(m_nxtSym);
else if ( isInRange( m_nxtSym, "; " ) )
break;
else
@@ -317,7 +318,7 @@ OUString CMimeContentType::nonquotedPValue( )
getSym( );
}
- return pvalue;
+ return pvalue.makeStringAndClear();
}
void CMimeContentType::comment()