Kaydet (Commit) 52d0aca5 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in TVChildTarget

Change-Id: I5d51df50a0c2279c52273254c451f3f21eaafbfb
Reviewed-on: https://gerrit.libreoffice.org/61112
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst c490bfac
......@@ -400,10 +400,10 @@ TVChildTarget::TVChildTarget( const Reference< XComponentContext >& xContext )
while( j )
{
len = configData.vFileLen[--j];
char* s = new char[ int(len) ]; // the buffer to hold the installed files
std::unique_ptr<char[]> s(new char[ int(len) ]); // the buffer to hold the installed files
osl::File aFile( configData.vFileURL[j] );
aFile.open( osl_File_OpenFlag_Read );
aFile.read( s,len,ret );
aFile.read( s.get(),len,ret );
aFile.close();
XML_Parser parser = XML_ParserCreate( nullptr );
......@@ -414,12 +414,11 @@ TVChildTarget::TVChildTarget( const Reference< XComponentContext >& xContext )
data_handler);
XML_SetUserData( parser,&pTVDom ); // does not return this
XML_Status const parsed = XML_Parse(parser, s, int(len), j==0);
XML_Status const parsed = XML_Parse(parser, s.get(), int(len), j==0);
SAL_WARN_IF(XML_STATUS_ERROR == parsed, "xmlhelp",
"TVChildTarget::TVChildTarget(): Tree file parsing failed");
XML_ParserFree( parser );
delete[] s;
Check(pTVDom);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment