summaryrefslogtreecommitdiff
path: root/slideshow/source/engine/shapes
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-01-24 13:21:10 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-01-25 07:06:10 +0100
commitcee62b1068775b7d0bcd2875e9789c8c36c22057 (patch)
treec093300a02cc6dc5db73ba0a51067cc480ddfdf5 /slideshow/source/engine/shapes
parenta46e768810e82abaf98e5cef02c697c718877974 (diff)
loplugin:makeshared in slideshow
Change-Id: I87dead1ed09aa50c939c03ae8ed3faf9300a8b4a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87354 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'slideshow/source/engine/shapes')
-rw-r--r--slideshow/source/engine/shapes/backgroundshape.cxx5
-rw-r--r--slideshow/source/engine/shapes/drawinglayeranimation.cxx4
-rw-r--r--slideshow/source/engine/shapes/drawshape.cxx14
-rw-r--r--slideshow/source/engine/shapes/externalshapebase.cxx2
-rw-r--r--slideshow/source/engine/shapes/gdimtftools.cxx4
-rw-r--r--slideshow/source/engine/shapes/intrinsicanimationactivity.cxx7
-rw-r--r--slideshow/source/engine/shapes/shapeimporter.cxx4
-rw-r--r--slideshow/source/engine/shapes/viewshape.cxx5
8 files changed, 21 insertions, 24 deletions
diff --git a/slideshow/source/engine/shapes/backgroundshape.cxx b/slideshow/source/engine/shapes/backgroundshape.cxx
index adc550662298..dde159ca477f 100644
--- a/slideshow/source/engine/shapes/backgroundshape.cxx
+++ b/slideshow/source/engine/shapes/backgroundshape.cxx
@@ -288,11 +288,10 @@ namespace slideshow
const uno::Reference< drawing::XDrawPage >& xMasterPage,
const SlideShowContext& rContext )
{
- return ShapeSharedPtr(
- new BackgroundShape(
+ return std::make_shared<BackgroundShape>(
xDrawPage,
xMasterPage,
- rContext ));
+ rContext );
}
}
}
diff --git a/slideshow/source/engine/shapes/drawinglayeranimation.cxx b/slideshow/source/engine/shapes/drawinglayeranimation.cxx
index 0e377c8b855b..46bbb7efd2cb 100644
--- a/slideshow/source/engine/shapes/drawinglayeranimation.cxx
+++ b/slideshow/source/engine/shapes/drawinglayeranimation.cxx
@@ -713,7 +713,7 @@ ActivityImpl::ActivityImpl(
: maContext(rContext),
mpWakeupEvent(pWakeupEvent),
mpParentDrawShape(pParentDrawShape),
- mpListener( new IntrinsicAnimationListener(*this) ),
+ mpListener( std::make_shared<IntrinsicAnimationListener>(*this) ),
maTimer(rContext.mrEventQueue.getTimer()),
mfRotationAngle(0.0),
mbIsShapeAnimated(false),
@@ -912,7 +912,7 @@ std::shared_ptr<Activity> createDrawingLayerAnimActivity(
{
auto const pWakeupEvent = std::make_shared<WakeupEvent>( rContext.mrEventQueue.getTimer(),
rContext.mrActivitiesQueue );
- pActivity.reset( new ActivityImpl( rContext, pWakeupEvent, pDrawShape ) );
+ pActivity = std::make_shared<ActivityImpl>( rContext, pWakeupEvent, pDrawShape );
pWakeupEvent->setActivity( pActivity );
}
catch( uno::RuntimeException& )
diff --git a/slideshow/source/engine/shapes/drawshape.cxx b/slideshow/source/engine/shapes/drawshape.cxx
index a09dd07e19f0..f4a541ecd907 100644
--- a/slideshow/source/engine/shapes/drawshape.cxx
+++ b/slideshow/source/engine/shapes/drawshape.cxx
@@ -69,7 +69,7 @@ namespace slideshow
mxComponentContext);
if (!mpCurrMtf)
- mpCurrMtf.reset( new GDIMetaFile );
+ mpCurrMtf = std::make_shared<GDIMetaFile>();
// TODO(F1): Currently, the scroll metafile will
// never contain any verbose text comments. Thus,
@@ -387,7 +387,7 @@ namespace slideshow
xContainingPage, mnCurrMtfLoadFlags,
mxComponentContext );
if (!mpCurrMtf)
- mpCurrMtf.reset(new GDIMetaFile);
+ mpCurrMtf = std::make_shared<GDIMetaFile>();
maSubsetting.reset( mpCurrMtf );
@@ -547,9 +547,9 @@ namespace slideshow
std::back_insert_iterator< std::vector<double> >( aTimeout ),
std::mem_fn(&MtfAnimationFrame::getDuration) );
- WakeupEventSharedPtr pWakeupEvent(
- new WakeupEvent( rContext.mrEventQueue.getTimer(),
- rContext.mrActivitiesQueue ) );
+ WakeupEventSharedPtr pWakeupEvent =
+ std::make_shared<WakeupEvent>( rContext.mrEventQueue.getTimer(),
+ rContext.mrActivitiesQueue );
ActivitySharedPtr pActivity =
createIntrinsicAnimationActivity(
@@ -604,7 +604,7 @@ namespace slideshow
return;
}
- ViewShapeSharedPtr pNewShape( new ViewShape( rNewLayer ) );
+ ViewShapeSharedPtr pNewShape = std::make_shared<ViewShape>( rNewLayer );
maViewShapes.push_back( pNewShape );
@@ -1015,7 +1015,7 @@ namespace slideshow
ShapeAttributeLayerSharedPtr DrawShape::createAttributeLayer()
{
// create new layer, with last as its new child
- mpAttributeLayer.reset( new ShapeAttributeLayer( mpAttributeLayer ) );
+ mpAttributeLayer = std::make_shared<ShapeAttributeLayer>( mpAttributeLayer );
// Update the local state ids to reflect those of the new layer.
updateStateIds();
diff --git a/slideshow/source/engine/shapes/externalshapebase.cxx b/slideshow/source/engine/shapes/externalshapebase.cxx
index fef7cef6d5d4..52b617ebf8c3 100644
--- a/slideshow/source/engine/shapes/externalshapebase.cxx
+++ b/slideshow/source/engine/shapes/externalshapebase.cxx
@@ -83,7 +83,7 @@ namespace slideshow
const SlideShowContext& rContext ) :
mxComponentContext( rContext.mxComponentContext ),
mxShape( xShape ),
- mpListener( new ExternalShapeBaseListener(*this) ),
+ mpListener( std::make_shared<ExternalShapeBaseListener>(*this) ),
mpShapeManager( rContext.mpSubsettableShapeManager ),
mrEventMultiplexer( rContext.mrEventMultiplexer ),
mnPriority( nPrio ), // TODO(F1): When ZOrder someday becomes usable: make this ( getAPIShapePrio( xShape ) ),
diff --git a/slideshow/source/engine/shapes/gdimtftools.cxx b/slideshow/source/engine/shapes/gdimtftools.cxx
index 2a7bb51a4ae8..3a06b8002dd7 100644
--- a/slideshow/source/engine/shapes/gdimtftools.cxx
+++ b/slideshow/source/engine/shapes/gdimtftools.cxx
@@ -131,7 +131,7 @@ public:
hasUnsupportedActions(aGraphic.GetGDIMetaFile()) ) )
{
// wrap bitmap into GDIMetafile
- GDIMetaFileSharedPtr xMtf(new GDIMetaFile);
+ GDIMetaFileSharedPtr xMtf = std::make_shared<GDIMetaFile>();
::BitmapEx aBmpEx( aGraphic.GetBitmapEx() );
@@ -346,7 +346,7 @@ bool getAnimationFromGraphic( VectorOfMtfAnimationFrames& o_rFrames,
// extract current aVDev content into a new animation
// frame
- GDIMetaFileSharedPtr pMtf( new GDIMetaFile() );
+ GDIMetaFileSharedPtr pMtf = std::make_shared<GDIMetaFile>();
pMtf->AddAction(
new MetaBmpExAction( aEmptyPoint,
BitmapEx(
diff --git a/slideshow/source/engine/shapes/intrinsicanimationactivity.cxx b/slideshow/source/engine/shapes/intrinsicanimationactivity.cxx
index de0bc4e5a2ea..3fe1d59ce8d7 100644
--- a/slideshow/source/engine/shapes/intrinsicanimationactivity.cxx
+++ b/slideshow/source/engine/shapes/intrinsicanimationactivity.cxx
@@ -118,7 +118,7 @@ namespace slideshow
maContext( rContext ),
mpDrawShape( rDrawShape ),
mpWakeupEvent( rWakeupEvent ),
- mpListener( new IntrinsicAnimationListener(*this) ),
+ mpListener( std::make_shared<IntrinsicAnimationListener>(*this) ),
maTimeouts( rTimeouts ),
mnCurrIndex(0),
mnNumLoops(nNumLoops),
@@ -240,12 +240,11 @@ namespace slideshow
const ::std::vector<double>& rTimeouts,
sal_uInt32 nNumLoops)
{
- return ActivitySharedPtr(
- new IntrinsicAnimationActivity(rContext,
+ return std::make_shared<IntrinsicAnimationActivity>(rContext,
rDrawShape,
rWakeupEvent,
rTimeouts,
- nNumLoops) );
+ nNumLoops);
}
}
}
diff --git a/slideshow/source/engine/shapes/shapeimporter.cxx b/slideshow/source/engine/shapes/shapeimporter.cxx
index c3b681017106..06ac4275af1d 100644
--- a/slideshow/source/engine/shapes/shapeimporter.cxx
+++ b/slideshow/source/engine/shapes/shapeimporter.cxx
@@ -477,10 +477,10 @@ ShapeSharedPtr ShapeImporter::importShape() // throw (ShapeLoadFailedException)
if( rTop.mpGroupShape ) // in group particle mode?
{
- pRet.reset( new ShapeOfGroup(
+ pRet = std::make_shared<ShapeOfGroup>(
rTop.mpGroupShape /* container shape */,
xCurrShape, xPropSet,
- mnAscendingPrio ) );
+ mnAscendingPrio );
}
else
{
diff --git a/slideshow/source/engine/shapes/viewshape.cxx b/slideshow/source/engine/shapes/viewshape.cxx
index 8426503671f1..5df9650b4cc7 100644
--- a/slideshow/source/engine/shapes/viewshape.cxx
+++ b/slideshow/source/engine/shapes/viewshape.cxx
@@ -353,10 +353,9 @@ namespace slideshow
const ::basegfx::B2DSize& rSpriteSizePixel(rSpriteBoundsPixel.getRange());
if( !mpSprite )
{
- mpSprite.reset(
- new AnimatedSprite( mpViewLayer,
+ mpSprite = std::make_shared<AnimatedSprite>( mpViewLayer,
rSpriteSizePixel,
- nPrio ));
+ nPrio );
}
else
{