diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-14 14:27:57 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-15 14:33:57 +0200 |
commit | f13c6ad5f020a196a0e3aa6f28bda3dc185d465b (patch) | |
tree | f9aaab122974d36c134fb1723ec3c1c8df51eeef /forms | |
parent | 9270f74466d0eb841babaa24997f608631c70341 (diff) |
new loplugin:bufferadd
look for OUStringBuffer append sequences that can be turned
into creating an OUString with + operations
Change-Id: Ica840dc096000307b4a105fb4d9ec7588a15ade6
Reviewed-on: https://gerrit.libreoffice.org/80809
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'forms')
-rw-r--r-- | forms/source/component/DatabaseForm.cxx | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx index 673fdff8a743..f2b307c702ad 100644 --- a/forms/source/component/DatabaseForm.cxx +++ b/forms/source/component/DatabaseForm.cxx @@ -925,11 +925,8 @@ void ODatabaseForm::InsertTextPart( INetMIMEMessage& rParent, const OUString& rN // Header //TODO: Encode rName into a properly formatted Content-Disposition header // field as per RFC 2231: - OUStringBuffer aContentDisp; - aContentDisp.append("form-data; name=\""); - aContentDisp.append(rName); - aContentDisp.append('\"'); - pChild->SetContentDisposition(aContentDisp.makeStringAndClear()); + OUString aContentDisp = "form-data; name=\"" + rName + "\""; + pChild->SetContentDisposition(aContentDisp); rtl_TextEncoding eSystemEncoding = osl_getThreadTextEncoding(); const sal_Char* pBestMatchingEncoding = rtl_getBestMimeCharsetFromTextEncoding( eSystemEncoding ); @@ -989,14 +986,14 @@ void ODatabaseForm::InsertFilePart( INetMIMEMessage& rParent, const OUString& rN // Header //TODO: Encode rName and aFileName into a properly formatted // Content-Disposition header field as per RFC 2231: - OUStringBuffer aContentDisp; - aContentDisp.append("form-data; name=\""); - aContentDisp.append(rName); - aContentDisp.append('\"'); - aContentDisp.append("; filename=\""); - aContentDisp.append(aFileName); - aContentDisp.append('\"'); - pChild->SetContentDisposition(aContentDisp.makeStringAndClear()); + OUString aContentDisp = + "form-data; name=\"" + + rName + + "\"" + "; filename=\"" + + aFileName + + "\""; + pChild->SetContentDisposition(aContentDisp); pChild->SetContentType( aContentType ); pChild->SetContentTransferEncoding("8bit"); |