summaryrefslogtreecommitdiff
path: root/slideshow
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 /slideshow
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 'slideshow')
-rw-r--r--slideshow/source/engine/expressionnodefactory.cxx16
-rw-r--r--slideshow/source/engine/screenupdater.cxx2
-rw-r--r--slideshow/source/engine/shapes/appletshape.cxx7
-rw-r--r--slideshow/source/engine/shapes/drawinglayeranimation.cxx5
-rw-r--r--slideshow/source/engine/shapes/gdimtftools.cxx2
-rw-r--r--slideshow/source/engine/shapes/mediashape.cxx5
-rw-r--r--slideshow/source/engine/slide/slideimpl.cxx18
-rw-r--r--slideshow/source/engine/slideview.cxx10
-rw-r--r--slideshow/source/engine/smilfunctionparser.cxx5
9 files changed, 31 insertions, 39 deletions
diff --git a/slideshow/source/engine/expressionnodefactory.cxx b/slideshow/source/engine/expressionnodefactory.cxx
index 74cfd96f8406..f82e09ac2f7e 100644
--- a/slideshow/source/engine/expressionnodefactory.cxx
+++ b/slideshow/source/engine/expressionnodefactory.cxx
@@ -192,48 +192,48 @@ namespace slideshow
std::shared_ptr<ExpressionNode> ExpressionNodeFactory::createConstantValueExpression( double rConstantValue )
{
- return std::shared_ptr<ExpressionNode>( new ConstantValueExpression(rConstantValue) );
+ return std::make_shared<ConstantValueExpression>(rConstantValue);
}
std::shared_ptr<ExpressionNode> ExpressionNodeFactory::createValueTExpression()
{
- return std::shared_ptr<ExpressionNode>( new TValueExpression() );
+ return std::make_shared<TValueExpression>();
}
std::shared_ptr<ExpressionNode> ExpressionNodeFactory::createPlusExpression( const std::shared_ptr<ExpressionNode>& rLHS,
const std::shared_ptr<ExpressionNode>& rRHS )
{
- return std::shared_ptr<ExpressionNode>( new PlusExpression(rLHS, rRHS) );
+ return std::make_shared<PlusExpression>(rLHS, rRHS);
}
std::shared_ptr<ExpressionNode> ExpressionNodeFactory::createMinusExpression( const std::shared_ptr<ExpressionNode>& rLHS,
const std::shared_ptr<ExpressionNode>& rRHS )
{
- return std::shared_ptr<ExpressionNode>( new MinusExpression(rLHS, rRHS) );
+ return std::make_shared<MinusExpression>(rLHS, rRHS);
}
std::shared_ptr<ExpressionNode> ExpressionNodeFactory::createMultipliesExpression( const std::shared_ptr<ExpressionNode>& rLHS,
const std::shared_ptr<ExpressionNode>& rRHS )
{
- return std::shared_ptr<ExpressionNode>( new MultipliesExpression(rLHS, rRHS) );
+ return std::make_shared<MultipliesExpression>(rLHS, rRHS);
}
std::shared_ptr<ExpressionNode> ExpressionNodeFactory::createDividesExpression( const std::shared_ptr<ExpressionNode>& rLHS,
const std::shared_ptr<ExpressionNode>& rRHS )
{
- return std::shared_ptr<ExpressionNode>( new DividesExpression(rLHS, rRHS) );
+ return std::make_shared<DividesExpression>(rLHS, rRHS);
}
std::shared_ptr<ExpressionNode> ExpressionNodeFactory::createMinExpression ( const std::shared_ptr<ExpressionNode>& rOuterFunction,
const std::shared_ptr<ExpressionNode>& rInnerFunction )
{
- return std::shared_ptr<ExpressionNode>( new MinExpression(rOuterFunction, rInnerFunction) );
+ return std::make_shared<MinExpression>(rOuterFunction, rInnerFunction);
}
std::shared_ptr<ExpressionNode> ExpressionNodeFactory::createMaxExpression ( const std::shared_ptr<ExpressionNode>& rOuterFunction,
const std::shared_ptr<ExpressionNode>& rInnerFunction )
{
- return std::shared_ptr<ExpressionNode>( new MaxExpression(rOuterFunction, rInnerFunction) );
+ return std::make_shared<MaxExpression>(rOuterFunction, rInnerFunction);
}
}
diff --git a/slideshow/source/engine/screenupdater.cxx b/slideshow/source/engine/screenupdater.cxx
index cc609fecf97d..1053770d5b5c 100644
--- a/slideshow/source/engine/screenupdater.cxx
+++ b/slideshow/source/engine/screenupdater.cxx
@@ -213,7 +213,7 @@ namespace internal
::std::shared_ptr<ScreenUpdater::UpdateLock> ScreenUpdater::createLock()
{
- return ::std::shared_ptr<ScreenUpdater::UpdateLock>(new ::UpdateLock(*this));
+ return ::std::make_shared<::UpdateLock>(*this);
}
diff --git a/slideshow/source/engine/shapes/appletshape.cxx b/slideshow/source/engine/shapes/appletshape.cxx
index f3b8edc9c02c..37f7b22be047 100644
--- a/slideshow/source/engine/shapes/appletshape.cxx
+++ b/slideshow/source/engine/shapes/appletshape.cxx
@@ -275,15 +275,12 @@ namespace slideshow
std::size_t nNumPropEntries,
const SlideShowContext& rContext )
{
- std::shared_ptr< AppletShape > pAppletShape(
- new AppletShape(xShape,
+ return std::make_shared<AppletShape>(xShape,
nPrio,
rServiceName,
pPropCopyTable,
nNumPropEntries,
- rContext) );
-
- return pAppletShape;
+ rContext);
}
}
}
diff --git a/slideshow/source/engine/shapes/drawinglayeranimation.cxx b/slideshow/source/engine/shapes/drawinglayeranimation.cxx
index b8b500936557..0e377c8b855b 100644
--- a/slideshow/source/engine/shapes/drawinglayeranimation.cxx
+++ b/slideshow/source/engine/shapes/drawinglayeranimation.cxx
@@ -910,9 +910,8 @@ std::shared_ptr<Activity> createDrawingLayerAnimActivity(
try
{
- std::shared_ptr<WakeupEvent> const pWakeupEvent(
- new WakeupEvent( rContext.mrEventQueue.getTimer(),
- rContext.mrActivitiesQueue ) );
+ auto const pWakeupEvent = std::make_shared<WakeupEvent>( rContext.mrEventQueue.getTimer(),
+ rContext.mrActivitiesQueue );
pActivity.reset( new ActivityImpl( rContext, pWakeupEvent, pDrawShape ) );
pWakeupEvent->setActivity( pActivity );
}
diff --git a/slideshow/source/engine/shapes/gdimtftools.cxx b/slideshow/source/engine/shapes/gdimtftools.cxx
index a85a9cdc796c..19ea3d4f51b7 100644
--- a/slideshow/source/engine/shapes/gdimtftools.cxx
+++ b/slideshow/source/engine/shapes/gdimtftools.cxx
@@ -142,7 +142,7 @@ public:
return xMtf;
}
- return GDIMetaFileSharedPtr(new GDIMetaFile(aGraphic.GetGDIMetaFile()));
+ return std::make_shared<GDIMetaFile>(aGraphic.GetGDIMetaFile());
}
private:
diff --git a/slideshow/source/engine/shapes/mediashape.cxx b/slideshow/source/engine/shapes/mediashape.cxx
index 9aa9009a9002..bd2522899156 100644
--- a/slideshow/source/engine/shapes/mediashape.cxx
+++ b/slideshow/source/engine/shapes/mediashape.cxx
@@ -241,10 +241,7 @@ namespace slideshow
double nPrio,
const SlideShowContext& rContext)
{
- std::shared_ptr< MediaShape > pMediaShape(
- new MediaShape(xShape, nPrio, rContext));
-
- return pMediaShape;
+ return std::make_shared<MediaShape>(xShape, nPrio, rContext);
}
}
diff --git a/slideshow/source/engine/slide/slideimpl.cxx b/slideshow/source/engine/slide/slideimpl.cxx
index c164f1e82a61..f58cca2128e6 100644
--- a/slideshow/source/engine/slide/slideimpl.cxx
+++ b/slideshow/source/engine/slide/slideimpl.cxx
@@ -1087,15 +1087,15 @@ SlideSharedPtr createSlide( const uno::Reference< drawing::XDrawPage >&
bool bIntrinsicAnimationsAllowed,
bool bDisableAnimationZOrder )
{
- std::shared_ptr<SlideImpl> pRet( new SlideImpl( xDrawPage, xDrawPages, xRootNode, rEventQueue,
- rEventMultiplexer, rScreenUpdater,
- rActivitiesQueue, rUserEventQueue,
- rCursorManager, rMediaFileManager, rViewContainer,
- xComponentContext, rShapeListenerMap,
- rShapeCursorMap, rPolyPolygonVector, rUserPaintColor,
- dUserPaintStrokeWidth, bUserPaintEnabled,
- bIntrinsicAnimationsAllowed,
- bDisableAnimationZOrder ));
+ auto pRet = std::make_shared<SlideImpl>( xDrawPage, xDrawPages, xRootNode, rEventQueue,
+ rEventMultiplexer, rScreenUpdater,
+ rActivitiesQueue, rUserEventQueue,
+ rCursorManager, rMediaFileManager, rViewContainer,
+ xComponentContext, rShapeListenerMap,
+ rShapeCursorMap, rPolyPolygonVector, rUserPaintColor,
+ dUserPaintStrokeWidth, bUserPaintEnabled,
+ bIntrinsicAnimationsAllowed,
+ bDisableAnimationZOrder );
rEventMultiplexer.addViewHandler( pRet );
diff --git a/slideshow/source/engine/slideview.cxx b/slideshow/source/engine/slideview.cxx
index 9878bab7797f..21f382220eb9 100644
--- a/slideshow/source/engine/slideview.cxx
+++ b/slideshow/source/engine/slideview.cxx
@@ -823,11 +823,11 @@ ViewLayerSharedPtr SlideView::createViewLayer( const basegfx::B2DRange& rLayerBo
if( nNumLayers > LAYER_ULLAGE )
pruneLayers();
- std::shared_ptr<SlideViewLayer> xViewLayer( new SlideViewLayer(mpCanvas,
- getTransformation(),
- rLayerBounds,
- maUserSize,
- this) );
+ auto xViewLayer = std::make_shared<SlideViewLayer>(mpCanvas,
+ getTransformation(),
+ rLayerBounds,
+ maUserSize,
+ this);
maViewLayers.push_back(xViewLayer);
return xViewLayer;
diff --git a/slideshow/source/engine/smilfunctionparser.cxx b/slideshow/source/engine/smilfunctionparser.cxx
index 2ec3d8dc4d3c..a2da99a4f29e 100644
--- a/slideshow/source/engine/smilfunctionparser.cxx
+++ b/slideshow/source/engine/smilfunctionparser.cxx
@@ -247,10 +247,9 @@ namespace slideshow
{
// push complex node, that calcs the value on demand
rNodeStack.push(
- std::shared_ptr<ExpressionNode>(
- new UnaryFunctionExpression(
+ std::make_shared<UnaryFunctionExpression>(
maFunctor,
- pArg ) ) );
+ pArg ) );
}
}