From 4a96fb8ec0130e1036913093836bcf28bc37a49b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 16 Oct 2019 10:13:30 +0200 Subject: 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 --- sdext/source/pdfimport/sax/emitcontext.cxx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'sdext/source/pdfimport/sax') diff --git a/sdext/source/pdfimport/sax/emitcontext.cxx b/sdext/source/pdfimport/sax/emitcontext.cxx index 4b1f7de41172..48c91811f23d 100644 --- a/sdext/source/pdfimport/sax/emitcontext.cxx +++ b/sdext/source/pdfimport/sax/emitcontext.cxx @@ -60,10 +60,7 @@ SaxEmitter::SaxEmitter( const uno::Reference< xml::sax::XDocumentHandler >& xDoc OUString aStr( OStringToOUString( pDir, RTL_TEXTENCODING_UTF8 ) ); OUString aFileURL; osl_getFileURLFromSystemPath( aStr.pData, &aFileURL.pData ); - OUStringBuffer aBuf( 256 ); - aBuf.append( aFileURL ); - aBuf.append( "/pdfimport.xml" ); - pStream = new osl::File( aBuf.makeStringAndClear() ); + pStream = new osl::File( aFileURL + "/pdfimport.xml" ); if( pStream->open( osl_File_OpenFlag_Write | osl_File_OpenFlag_Create ) ) { pStream->open( osl_File_OpenFlag_Write ); @@ -168,10 +165,7 @@ void SaxEmitter::endTag( const char* pTag ) for( int i = 0; i < nIndent; i++ ) pStream->write( " ", 4, nWritten ); - OStringBuffer aBuf( 1024 ); - aBuf.append( "\n" ); + OString aBuf = "\n"; pStream->write( aBuf.getStr(), aBuf.getLength(), nWritten ); nIndent--; #endif -- cgit