diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-01-23 15:17:46 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-01-24 07:18:28 +0100 |
commit | 8d23f9c2c1e0479a95cb44a09066740213b0f99a (patch) | |
tree | 46034a164cbfd4d5a17f8eaec722e89fdfd172ee /canvas | |
parent | 8dd247044f976d93e13370738418fcd2ac167e9c (diff) |
loplugin:makeshared in basctl..canvas
Change-Id: I1461da594db222abbaeccfb636194b9790f5dbe8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87271
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'canvas')
-rw-r--r-- | canvas/source/opengl/ogl_spritedevicehelper.cxx | 4 | ||||
-rw-r--r-- | canvas/source/tools/page.cxx | 2 | ||||
-rw-r--r-- | canvas/source/tools/pagemanager.cxx | 4 | ||||
-rw-r--r-- | canvas/source/tools/surfaceproxymanager.cxx | 2 | ||||
-rw-r--r-- | canvas/source/vcl/canvas.cxx | 2 | ||||
-rw-r--r-- | canvas/source/vcl/canvasbitmaphelper.cxx | 2 | ||||
-rw-r--r-- | canvas/source/vcl/canvascustomsprite.cxx | 6 | ||||
-rw-r--r-- | canvas/source/vcl/canvashelper.cxx | 4 | ||||
-rw-r--r-- | canvas/source/vcl/canvashelper_texturefill.cxx | 4 | ||||
-rw-r--r-- | canvas/source/vcl/spritecanvas.cxx | 2 | ||||
-rw-r--r-- | canvas/source/vcl/spritedevicehelper.cxx | 2 |
11 files changed, 17 insertions, 17 deletions
diff --git a/canvas/source/opengl/ogl_spritedevicehelper.cxx b/canvas/source/opengl/ogl_spritedevicehelper.cxx index be838393c5fd..6a1d935c9ba9 100644 --- a/canvas/source/opengl/ogl_spritedevicehelper.cxx +++ b/canvas/source/opengl/ogl_spritedevicehelper.cxx @@ -78,7 +78,7 @@ namespace oglcanvas mpSpriteCanvas(nullptr), maActiveSprites(), maLastUpdate(), - mpTextureCache(new TextureCache()), + mpTextureCache(std::make_shared<TextureCache>()), mnLinearTwoColorGradientProgram(0), mnLinearMultiColorGradientProgram(0), mnRadialTwoColorGradientProgram(0), @@ -543,7 +543,7 @@ namespace oglcanvas IBufferContextSharedPtr SpriteDeviceHelper::createBufferContext(const ::basegfx::B2IVector& rSize) const { - return IBufferContextSharedPtr(new BufferContextImpl(rSize)); + return std::make_shared<BufferContextImpl>(rSize); } TextureCache& SpriteDeviceHelper::getTextureCache() const diff --git a/canvas/source/tools/page.cxx b/canvas/source/tools/page.cxx index 78f9cd3aa671..3537fa0b6873 100644 --- a/canvas/source/tools/page.cxx +++ b/canvas/source/tools/page.cxx @@ -48,7 +48,7 @@ namespace canvas SurfaceRect rect(rSize); if(insert(rect)) { - FragmentSharedPtr pFragment(new PageFragment(rect,this)); + FragmentSharedPtr pFragment = std::make_shared<PageFragment>(rect,this); mpFragments.push_back(pFragment); return pFragment; } diff --git a/canvas/source/tools/pagemanager.cxx b/canvas/source/tools/pagemanager.cxx index 3d08eff21593..c1e874ca498a 100644 --- a/canvas/source/tools/pagemanager.cxx +++ b/canvas/source/tools/pagemanager.cxx @@ -42,7 +42,7 @@ namespace canvas } // otherwise try to create a new page and allocate space there... - PageSharedPtr pPage(new Page(mpRenderModule)); + PageSharedPtr pPage = std::make_shared<Page>(mpRenderModule); if(pPage->isValid()) { maPages.push_back(pPage); @@ -56,7 +56,7 @@ namespace canvas // of videomemory], and all other pages could not take // the new request. we decide to create a 'naked' fragment // which will receive its location later. - FragmentSharedPtr pFragment(new PageFragment(rSize)); + FragmentSharedPtr pFragment = std::make_shared<PageFragment>(rSize); maFragments.push_back(pFragment); return pFragment; } diff --git a/canvas/source/tools/surfaceproxymanager.cxx b/canvas/source/tools/surfaceproxymanager.cxx index 126e1bd8c2ad..87aa953cf213 100644 --- a/canvas/source/tools/surfaceproxymanager.cxx +++ b/canvas/source/tools/surfaceproxymanager.cxx @@ -33,7 +33,7 @@ namespace canvas public: explicit SurfaceProxyManager( const std::shared_ptr<IRenderModule>& rRenderModule ) : - mpPageManager( new PageManager(rRenderModule) ) + mpPageManager( std::make_shared<PageManager>(rRenderModule) ) { } diff --git a/canvas/source/vcl/canvas.cxx b/canvas/source/vcl/canvas.cxx index 9cbb1c0d7467..4713f8ab9d34 100644 --- a/canvas/source/vcl/canvas.cxx +++ b/canvas/source/vcl/canvas.cxx @@ -87,7 +87,7 @@ namespace vclcanvas if( !pOutDev ) throw lang::NoSupportException("Passed OutDev invalid!", nullptr); - OutDevProviderSharedPtr pOutdevProvider( new OutDevHolder(*pOutDev) ); + OutDevProviderSharedPtr pOutdevProvider = std::make_shared<OutDevHolder>(*pOutDev); // setup helper maDeviceHelper.init( pOutdevProvider ); diff --git a/canvas/source/vcl/canvasbitmaphelper.cxx b/canvas/source/vcl/canvasbitmaphelper.cxx index 44c6dcce1230..43fed2754430 100644 --- a/canvas/source/vcl/canvasbitmaphelper.cxx +++ b/canvas/source/vcl/canvasbitmaphelper.cxx @@ -45,7 +45,7 @@ namespace vclcanvas const OutDevProviderSharedPtr& rOutDevReference ) { mpOutDevReference = rOutDevReference; - mpBackBuffer.reset( new BitmapBackBuffer( rBitmap, rOutDevReference->getOutDev() )); + mpBackBuffer = std::make_shared<BitmapBackBuffer>( rBitmap, rOutDevReference->getOutDev() ); // forward new settings to base class (ref device, output // surface, no protection (own backbuffer), alpha depends on diff --git a/canvas/source/vcl/canvascustomsprite.cxx b/canvas/source/vcl/canvascustomsprite.cxx index 5a92bc64ef10..74ed15836004 100644 --- a/canvas/source/vcl/canvascustomsprite.cxx +++ b/canvas/source/vcl/canvascustomsprite.cxx @@ -55,12 +55,12 @@ namespace vclcanvas ceil( rSpriteSize.Height ))) ); // create content backbuffer in screen depth - BackBufferSharedPtr pBackBuffer( new BackBuffer( rOutDevProvider->getOutDev() ) ); + BackBufferSharedPtr pBackBuffer = std::make_shared<BackBuffer>( rOutDevProvider->getOutDev() ); pBackBuffer->setSize( aSize ); // create mask backbuffer, with one bit color depth - BackBufferSharedPtr pBackBufferMask( new BackBuffer( rOutDevProvider->getOutDev(), - true ) ); + BackBufferSharedPtr pBackBufferMask = std::make_shared<BackBuffer>( rOutDevProvider->getOutDev(), + true ); pBackBufferMask->setSize( aSize ); // TODO(F1): Implement alpha vdev (could prolly enable diff --git a/canvas/source/vcl/canvashelper.cxx b/canvas/source/vcl/canvashelper.cxx index d1e1de400687..7a1578bef92b 100644 --- a/canvas/source/vcl/canvashelper.cxx +++ b/canvas/source/vcl/canvashelper.cxx @@ -776,7 +776,7 @@ namespace vclcanvas const double nAngleInTenthOfDegrees (3600.0 - nRotate * 3600.0 / (2*M_PI)); aGrfAttr.SetRotation( static_cast< sal_uInt16 >(::basegfx::fround(nAngleInTenthOfDegrees)) ); - pGrfObj.reset( new GraphicObject( aBmpEx ) ); + pGrfObj = std::make_shared<GraphicObject>( aBmpEx ); } else { @@ -799,7 +799,7 @@ namespace vclcanvas aBmpEx = tools::transformBitmap( aBmpEx, aMatrix ); - pGrfObj.reset( new GraphicObject( aBmpEx ) ); + pGrfObj = std::make_shared<GraphicObject>( aBmpEx ); // clear scale values, generated bitmap already // contains scaling diff --git a/canvas/source/vcl/canvashelper_texturefill.cxx b/canvas/source/vcl/canvashelper_texturefill.cxx index 3650c8317513..bd17a8883d21 100644 --- a/canvas/source/vcl/canvashelper_texturefill.cxx +++ b/canvas/source/vcl/canvashelper_texturefill.cxx @@ -756,7 +756,7 @@ namespace vclcanvas const double nAngleInTenthOfDegrees (3600.0 - nRotate * 3600.0 / (2*M_PI)); aGrfAttr.SetRotation( static_cast< sal_uInt16 >(::basegfx::fround(nAngleInTenthOfDegrees)) ); - pGrfObj.reset( new GraphicObject( aBmpEx ) ); + pGrfObj = std::make_shared<GraphicObject>( aBmpEx ); } else { @@ -779,7 +779,7 @@ namespace vclcanvas aBmpEx = tools::transformBitmap( aBmpEx, aTotalTransform); - pGrfObj.reset( new GraphicObject( aBmpEx ) ); + pGrfObj = std::make_shared<GraphicObject>( aBmpEx ); // clear scale values, generated bitmap already // contains scaling diff --git a/canvas/source/vcl/spritecanvas.cxx b/canvas/source/vcl/spritecanvas.cxx index f40be1a54049..90aa55228b28 100644 --- a/canvas/source/vcl/spritecanvas.cxx +++ b/canvas/source/vcl/spritecanvas.cxx @@ -77,7 +77,7 @@ namespace vclcanvas uno::Reference< awt::XWindow > xParentWindow; maArguments[3] >>= xParentWindow; - OutDevProviderSharedPtr pOutDev( new WindowOutDevHolder(xParentWindow) ); + OutDevProviderSharedPtr pOutDev = std::make_shared<WindowOutDevHolder>(xParentWindow); // setup helper maDeviceHelper.init( pOutDev ); diff --git a/canvas/source/vcl/spritedevicehelper.cxx b/canvas/source/vcl/spritedevicehelper.cxx index cc36193f08ec..01994f55c0d6 100644 --- a/canvas/source/vcl/spritedevicehelper.cxx +++ b/canvas/source/vcl/spritedevicehelper.cxx @@ -41,7 +41,7 @@ namespace vclcanvas // setup back buffer OutputDevice& rOutDev( pOutDev->getOutDev() ); - mpBackBuffer.reset( new BackBuffer( rOutDev )); + mpBackBuffer = std::make_shared<BackBuffer>( rOutDev ); mpBackBuffer->setSize( rOutDev.GetOutputSizePixel() ); // #i95645# |