summaryrefslogtreecommitdiff
path: root/sdext/source/pdfimport/sax
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/sax
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/sax')
-rw-r--r--sdext/source/pdfimport/sax/emitcontext.cxx10
1 files changed, 2 insertions, 8 deletions
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( "</" );
- aBuf.append( pTag );
- aBuf.append( ">\n" );
+ OString aBuf = "</" + rtl::OStringView(pTag) + ">\n";
pStream->write( aBuf.getStr(), aBuf.getLength(), nWritten );
nIndent--;
#endif