summaryrefslogtreecommitdiff
path: root/cppcanvas/source/wrapper
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-01-23 16:36:33 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-01-24 07:18:44 +0100
commite5cfe9c050fbd601b64dc13fe6760e762a35a4d4 (patch)
tree8e98fba0391b0530295e0600963b333cafaa622c /cppcanvas/source/wrapper
parentb1d48a0e22bb8d2eabead41a6a6b53ffaec932e4 (diff)
loplugin:makeshared in connectivity..cppuhelper
Change-Id: Id8064e961a64bb03bc0fb61e375cdcf769b340cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87276 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cppcanvas/source/wrapper')
-rw-r--r--cppcanvas/source/wrapper/basegfxfactory.cxx15
-rw-r--r--cppcanvas/source/wrapper/implbitmap.cxx4
-rw-r--r--cppcanvas/source/wrapper/implbitmapcanvas.cxx2
-rw-r--r--cppcanvas/source/wrapper/implcanvas.cxx2
-rw-r--r--cppcanvas/source/wrapper/implcustomsprite.cxx2
-rw-r--r--cppcanvas/source/wrapper/implspritecanvas.cxx11
-rw-r--r--cppcanvas/source/wrapper/vclfactory.cxx22
7 files changed, 25 insertions, 33 deletions
diff --git a/cppcanvas/source/wrapper/basegfxfactory.cxx b/cppcanvas/source/wrapper/basegfxfactory.cxx
index 30410e75c66f..0549c4e12175 100644
--- a/cppcanvas/source/wrapper/basegfxfactory.cxx
+++ b/cppcanvas/source/wrapper/basegfxfactory.cxx
@@ -48,11 +48,10 @@ namespace cppcanvas
if( !xCanvas.is() )
return PolyPolygonSharedPtr();
- return PolyPolygonSharedPtr(
- new internal::ImplPolyPolygon( rCanvas,
+ return std::make_shared<internal::ImplPolyPolygon>( rCanvas,
::basegfx::unotools::xPolyPolygonFromB2DPolygon(
xCanvas->getDevice(),
- rPoly) ) );
+ rPoly) );
}
BitmapSharedPtr BaseGfxFactory::createBitmap( const CanvasSharedPtr& rCanvas,
@@ -69,10 +68,9 @@ namespace cppcanvas
if( !xCanvas.is() )
return BitmapSharedPtr();
- return BitmapSharedPtr(
- new internal::ImplBitmap( rCanvas,
+ return std::make_shared<internal::ImplBitmap>( rCanvas,
xCanvas->getDevice()->createCompatibleBitmap(
- ::basegfx::unotools::integerSize2DFromB2ISize(rSize) ) ) );
+ ::basegfx::unotools::integerSize2DFromB2ISize(rSize) ) );
}
BitmapSharedPtr BaseGfxFactory::createAlphaBitmap( const CanvasSharedPtr& rCanvas,
@@ -89,10 +87,9 @@ namespace cppcanvas
if( !xCanvas.is() )
return BitmapSharedPtr();
- return BitmapSharedPtr(
- new internal::ImplBitmap( rCanvas,
+ return std::make_shared<internal::ImplBitmap>( rCanvas,
xCanvas->getDevice()->createCompatibleAlphaBitmap(
- ::basegfx::unotools::integerSize2DFromB2ISize(rSize) ) ) );
+ ::basegfx::unotools::integerSize2DFromB2ISize(rSize) ) );
}
}
diff --git a/cppcanvas/source/wrapper/implbitmap.cxx b/cppcanvas/source/wrapper/implbitmap.cxx
index e5e8b8734c85..f7465e5d7188 100644
--- a/cppcanvas/source/wrapper/implbitmap.cxx
+++ b/cppcanvas/source/wrapper/implbitmap.cxx
@@ -40,9 +40,9 @@ namespace cppcanvas::internal
uno::Reference< rendering::XBitmapCanvas > xBitmapCanvas( rBitmap,
uno::UNO_QUERY );
if( xBitmapCanvas.is() )
- mpBitmapCanvas.reset( new ImplBitmapCanvas(
+ mpBitmapCanvas = std::make_shared<ImplBitmapCanvas>(
uno::Reference< rendering::XBitmapCanvas >(rBitmap,
- uno::UNO_QUERY) ) );
+ uno::UNO_QUERY) );
}
ImplBitmap::~ImplBitmap()
diff --git a/cppcanvas/source/wrapper/implbitmapcanvas.cxx b/cppcanvas/source/wrapper/implbitmapcanvas.cxx
index 3cd4085ad526..c4751d2923eb 100644
--- a/cppcanvas/source/wrapper/implbitmapcanvas.cxx
+++ b/cppcanvas/source/wrapper/implbitmapcanvas.cxx
@@ -52,7 +52,7 @@ namespace cppcanvas::internal
CanvasSharedPtr ImplBitmapCanvas::clone() const
{
- return BitmapCanvasSharedPtr( new ImplBitmapCanvas( *this ) );
+ return std::make_shared<ImplBitmapCanvas>( *this );
}
}
diff --git a/cppcanvas/source/wrapper/implcanvas.cxx b/cppcanvas/source/wrapper/implcanvas.cxx
index e5c936dab908..da7eda676347 100644
--- a/cppcanvas/source/wrapper/implcanvas.cxx
+++ b/cppcanvas/source/wrapper/implcanvas.cxx
@@ -80,7 +80,7 @@ namespace cppcanvas::internal
CanvasSharedPtr ImplCanvas::clone() const
{
- return CanvasSharedPtr( new ImplCanvas( *this ) );
+ return std::make_shared<ImplCanvas>( *this );
}
void ImplCanvas::clear() const
diff --git a/cppcanvas/source/wrapper/implcustomsprite.cxx b/cppcanvas/source/wrapper/implcustomsprite.cxx
index 999f312c3c2f..624c15dee7e1 100644
--- a/cppcanvas/source/wrapper/implcustomsprite.cxx
+++ b/cppcanvas/source/wrapper/implcustomsprite.cxx
@@ -60,7 +60,7 @@ namespace cppcanvas::internal
if( mpLastCanvas.get() == nullptr ||
mpLastCanvas->getUNOCanvas() != xCanvas )
{
- mpLastCanvas = CanvasSharedPtr( new ImplCanvas( xCanvas ) );
+ mpLastCanvas = std::make_shared<ImplCanvas>( xCanvas );
}
return mpLastCanvas;
diff --git a/cppcanvas/source/wrapper/implspritecanvas.cxx b/cppcanvas/source/wrapper/implspritecanvas.cxx
index 0166ccd82d0a..a33615eb9ef3 100644
--- a/cppcanvas/source/wrapper/implspritecanvas.cxx
+++ b/cppcanvas/source/wrapper/implspritecanvas.cxx
@@ -43,7 +43,7 @@ namespace cppcanvas::internal
ImplSpriteCanvas::ImplSpriteCanvas( const uno::Reference< rendering::XSpriteCanvas >& rCanvas ) :
ImplCanvas( rCanvas ),
mxSpriteCanvas( rCanvas ),
- mpTransformArbiter( new TransformationArbiter() )
+ mpTransformArbiter( std::make_shared<TransformationArbiter>() )
{
OSL_ENSURE( mxSpriteCanvas.is(), "ImplSpriteCanvas::ImplSpriteCanvas(): Invalid canvas" );
}
@@ -53,7 +53,7 @@ namespace cppcanvas::internal
SpriteCanvas(),
ImplCanvas( rOrig ),
mxSpriteCanvas( rOrig.getUNOSpriteCanvas() ),
- mpTransformArbiter( new TransformationArbiter() )
+ mpTransformArbiter( std::make_shared<TransformationArbiter>() )
{
OSL_ENSURE( mxSpriteCanvas.is(), "ImplSpriteCanvas::ImplSpriteCanvas( const ImplSpriteCanvas& ): Invalid canvas" );
@@ -88,15 +88,14 @@ namespace cppcanvas::internal
if( !mxSpriteCanvas.is() )
return CustomSpriteSharedPtr();
- return CustomSpriteSharedPtr(
- new ImplCustomSprite( mxSpriteCanvas,
+ return std::make_shared<ImplCustomSprite>( mxSpriteCanvas,
mxSpriteCanvas->createCustomSprite( ::basegfx::unotools::size2DFromB2DSize(rSize) ),
- mpTransformArbiter ) );
+ mpTransformArbiter );
}
CanvasSharedPtr ImplSpriteCanvas::clone() const
{
- return SpriteCanvasSharedPtr( new ImplSpriteCanvas( *this ) );
+ return std::make_shared<ImplSpriteCanvas>( *this );
}
uno::Reference< rendering::XSpriteCanvas > ImplSpriteCanvas::getUNOSpriteCanvas() const
diff --git a/cppcanvas/source/wrapper/vclfactory.cxx b/cppcanvas/source/wrapper/vclfactory.cxx
index 4fe30f4324b2..c90d91b23de8 100644
--- a/cppcanvas/source/wrapper/vclfactory.cxx
+++ b/cppcanvas/source/wrapper/vclfactory.cxx
@@ -34,27 +34,23 @@ namespace cppcanvas
{
CanvasSharedPtr VCLFactory::createCanvas( const uno::Reference< rendering::XCanvas >& xCanvas )
{
- return CanvasSharedPtr(
- new internal::ImplCanvas( xCanvas ) );
+ return std::make_shared<internal::ImplCanvas>( xCanvas );
}
BitmapCanvasSharedPtr VCLFactory::createBitmapCanvas( const uno::Reference< rendering::XBitmapCanvas >& xCanvas )
{
- return BitmapCanvasSharedPtr(
- new internal::ImplBitmapCanvas( xCanvas ) );
+ return std::make_shared<internal::ImplBitmapCanvas>( xCanvas );
}
SpriteCanvasSharedPtr VCLFactory::createSpriteCanvas( const vcl::Window& rVCLWindow )
{
- return SpriteCanvasSharedPtr(
- new internal::ImplSpriteCanvas(
- rVCLWindow.GetSpriteCanvas() ) );
+ return std::make_shared<internal::ImplSpriteCanvas>(
+ rVCLWindow.GetSpriteCanvas() );
}
SpriteCanvasSharedPtr VCLFactory::createSpriteCanvas( const uno::Reference< rendering::XSpriteCanvas >& xCanvas )
{
- return SpriteCanvasSharedPtr(
- new internal::ImplSpriteCanvas( xCanvas ) );
+ return std::make_shared<internal::ImplSpriteCanvas>( xCanvas );
}
BitmapSharedPtr VCLFactory::createBitmap( const CanvasSharedPtr& rCanvas,
@@ -71,17 +67,17 @@ namespace cppcanvas
if( !xCanvas.is() )
return BitmapSharedPtr();
- return BitmapSharedPtr( new internal::ImplBitmap( rCanvas,
- vcl::unotools::xBitmapFromBitmapEx(rBmpEx) ) );
+ return std::make_shared<internal::ImplBitmap>( rCanvas,
+ vcl::unotools::xBitmapFromBitmapEx(rBmpEx) );
}
RendererSharedPtr VCLFactory::createRenderer( const CanvasSharedPtr& rCanvas,
const ::GDIMetaFile& rMtf,
const Renderer::Parameters& rParms )
{
- return RendererSharedPtr( new internal::ImplRenderer( rCanvas,
+ return std::make_shared<internal::ImplRenderer>( rCanvas,
rMtf,
- rParms ) );
+ rParms );
}
}