diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-02-03 16:26:38 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-02-03 23:38:37 +0100 |
commit | 6317e10f5b9c347ceb391e049e6d0f3c542f93c4 (patch) | |
tree | 5552a3ccc88bfbdf932735292a008271ab4360fa /canvas/source/directx/dx_impltools.cxx | |
parent | a334f77792dfff92e3c97f7f61f59d01fc9338cf (diff) |
loplugin:makeshared (clang-cl)
Change-Id: I0c786bf401e514f9d86e33d8ab6366fc5dd1f425
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87887
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'canvas/source/directx/dx_impltools.cxx')
-rw-r--r-- | canvas/source/directx/dx_impltools.cxx | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/canvas/source/directx/dx_impltools.cxx b/canvas/source/directx/dx_impltools.cxx index 416b46034408..6d7f54e4713b 100644 --- a/canvas/source/directx/dx_impltools.cxx +++ b/canvas/source/directx/dx_impltools.cxx @@ -20,6 +20,7 @@ #include <sal/config.h> #include <algorithm> +#include <memory> #include <vector> @@ -404,7 +405,7 @@ namespace dxcanvas GraphicsPathSharedPtr graphicsPathFromRealPoint2DSequence( const uno::Sequence< uno::Sequence< geometry::RealPoint2D > >& points ) { - GraphicsPathSharedPtr pRes( new Gdiplus::GraphicsPath() ); + GraphicsPathSharedPtr pRes = std::make_shared<Gdiplus::GraphicsPath>(); std::vector< Gdiplus::PointF > aPoints; sal_Int32 nCurrPoly; @@ -432,7 +433,7 @@ namespace dxcanvas GraphicsPathSharedPtr graphicsPathFromB2DPolygon( const ::basegfx::B2DPolygon& rPoly, bool bNoLineJoin ) { - GraphicsPathSharedPtr pRes( new Gdiplus::GraphicsPath() ); + GraphicsPathSharedPtr pRes = std::make_shared<Gdiplus::GraphicsPath>(); std::vector< Gdiplus::PointF > aPoints; graphicsPathFromB2DPolygon( pRes, aPoints, rPoly, bNoLineJoin ); @@ -442,7 +443,7 @@ namespace dxcanvas GraphicsPathSharedPtr graphicsPathFromB2DPolyPolygon( const ::basegfx::B2DPolyPolygon& rPoly, bool bNoLineJoin ) { - GraphicsPathSharedPtr pRes( new Gdiplus::GraphicsPath() ); + GraphicsPathSharedPtr pRes = std::make_shared<Gdiplus::GraphicsPath>(); std::vector< Gdiplus::PointF > aPoints; const sal_uInt32 nPolies( rPoly.count() ); @@ -495,9 +496,9 @@ namespace dxcanvas bool drawRGBABits( const std::shared_ptr<Gdiplus::Graphics>& rGraphics, const RawRGBABitmap& rRawRGBAData ) { - BitmapSharedPtr pBitmap( new Gdiplus::Bitmap( rRawRGBAData.mnWidth, + BitmapSharedPtr pBitmap = std::make_shared<Gdiplus::Bitmap>( rRawRGBAData.mnWidth, rRawRGBAData.mnHeight, - PixelFormat32bppARGB ) ); + PixelFormat32bppARGB ); Gdiplus::BitmapData aBmpData; aBmpData.Width = rRawRGBAData.mnWidth; @@ -545,9 +546,9 @@ namespace dxcanvas // TODO(P2): At least for the alpha bitmap case, it // would be possible to generate the corresponding // bitmap directly - pBitmap.reset( new Gdiplus::Bitmap( aBmpSize.Width, + pBitmap = std::make_shared<Gdiplus::Bitmap>( aBmpSize.Width, aBmpSize.Height, - PixelFormat32bppARGB ) ); + PixelFormat32bppARGB ); } else { @@ -555,9 +556,9 @@ namespace dxcanvas // to the VCL bitmap. Also, check whether the VCL // bitmap's system handles can be used to create the // GDI+ bitmap (currently, it does not seem so). - pBitmap.reset( new Gdiplus::Bitmap( aBmpSize.Width, + pBitmap = std::make_shared<Gdiplus::Bitmap>( aBmpSize.Width, aBmpSize.Height, - PixelFormat24bppRGB ) ); + PixelFormat24bppRGB ); } GraphicsSharedPtr pGraphics(createGraphicsFromBitmap(pBitmap)); |