diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-30 15:24:04 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-30 18:54:15 +0200 |
commit | 4bef6511332073fbe3899fa2003caf88d9f2ac49 (patch) | |
tree | dca0d58c3fc86d6c88abc2a72fd91f149a917058 /sw/source/ui/dbui | |
parent | c9dcd0a6197160fdc8bf086ae4d8a78558e7d078 (diff) |
loplugin:stringloop in sw
Change-Id: Ie316aee8d1e4f772dc25725b46e130c6717458c2
Reviewed-on: https://gerrit.libreoffice.org/58331
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/ui/dbui')
-rw-r--r-- | sw/source/ui/dbui/createaddresslistdialog.cxx | 8 | ||||
-rw-r--r-- | sw/source/ui/dbui/mmresultdialogs.cxx | 10 |
2 files changed, 9 insertions, 9 deletions
diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx index 0e3d04664e5a..b024cd71c264 100644 --- a/sw/source/ui/dbui/createaddresslistdialog.cxx +++ b/sw/source/ui/dbui/createaddresslistdialog.cxx @@ -594,21 +594,21 @@ namespace void lcl_WriteValues(const std::vector<OUString> *pFields, SvStream* pStream) { - OUString sLine; + OUStringBuffer sLine; const std::vector< OUString >::const_iterator aBegin = pFields->begin(); const std::vector< OUString >::const_iterator aEnd = pFields->end(); for(std::vector< OUString >::const_iterator aIter = aBegin; aIter != aEnd; ++aIter) { if (aIter==aBegin) { - sLine += "\"" + *aIter + "\""; + sLine.append("\"").append(*aIter).append("\""); } else { - sLine += "\t\"" + *aIter + "\""; + sLine.append("\t\"").append(*aIter).append("\""); } } - pStream->WriteByteStringLine( sLine, RTL_TEXTENCODING_UTF8 ); + pStream->WriteByteStringLine( sLine.makeStringAndClear(), RTL_TEXTENCODING_UTF8 ); } } diff --git a/sw/source/ui/dbui/mmresultdialogs.cxx b/sw/source/ui/dbui/mmresultdialogs.cxx index 1b3c4f237772..f5680b980040 100644 --- a/sw/source/ui/dbui/mmresultdialogs.cxx +++ b/sw/source/ui/dbui/mmresultdialogs.cxx @@ -1114,7 +1114,7 @@ IMPL_LINK(SwMMResultEmailDialog, SendDocumentsHdl_Impl, Button*, pButton, void) OUString sEMail = lcl_GetColumnValueOf(sEMailColumn, xColAccess); SwMailDescriptor aDesc; aDesc.sEMail = sEMail; - OUString sBody; + OUStringBuffer sBody; if(bAsBody) { { @@ -1132,8 +1132,8 @@ IMPL_LINK(SwMMResultEmailDialog, SendDocumentsHdl_Impl, Button*, pButton, void) bool bDone = pInStream->ReadLine( sLine ); while ( bDone ) { - sBody += OStringToOUString(sLine, eEncoding); - sBody += "\n"; + sBody.append( OStringToOUString(sLine, eEncoding) ); + sBody.append("\n"); bDone = pInStream->ReadLine( sLine ); } } @@ -1183,10 +1183,10 @@ IMPL_LINK(SwMMResultEmailDialog, SendDocumentsHdl_Impl, Button*, pButton, void) } sGreeting += "\n"; - sBody = sGreeting + sBody; + sBody.insert(0, sGreeting); } } - aDesc.sBodyContent = sBody; + aDesc.sBodyContent = sBody.makeStringAndClear(); if(MM_DOCTYPE_HTML == nDocType) { aDesc.sBodyMimeType = "text/html; charset=" + |