From 175a2063effa1c5a3eab896c6c4b0d07f3588edb Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 10 Jan 2020 12:30:24 +0200 Subject: use more std::make_shared found using 'git grep', I tried using clang-tidy, but it only successfully found a tiny fraction of these Change-Id: I61c7d85105ff7a911722750e759d6641d578da33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86526 Tested-by: Jenkins Reviewed-by: Noel Grandin --- canvas/source/directx/dx_9rm.cxx | 5 ++--- canvas/source/tools/surfaceproxymanager.cxx | 6 ++---- 2 files changed, 4 insertions(+), 7 deletions(-) (limited to 'canvas') diff --git a/canvas/source/directx/dx_9rm.cxx b/canvas/source/directx/dx_9rm.cxx index ea650b9f9f5f..7f058a2a45bc 100644 --- a/canvas/source/directx/dx_9rm.cxx +++ b/canvas/source/directx/dx_9rm.cxx @@ -471,8 +471,7 @@ namespace dxcanvas ::basegfx::B2IVector aPageSize(maPageSize); while(true) { - mpTexture = std::shared_ptr( - new DXSurface(*this,aPageSize)); + mpTexture = std::make_shared(*this,aPageSize); if(mpTexture->isValid()) break; @@ -950,7 +949,7 @@ namespace dxcanvas if(mpTexture.use_count() == 1) return mpTexture; - return std::shared_ptr( new DXSurface(*this,aSize) ); + return std::make_shared(*this,aSize); } diff --git a/canvas/source/tools/surfaceproxymanager.cxx b/canvas/source/tools/surfaceproxymanager.cxx index ef70b824e9e0..126e1bd8c2ad 100644 --- a/canvas/source/tools/surfaceproxymanager.cxx +++ b/canvas/source/tools/surfaceproxymanager.cxx @@ -55,7 +55,7 @@ namespace canvas // not much to do for now, simply allocate a new surface // proxy from our internal pool and initialize this thing // properly. we *don't* create a hardware surface for now. - return std::shared_ptr(new SurfaceProxy(pBuffer,mpPageManager)); + return std::make_shared(pBuffer,mpPageManager); } private: @@ -66,9 +66,7 @@ namespace canvas std::shared_ptr createSurfaceProxyManager( const std::shared_ptr& rRenderModule ) { - return std::shared_ptr( - new SurfaceProxyManager( - rRenderModule)); + return std::make_shared(rRenderModule); } } -- cgit