summaryrefslogtreecommitdiff
path: root/sdext/source/pdfimport/pdfparse/pdfentries.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-10-16 10:13:30 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-10-16 12:12:31 +0200
commit4a96fb8ec0130e1036913093836bcf28bc37a49b (patch)
treee7aad9be4ca417e9e64f688cc99bee0638037741 /sdext/source/pdfimport/pdfparse/pdfentries.cxx
parentf33b6e341fb7dd1ab3acd4fe5457b716be316e89 (diff)
loplugin:bufferadd loosen some constraints
and extend O*StringView to have a constructor that takes a pointer and a length Change-Id: I6120e96280f030757e855a6596efdae438b7e1e8 Reviewed-on: https://gerrit.libreoffice.org/80872 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sdext/source/pdfimport/pdfparse/pdfentries.cxx')
-rw-r--r--sdext/source/pdfimport/pdfparse/pdfentries.cxx34
1 files changed, 17 insertions, 17 deletions
diff --git a/sdext/source/pdfimport/pdfparse/pdfentries.cxx b/sdext/source/pdfimport/pdfparse/pdfentries.cxx
index 92cb45ab5a12..e57cf3f701b7 100644
--- a/sdext/source/pdfimport/pdfparse/pdfentries.cxx
+++ b/sdext/source/pdfimport/pdfparse/pdfentries.cxx
@@ -428,12 +428,12 @@ PDFObjectRef::~PDFObjectRef()
bool PDFObjectRef::emit( EmitContext& rWriteContext ) const
{
- OStringBuffer aBuf( 16 );
- aBuf.append( ' ' );
- aBuf.append( sal_Int32( m_nNumber ) );
- aBuf.append( ' ' );
- aBuf.append( sal_Int32( m_nGeneration ) );
- aBuf.append( " R" );
+ OString aBuf =
+ " " +
+ OString::number( sal_Int32( m_nNumber ) ) +
+ " " +
+ OString::number( sal_Int32( m_nGeneration ) ) +
+ " R";
return rWriteContext.write( aBuf.getStr(), aBuf.getLength() );
}
@@ -806,11 +806,11 @@ bool PDFObject::emit( EmitContext& rWriteContext ) const
if( pEData )
pEData->insertXref( m_nNumber, m_nGeneration, rWriteContext.getCurPos() );
- OStringBuffer aBuf( 32 );
- aBuf.append( sal_Int32( m_nNumber ) );
- aBuf.append( ' ' );
- aBuf.append( sal_Int32( m_nGeneration ) );
- aBuf.append( " obj\n" );
+ OString aBuf =
+ OString::number( sal_Int32( m_nNumber ) ) +
+ " " +
+ OString::number( sal_Int32( m_nGeneration ) ) +
+ " obj\n";
if( ! rWriteContext.write( aBuf.getStr(), aBuf.getLength() ) )
return false;
@@ -1426,12 +1426,12 @@ bool PDFFile::emit( EmitContext& rWriteContext ) const
{
setEmitData( rWriteContext, new EmitImplData( this ) );
- OStringBuffer aBuf( 32 );
- aBuf.append( "%PDF-" );
- aBuf.append( sal_Int32( m_nMajor ) );
- aBuf.append( '.' );
- aBuf.append( sal_Int32( m_nMinor ) );
- aBuf.append( "\n" );
+ OString aBuf =
+ "%PDF-" +
+ OString::number( sal_Int32( m_nMajor ) ) +
+ "." +
+ OString::number( sal_Int32( m_nMinor ) ) +
+ "\n";
if( ! rWriteContext.write( aBuf.getStr(), aBuf.getLength() ) )
return false;
return emitSubElements( rWriteContext );