summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-04-12 14:17:20 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-04-13 09:28:44 +0200
commit639df4d76d545ca23021f69a9d738a9a92c148cd (patch)
tree87b20ea1518f6a878102a367c211cb6f93c554fd /shell
parent9dce6f74b1b43293b40217c1163c8d4285251e97 (diff)
use more std::make_unique
Change-Id: I7d85cbc9105c5e0c4a8d9a69c4ac9d6dfc07eabd Reviewed-on: https://gerrit.libreoffice.org/70663 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'shell')
-rw-r--r--shell/source/win32/shlxthandler/propsheets/propsheets.cxx2
-rw-r--r--shell/source/win32/shlxthandler/util/utilities.cxx2
-rw-r--r--shell/source/win32/zipfile/zipfile.cxx2
3 files changed, 3 insertions, 3 deletions
diff --git a/shell/source/win32/shlxthandler/propsheets/propsheets.cxx b/shell/source/win32/shlxthandler/propsheets/propsheets.cxx
index 603495de817e..5ddd6413fce0 100644
--- a/shell/source/win32/shlxthandler/propsheets/propsheets.cxx
+++ b/shell/source/win32/shlxthandler/propsheets/propsheets.cxx
@@ -131,7 +131,7 @@ HRESULT STDMETHODCALLTYPE CPropertySheet::Initialize(
UINT size = DragQueryFileW( static_cast<HDROP>(medium.hGlobal), 0, nullptr, 0 );
if ( size != 0 )
{
- auto buffer = std::unique_ptr<WCHAR[]>(new WCHAR[ size + 1 ]);
+ auto buffer = std::make_unique<WCHAR[]>( size + 1 );
UINT result_size = DragQueryFileW( static_cast<HDROP>(medium.hGlobal),
0, buffer.get(), size + 1 );
if ( result_size != 0 )
diff --git a/shell/source/win32/shlxthandler/util/utilities.cxx b/shell/source/win32/shlxthandler/util/utilities.cxx
index 2f498daae5c5..80bd6a1cb4fa 100644
--- a/shell/source/win32/shlxthandler/util/utilities.cxx
+++ b/shell/source/win32/shlxthandler/util/utilities.cxx
@@ -125,7 +125,7 @@ std::wstring getShortPathName( const std::wstring& aLongName )
if ( length != 0 )
{
- auto buffer = std::unique_ptr<WCHAR[]>(new WCHAR[ length+1 ]);
+ auto buffer = std::make_unique<WCHAR[]>( length+1 );
length = GetShortPathNameW( aLongName.c_str(), buffer.get(), length );
if ( length != 0 )
shortName = std::wstring( buffer.get() );
diff --git a/shell/source/win32/zipfile/zipfile.cxx b/shell/source/win32/zipfile/zipfile.cxx
index 05856e1c8198..9de4b047a976 100644
--- a/shell/source/win32/zipfile/zipfile.cxx
+++ b/shell/source/win32/zipfile/zipfile.cxx
@@ -130,7 +130,7 @@ std::string readString(StreamInterface *stream, unsigned long size)
{
if (!stream || stream->stell() == -1)
throw IOException(-1);
- auto tmp = std::unique_ptr<unsigned char[]>(new unsigned char[size]);
+ auto tmp = std::make_unique<unsigned char[]>(size);
unsigned long numBytesRead = stream->sread(tmp.get(), size);
if (numBytesRead != size)
{