summaryrefslogtreecommitdiff
path: root/cppcanvas
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-01-10 12:30:24 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-01-10 13:07:41 +0100
commit175a2063effa1c5a3eab896c6c4b0d07f3588edb (patch)
tree4a252a7e9e6e714343e9ff21c3d78c8e41086009 /cppcanvas
parentddf901664d3dd12191f98b77182652a6889f2b26 (diff)
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cppcanvas')
-rw-r--r--cppcanvas/source/mtfrenderer/bitmapaction.cxx15
-rw-r--r--cppcanvas/source/mtfrenderer/lineaction.cxx8
-rw-r--r--cppcanvas/source/mtfrenderer/pointaction.cxx4
-rw-r--r--cppcanvas/source/mtfrenderer/polypolyaction.cxx24
-rw-r--r--cppcanvas/source/mtfrenderer/textaction.cxx42
-rw-r--r--cppcanvas/source/mtfrenderer/transparencygroupaction.cxx12
6 files changed, 50 insertions, 55 deletions
diff --git a/cppcanvas/source/mtfrenderer/bitmapaction.cxx b/cppcanvas/source/mtfrenderer/bitmapaction.cxx
index 94489145faed..84946014ef0b 100644
--- a/cppcanvas/source/mtfrenderer/bitmapaction.cxx
+++ b/cppcanvas/source/mtfrenderer/bitmapaction.cxx
@@ -201,10 +201,7 @@ namespace cppcanvas
const CanvasSharedPtr& rCanvas,
const OutDevState& rState )
{
- return std::shared_ptr<Action>( new BitmapAction(rBmpEx,
- rDstPoint,
- rCanvas,
- rState ) );
+ return std::make_shared<BitmapAction>(rBmpEx, rDstPoint, rCanvas, rState );
}
std::shared_ptr<Action> BitmapActionFactory::createBitmapAction( const ::BitmapEx& rBmpEx,
@@ -213,11 +210,11 @@ namespace cppcanvas
const CanvasSharedPtr& rCanvas,
const OutDevState& rState )
{
- return std::shared_ptr<Action>( new BitmapAction(rBmpEx,
- rDstPoint,
- rDstSize,
- rCanvas,
- rState ) );
+ return std::make_shared<BitmapAction>(rBmpEx,
+ rDstPoint,
+ rDstSize,
+ rCanvas,
+ rState );
}
}
}
diff --git a/cppcanvas/source/mtfrenderer/lineaction.cxx b/cppcanvas/source/mtfrenderer/lineaction.cxx
index 7b0ba2080cf3..e032432e6848 100644
--- a/cppcanvas/source/mtfrenderer/lineaction.cxx
+++ b/cppcanvas/source/mtfrenderer/lineaction.cxx
@@ -145,10 +145,10 @@ namespace cppcanvas
const CanvasSharedPtr& rCanvas,
const OutDevState& rState )
{
- return std::shared_ptr<Action>( new LineAction( rStartPoint,
- rEndPoint,
- rCanvas,
- rState) );
+ return std::make_shared<LineAction>( rStartPoint,
+ rEndPoint,
+ rCanvas,
+ rState);
}
}
diff --git a/cppcanvas/source/mtfrenderer/pointaction.cxx b/cppcanvas/source/mtfrenderer/pointaction.cxx
index 03000f85b329..38896151b52e 100644
--- a/cppcanvas/source/mtfrenderer/pointaction.cxx
+++ b/cppcanvas/source/mtfrenderer/pointaction.cxx
@@ -160,7 +160,7 @@ namespace cppcanvas
const CanvasSharedPtr& rCanvas,
const OutDevState& rState )
{
- return std::shared_ptr<Action>( new PointAction( rPoint, rCanvas, rState ) );
+ return std::make_shared<PointAction>( rPoint, rCanvas, rState );
}
std::shared_ptr<Action> PointActionFactory::createPointAction( const ::basegfx::B2DPoint& rPoint,
@@ -168,7 +168,7 @@ namespace cppcanvas
const OutDevState& rState,
const ::Color& rColor )
{
- return std::shared_ptr<Action>( new PointAction( rPoint, rCanvas, rState, rColor ) );
+ return std::make_shared<PointAction>( rPoint, rCanvas, rState, rColor );
}
}
}
diff --git a/cppcanvas/source/mtfrenderer/polypolyaction.cxx b/cppcanvas/source/mtfrenderer/polypolyaction.cxx
index 8fa1582b82c9..15fa4f5bc776 100644
--- a/cppcanvas/source/mtfrenderer/polypolyaction.cxx
+++ b/cppcanvas/source/mtfrenderer/polypolyaction.cxx
@@ -454,9 +454,9 @@ namespace cppcanvas
{
OSL_ENSURE( rState.isLineColorSet || rState.isFillColorSet,
"PolyPolyActionFactory::createPolyPolyAction() with empty line and fill color" );
- return std::shared_ptr<Action>( new PolyPolyAction( rPoly, rCanvas, rState,
- rState.isFillColorSet,
- rState.isLineColorSet ) );
+ return std::make_shared<PolyPolyAction>( rPoly, rCanvas, rState,
+ rState.isFillColorSet,
+ rState.isLineColorSet );
}
std::shared_ptr<Action> PolyPolyActionFactory::createPolyPolyAction( const ::basegfx::B2DPolyPolygon& rPoly,
@@ -464,7 +464,7 @@ namespace cppcanvas
const OutDevState& rState,
const rendering::Texture& rTexture )
{
- return std::shared_ptr<Action>( new TexturedPolyPolyAction( rPoly, rCanvas, rState, rTexture ) );
+ return std::make_shared<TexturedPolyPolyAction>( rPoly, rCanvas, rState, rTexture );
}
std::shared_ptr<Action> PolyPolyActionFactory::createLinePolyPolyAction( const ::basegfx::B2DPolyPolygon& rPoly,
@@ -474,9 +474,9 @@ namespace cppcanvas
OSL_ENSURE( rState.isLineColorSet,
"PolyPolyActionFactory::createLinePolyPolyAction() called with empty line color" );
- return std::shared_ptr<Action>( new PolyPolyAction( rPoly, rCanvas, rState,
- false,
- rState.isLineColorSet ) );
+ return std::make_shared<PolyPolyAction>( rPoly, rCanvas, rState,
+ false,
+ rState.isLineColorSet );
}
std::shared_ptr<Action> PolyPolyActionFactory::createPolyPolyAction( const ::basegfx::B2DPolyPolygon& rPoly,
@@ -486,7 +486,7 @@ namespace cppcanvas
{
OSL_ENSURE( rState.isLineColorSet,
"PolyPolyActionFactory::createPolyPolyAction() for strokes called with empty line color" );
- return std::shared_ptr<Action>( new StrokedPolyPolyAction( rPoly, rCanvas, rState, rStrokeAttributes ) );
+ return std::make_shared<StrokedPolyPolyAction>( rPoly, rCanvas, rState, rStrokeAttributes );
}
std::shared_ptr<Action> PolyPolyActionFactory::createPolyPolyAction( const ::basegfx::B2DPolyPolygon& rPoly,
@@ -496,10 +496,10 @@ namespace cppcanvas
{
OSL_ENSURE( rState.isLineColorSet || rState.isFillColorSet,
"PolyPolyActionFactory::createPolyPolyAction() with empty line and fill color" );
- return std::shared_ptr<Action>( new PolyPolyAction( rPoly, rCanvas, rState,
- rState.isFillColorSet,
- rState.isLineColorSet,
- nTransparency ) );
+ return std::make_shared<PolyPolyAction>( rPoly, rCanvas, rState,
+ rState.isFillColorSet,
+ rState.isLineColorSet,
+ nTransparency );
}
}
diff --git a/cppcanvas/source/mtfrenderer/textaction.cxx b/cppcanvas/source/mtfrenderer/textaction.cxx
index f2b50e198606..93e54c11dba5 100644
--- a/cppcanvas/source/mtfrenderer/textaction.cxx
+++ b/cppcanvas/source/mtfrenderer/textaction.cxx
@@ -2075,8 +2075,7 @@ namespace cppcanvas
if( rParms.maTextTransformation )
{
- return std::shared_ptr<Action>(
- new OutlineAction(
+ return std::make_shared<OutlineAction>(
rStartPoint,
rReliefOffset,
rReliefColor,
@@ -2088,12 +2087,11 @@ namespace cppcanvas
rVDev,
rCanvas,
rState,
- *rParms.maTextTransformation ) );
+ *rParms.maTextTransformation );
}
else
{
- return std::shared_ptr<Action>(
- new OutlineAction(
+ return std::make_shared<OutlineAction>(
rStartPoint,
rReliefOffset,
rReliefColor,
@@ -2104,7 +2102,7 @@ namespace cppcanvas
aCharWidthSeq,
rVDev,
rCanvas,
- rState ) );
+ rState );
}
}
@@ -2192,31 +2190,31 @@ namespace cppcanvas
// nope
if( rParms.maTextTransformation )
{
- ret = std::shared_ptr<Action>( new TextAction(
+ ret = std::make_shared<TextAction>(
aStartPoint,
rText,
nStartPos,
nLen,
rCanvas,
rState,
- *rParms.maTextTransformation ) );
+ *rParms.maTextTransformation );
}
else
{
- ret = std::shared_ptr<Action>( new TextAction(
+ ret = std::make_shared<TextAction>(
aStartPoint,
rText,
nStartPos,
nLen,
rCanvas,
- rState ) );
+ rState );
}
}
else
{
// at least one of the effects requested
if( rParms.maTextTransformation )
- ret = std::shared_ptr<Action>( new EffectTextAction(
+ ret = std::make_shared<EffectTextAction>(
aStartPoint,
aReliefOffset,
rReliefColor,
@@ -2229,9 +2227,9 @@ namespace cppcanvas
rVDev,
rCanvas,
rState,
- *rParms.maTextTransformation ) );
+ *rParms.maTextTransformation );
else
- ret = std::shared_ptr<Action>( new EffectTextAction(
+ ret = std::make_shared<EffectTextAction>(
aStartPoint,
aReliefOffset,
rReliefColor,
@@ -2243,7 +2241,7 @@ namespace cppcanvas
nLen,
rVDev,
rCanvas,
- rState ) );
+ rState );
}
}
else
@@ -2258,7 +2256,7 @@ namespace cppcanvas
{
// nope
if( rParms.maTextTransformation )
- ret = std::shared_ptr<Action>( new TextArrayAction(
+ ret = std::make_shared<TextArrayAction>(
aStartPoint,
rText,
nStartPos,
@@ -2266,22 +2264,22 @@ namespace cppcanvas
aCharWidths,
rCanvas,
rState,
- *rParms.maTextTransformation ) );
+ *rParms.maTextTransformation );
else
- ret = std::shared_ptr<Action>( new TextArrayAction(
+ ret = std::make_shared<TextArrayAction>(
aStartPoint,
rText,
nStartPos,
nLen,
aCharWidths,
rCanvas,
- rState ) );
+ rState );
}
else
{
// at least one of the effects requested
if( rParms.maTextTransformation )
- ret = std::shared_ptr<Action>( new EffectTextArrayAction(
+ ret = std::make_shared<EffectTextArrayAction>(
aStartPoint,
aReliefOffset,
rReliefColor,
@@ -2295,9 +2293,9 @@ namespace cppcanvas
rVDev,
rCanvas,
rState,
- *rParms.maTextTransformation ) );
+ *rParms.maTextTransformation );
else
- ret = std::shared_ptr<Action>( new EffectTextArrayAction(
+ ret = std::make_shared<EffectTextArrayAction>(
aStartPoint,
aReliefOffset,
rReliefColor,
@@ -2310,7 +2308,7 @@ namespace cppcanvas
aCharWidths,
rVDev,
rCanvas,
- rState ) );
+ rState );
}
}
return ret;
diff --git a/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx b/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx
index 09e5c200d04d..48be63ed8702 100644
--- a/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx
+++ b/cppcanvas/source/mtfrenderer/transparencygroupaction.cxx
@@ -465,12 +465,12 @@ namespace cppcanvas
const CanvasSharedPtr& rCanvas,
const OutDevState& rState )
{
- return std::shared_ptr<Action>( new TransparencyGroupAction(std::move(rGroupMtf),
- std::move(rAlphaGradient),
- rDstPoint,
- rDstSize,
- rCanvas,
- rState ) );
+ return std::make_shared<TransparencyGroupAction>(std::move(rGroupMtf),
+ std::move(rAlphaGradient),
+ rDstPoint,
+ rDstSize,
+ rCanvas,
+ rState );
}
}