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 /vcl | |
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 'vcl')
-rw-r--r-- | vcl/source/filter/ipdf/pdfdocument.cxx | 6 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 16 | ||||
-rw-r--r-- | vcl/unx/generic/print/printerjob.cxx | 6 |
3 files changed, 13 insertions, 15 deletions
diff --git a/vcl/source/filter/ipdf/pdfdocument.cxx b/vcl/source/filter/ipdf/pdfdocument.cxx index 1aec86c9ee2f..02bde3fcaedb 100644 --- a/vcl/source/filter/ipdf/pdfdocument.cxx +++ b/vcl/source/filter/ipdf/pdfdocument.cxx @@ -836,10 +836,8 @@ bool PDFDocument::Sign(const uno::Reference<security::XCertificate>& xCertificat = nFileEnd - (nSignatureContentOffset + MAX_SIGNATURE_CONTENT_LENGTH + 1); // Write the length to the buffer. m_aEditBuffer.Seek(nSignatureLastByteRangeOffset); - OStringBuffer aByteRangeBuffer; - aByteRangeBuffer.append(nLastByteRangeLength); - aByteRangeBuffer.append(" ]"); - m_aEditBuffer.WriteOString(aByteRangeBuffer.toString()); + OString aByteRangeBuffer = OString::number(nLastByteRangeLength) + " ]"; + m_aEditBuffer.WriteOString(aByteRangeBuffer); // Create the PKCS#7 object. css::uno::Sequence<sal_Int8> aDerEncoded = xCertificate->getEncoded(); diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 0048cc548d54..47d90025172a 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -794,11 +794,11 @@ void PDFWriterImpl::PDFPage::endStream() // emit stream length object if( ! m_pWriter->updateObject( m_nStreamLengthObject ) ) return; - OStringBuffer aLine; - aLine.append( m_nStreamLengthObject ); - aLine.append( " 0 obj\n" ); - aLine.append( static_cast<sal_Int64>(nEndStreamPos-m_nBeginStreamPos) ); - aLine.append( "\nendobj\n\n" ); + OString aLine = + OString::number( m_nStreamLengthObject ) + + " 0 obj\n" + + OString::number( static_cast<sal_Int64>(nEndStreamPos-m_nBeginStreamPos) ) + + "\nendobj\n\n"; m_pWriter->writeBuffer( aLine.getStr(), aLine.getLength() ); } @@ -2044,9 +2044,9 @@ OString PDFWriterImpl::emitStructureAttributes( PDFStructureElement& i_rEle ) SAL_INFO("vcl.pdfwriter", "unresolved link id " << nLink << " for Link structure"); if (g_bDebugDisableCompression) { - OStringBuffer aLine( "unresolved link id " ); - aLine.append( nLink ); - aLine.append( " for Link structure" ); + OString aLine = "unresolved link id " + + OString::number( nLink ) + + " for Link structure"; emitComment( aLine.getStr() ); } } diff --git a/vcl/unx/generic/print/printerjob.cxx b/vcl/unx/generic/print/printerjob.cxx index 5bf85101869d..73dedc5a2415 100644 --- a/vcl/unx/generic/print/printerjob.cxx +++ b/vcl/unx/generic/print/printerjob.cxx @@ -951,9 +951,9 @@ bool PrinterJob::writeSetup( osl::File* pFile, const JobData& rJob ) if( ! bExternalDialog && rJob.m_nCopies > 1 ) { // setup code - OStringBuffer aLine("/#copies "); - aLine.append(static_cast<sal_Int32>(rJob.m_nCopies)); - aLine.append(" def\n"); + OString aLine = "/#copies " + + OString::number(static_cast<sal_Int32>(rJob.m_nCopies)) + + " def\n"; sal_uInt64 nWritten = 0; bSuccess = !(pFile->write(aLine.getStr(), aLine.getLength(), nWritten) || nWritten != static_cast<sal_uInt64>(aLine.getLength())); |