diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-01-24 13:21:10 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-01-25 07:06:10 +0100 |
commit | cee62b1068775b7d0bcd2875e9789c8c36c22057 (patch) | |
tree | c093300a02cc6dc5db73ba0a51067cc480ddfdf5 /slideshow | |
parent | a46e768810e82abaf98e5cef02c697c718877974 (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')
30 files changed, 185 insertions, 234 deletions
diff --git a/slideshow/source/engine/activities/activitiesfactory.cxx b/slideshow/source/engine/activities/activitiesfactory.cxx index eee0f55cda2d..63b39d2d23d5 100644 --- a/slideshow/source/engine/activities/activitiesfactory.cxx +++ b/slideshow/source/engine/activities/activitiesfactory.cxx @@ -420,15 +420,14 @@ AnimationActivitySharedPtr createFromToByActivity( aBy = aTmpValue; } - return AnimationActivitySharedPtr( - new FromToByActivity<BaseType, AnimationType>( + return std::make_shared<FromToByActivity<BaseType, AnimationType>>( aFrom, aTo, aBy, rParms, rAnim, rInterpolator, - bCumulative ) ); + bCumulative ); } /* The following table shows which animator combines with @@ -630,13 +629,12 @@ AnimationActivitySharedPtr createValueListActivity( aValueVector.push_back( aValue ); } - return AnimationActivitySharedPtr( - new ValuesActivity<BaseType, AnimationType>( + return std::make_shared<ValuesActivity<BaseType, AnimationType>>( aValueVector, rParms, rAnim, rInterpolator, - bCumulative ) ); + bCumulative ); } /** Generate Activity for given XAnimate, corresponding to given Value vector @@ -741,10 +739,10 @@ AnimationActivitySharedPtr createActivity( { // since DiscreteActivityBase suspends itself // between the frames, create a WakeupEvent for it. - aActivityParms.mpWakeupEvent.reset( - new WakeupEvent( + aActivityParms.mpWakeupEvent = + std::make_shared<WakeupEvent>( rParms.mrEventQueue.getTimer(), - rParms.mrActivitiesQueue ) ); + rParms.mrActivitiesQueue ); AnimationActivitySharedPtr pActivity( createValueListActivity< DiscreteActivityBase >( @@ -805,10 +803,10 @@ AnimationActivitySharedPtr createActivity( // since DiscreteActivityBase suspends itself // between the frames, create a WakeupEvent for it. - aActivityParms.mpWakeupEvent.reset( - new WakeupEvent( + aActivityParms.mpWakeupEvent = + std::make_shared<WakeupEvent>( rParms.mrEventQueue.getTimer(), - rParms.mrActivitiesQueue ) ); + rParms.mrActivitiesQueue ); AnimationActivitySharedPtr pActivity( createFromToByActivity< DiscreteActivityBase >( @@ -1008,11 +1006,9 @@ AnimationActivitySharedPtr ActivitiesFactory::createSimpleActivity( rParms.mbAutoReverse ); if( bDirectionForward ) - return AnimationActivitySharedPtr( - new SimpleActivity<1>( aActivityParms, rAnim ) ); + return std::make_shared<SimpleActivity<1>>( aActivityParms, rAnim ); else - return AnimationActivitySharedPtr( - new SimpleActivity<0>( aActivityParms, rAnim ) ); + return std::make_shared<SimpleActivity<0>>( aActivityParms, rAnim ); } } // namespace internal diff --git a/slideshow/source/engine/animationfactory.cxx b/slideshow/source/engine/animationfactory.cxx index 4d42fb45a425..ce831d2a4aaf 100644 --- a/slideshow/source/engine/animationfactory.cxx +++ b/slideshow/source/engine/animationfactory.cxx @@ -592,9 +592,8 @@ namespace slideshow typename AnimationBase::ValueType (ShapeAttributeLayer::*pGetValue)() const, void (ShapeAttributeLayer::*pSetValue)( const typename AnimationBase::ValueType& ) ) { - return ::std::shared_ptr< AnimationBase >( - new GenericAnimation< AnimationBase, - SGI_identity< typename AnimationBase::ValueType > >( + return std::make_shared<GenericAnimation< AnimationBase, + SGI_identity< typename AnimationBase::ValueType > >>( rShapeManager, nFlags, pIsValid, @@ -603,7 +602,7 @@ namespace slideshow pSetValue, // no modification necessary, use identity functor here SGI_identity< typename AnimationBase::ValueType >(), - SGI_identity< typename AnimationBase::ValueType >() ) ); + SGI_identity< typename AnimationBase::ValueType >() ); } class Scaler @@ -633,15 +632,14 @@ namespace slideshow void (ShapeAttributeLayer::*pSetValue)( const double& ), double nScaleValue ) { - return NumberAnimationSharedPtr( - new GenericAnimation< NumberAnimation, Scaler >( rShapeManager, + return std::make_shared<GenericAnimation< NumberAnimation, Scaler >>( rShapeManager, nFlags, pIsValid, nDefaultValue / nScaleValue, pGetValue, pSetValue, Scaler( 1.0/nScaleValue ), - Scaler( nScaleValue ) ) ); + Scaler( nScaleValue ) ); } @@ -1077,8 +1075,7 @@ namespace slideshow switch( nTransformType ) { case animations::AnimationTransformType::SCALE: - return PairAnimationSharedPtr( - new TupleAnimation< ::basegfx::B2DSize >( + return std::make_shared<TupleAnimation< ::basegfx::B2DSize >>( rShapeManager, nFlags, &ShapeAttributeLayer::isWidthValid, @@ -1091,11 +1088,10 @@ namespace slideshow rBounds.getRange(), &ShapeAttributeLayer::getWidth, &ShapeAttributeLayer::getHeight, - &ShapeAttributeLayer::setSize ) ); + &ShapeAttributeLayer::setSize ); case animations::AnimationTransformType::TRANSLATE: - return PairAnimationSharedPtr( - new TupleAnimation< ::basegfx::B2DPoint >( + return std::make_shared<TupleAnimation< ::basegfx::B2DPoint >>( rShapeManager, nFlags, &ShapeAttributeLayer::isPosXValid, @@ -1108,7 +1104,7 @@ namespace slideshow rSlideSize, &ShapeAttributeLayer::getPosX, &ShapeAttributeLayer::getPosY, - &ShapeAttributeLayer::setPosition ) ); + &ShapeAttributeLayer::setPosition ); default: ENSURE_OR_THROW( false, @@ -1231,11 +1227,10 @@ namespace slideshow const ::basegfx::B2DVector& rSlideSize, int nFlags ) { - return NumberAnimationSharedPtr( - new PathAnimation( rSVGDPath, nAdditive, + return std::make_shared<PathAnimation>( rSVGDPath, nAdditive, rShapeManager, rSlideSize, - nFlags ) ); + nFlags ); } } diff --git a/slideshow/source/engine/animationnodes/animationbasenode.cxx b/slideshow/source/engine/animationnodes/animationbasenode.cxx index a26f840e1017..ef12aa97e104 100644 --- a/slideshow/source/engine/animationnodes/animationbasenode.cxx +++ b/slideshow/source/engine/animationnodes/animationbasenode.cxx @@ -142,10 +142,10 @@ AnimationBaseNode::AnimationBaseNode( // Slide::prefetchShow() initializes shape // attributes right after animation import (or // the Slide class must be changed). - mpShapeSubset.reset( - new ShapeSubset( mpShape, + mpShapeSubset = + std::make_shared<ShapeSubset>( mpShape, rTreeNode, - mpSubsetManager )); + mpSubsetManager ); // Override NodeContext, and flag this node as // a special independent subset one. This is diff --git a/slideshow/source/engine/animationnodes/animationcolornode.cxx b/slideshow/source/engine/animationnodes/animationcolornode.cxx index 4d6daeec3a05..ac3450ea55e3 100644 --- a/slideshow/source/engine/animationnodes/animationcolornode.cxx +++ b/slideshow/source/engine/animationnodes/animationcolornode.cxx @@ -101,13 +101,12 @@ AnimationActivitySharedPtr AnimationColorNode::createActivity() const // interface, and internally converts HSL to RGB color return ActivitiesFactory::createAnimateActivity( aParms, - HSLColorAnimationSharedPtr( - new HSLWrapper( + std::make_shared<HSLWrapper>( AnimationFactory::createColorPropertyAnimation( mxColorNode->getAttributeName(), getShape(), getContext().mpSubsettableShapeManager, - getSlideSize() ))), + getSlideSize() )), mxColorNode ); default: diff --git a/slideshow/source/engine/animationnodes/animationnodefactory.cxx b/slideshow/source/engine/animationnodes/animationnodefactory.cxx index 7589ce03ae85..e39b268991ee 100644 --- a/slideshow/source/engine/animationnodes/animationnodefactory.cxx +++ b/slideshow/source/engine/animationnodes/animationnodefactory.cxx @@ -133,8 +133,8 @@ public: // normalize things, which does the right thing // here: the subset is only removed after _the // last_ animation node releases the shared ptr. - aContext.mpMasterShapeSubset.reset( - new ShapeSubset( *aContext.mpMasterShapeSubset ) ); + aContext.mpMasterShapeSubset = + std::make_shared<ShapeSubset>( *aContext.mpMasterShapeSubset ); createChild( xChildNode, aContext ); } @@ -233,15 +233,15 @@ bool implCreateIteratedNodes( DocTreeNode::NodeType::LogicalParagraph ) > aTarget.Paragraph, "implCreateIteratedNodes(): paragraph index out of range" ); - pTargetSubset.reset( - new ShapeSubset( + pTargetSubset = + std::make_shared<ShapeSubset>( pTargetShape, // retrieve index aTarget.Paragraph of // type PARAGRAPH from this shape rTreeNodeSupplier.getTreeNode( aTarget.Paragraph, DocTreeNode::NodeType::LogicalParagraph ), - rContext.maContext.mpSubsettableShapeManager ) ); + rContext.maContext.mpSubsettableShapeManager ); // iterate target is not the whole shape, but only // the selected paragraph - subset _must_ be @@ -263,9 +263,9 @@ bool implCreateIteratedNodes( } else { - pTargetSubset.reset( - new ShapeSubset( pTargetShape, - rContext.maContext.mpSubsettableShapeManager )); + pTargetSubset = + std::make_shared<ShapeSubset>( pTargetShape, + rContext.maContext.mpSubsettableShapeManager ); } aContext.mpMasterShapeSubset = pTargetSubset; @@ -397,22 +397,22 @@ bool implCreateIteratedNodes( if( bParagraphTarget ) { // create subsets relative to paragraph subset - aContext.mpMasterShapeSubset.reset( - new ShapeSubset( + aContext.mpMasterShapeSubset = + std::make_shared<ShapeSubset>( pTargetSubset, rTreeNodeSupplier.getSubsetTreeNode( pTargetSubset->getSubset(), i, - eIterateNodeType ) ) ); + eIterateNodeType ) ); } else { // create subsets from main shape - aContext.mpMasterShapeSubset.reset( - new ShapeSubset( pTargetSubset, + aContext.mpMasterShapeSubset = + std::make_shared<ShapeSubset>( pTargetSubset, rTreeNodeSupplier.getTreeNode( i, - eIterateNodeType ) ) ); + eIterateNodeType ) ); } CloningNodeCreator aCreator( rParent, aContext ); @@ -452,61 +452,61 @@ BaseNodeSharedPtr implCreateAnimationNode( return pCreatedNode; case animations::AnimationNodeType::PAR: - pCreatedNode = pCreatedContainer = BaseContainerNodeSharedPtr( - new ParallelTimeContainer( xNode, rParent, rContext ) ); + pCreatedNode = pCreatedContainer = + std::make_shared<ParallelTimeContainer>( xNode, rParent, rContext ); break; case animations::AnimationNodeType::ITERATE: // map iterate container to ParallelTimeContainer. // the iterating functionality is to be found // below, (see method implCreateIteratedNodes) - pCreatedNode = pCreatedContainer = BaseContainerNodeSharedPtr( - new ParallelTimeContainer( xNode, rParent, rContext ) ); + pCreatedNode = pCreatedContainer = + std::make_shared<ParallelTimeContainer>( xNode, rParent, rContext ); break; case animations::AnimationNodeType::SEQ: - pCreatedNode = pCreatedContainer = BaseContainerNodeSharedPtr( - new SequentialTimeContainer( xNode, rParent, rContext ) ); + pCreatedNode = pCreatedContainer = + std::make_shared<SequentialTimeContainer>( xNode, rParent, rContext ); break; case animations::AnimationNodeType::ANIMATE: - pCreatedNode.reset( new PropertyAnimationNode( - xNode, rParent, rContext ) ); + pCreatedNode = std::make_shared<PropertyAnimationNode>( + xNode, rParent, rContext ); break; case animations::AnimationNodeType::SET: - pCreatedNode.reset( new AnimationSetNode( - xNode, rParent, rContext ) ); + pCreatedNode = std::make_shared<AnimationSetNode>( + xNode, rParent, rContext ); break; case animations::AnimationNodeType::ANIMATEMOTION: - pCreatedNode.reset( new AnimationPathMotionNode( - xNode, rParent, rContext ) ); + pCreatedNode = std::make_shared<AnimationPathMotionNode>( + xNode, rParent, rContext ); break; case animations::AnimationNodeType::ANIMATECOLOR: - pCreatedNode.reset( new AnimationColorNode( - xNode, rParent, rContext ) ); + pCreatedNode = std::make_shared<AnimationColorNode>( + xNode, rParent, rContext ); break; case animations::AnimationNodeType::ANIMATETRANSFORM: - pCreatedNode.reset( new AnimationTransformNode( - xNode, rParent, rContext ) ); + pCreatedNode = std::make_shared<AnimationTransformNode>( + xNode, rParent, rContext ); break; case animations::AnimationNodeType::TRANSITIONFILTER: - pCreatedNode.reset( new AnimationTransitionFilterNode( - xNode, rParent, rContext ) ); + pCreatedNode = std::make_shared<AnimationTransitionFilterNode>( + xNode, rParent, rContext ); break; case animations::AnimationNodeType::AUDIO: - pCreatedNode.reset( new AnimationAudioNode( - xNode, rParent, rContext ) ); + pCreatedNode = std::make_shared<AnimationAudioNode>( + xNode, rParent, rContext ); break; case animations::AnimationNodeType::COMMAND: - pCreatedNode.reset( new AnimationCommandNode( - xNode, rParent, rContext ) ); + pCreatedNode = std::make_shared<AnimationCommandNode>( + xNode, rParent, rContext ); break; default: diff --git a/slideshow/source/engine/animationnodes/setactivity.hxx b/slideshow/source/engine/animationnodes/setactivity.hxx index fbe6e3a11397..37e3ff3a53b4 100644 --- a/slideshow/source/engine/animationnodes/setactivity.hxx +++ b/slideshow/source/engine/animationnodes/setactivity.hxx @@ -133,8 +133,7 @@ template <class AnimationT> AnimationActivitySharedPtr makeSetActivity( const ::std::shared_ptr< AnimationT >& rAnimation, const typename AnimationT::ValueType& rToValue ) { - return AnimationActivitySharedPtr( - new SetActivity<AnimationT>(rParms,rAnimation,rToValue) ); + return std::make_shared<SetActivity<AnimationT>>(rParms,rAnimation,rToValue); } } // namespace internal diff --git a/slideshow/source/engine/effectrewinder.cxx b/slideshow/source/engine/effectrewinder.cxx index 41f6976fc6ed..729dc2198db1 100644 --- a/slideshow/source/engine/effectrewinder.cxx +++ b/slideshow/source/engine/effectrewinder.cxx @@ -96,20 +96,20 @@ void EffectRewinder::initialize() // b,c) a slide was started or ended (in which case the effect counter // is reset. - mpAnimationStartHandler.reset( - new RewinderAnimationEventHandler( + mpAnimationStartHandler = + std::make_shared<RewinderAnimationEventHandler>( [this]( const AnimationNodeSharedPtr& pNode) - { return this->notifyAnimationStart( pNode ); } ) ); + { return this->notifyAnimationStart( pNode ); } ); mrEventMultiplexer.addAnimationStartHandler(mpAnimationStartHandler); - mpSlideStartHandler.reset( - new RewinderEventHandler( - [this]() { return this->resetEffectCount(); } ) ); + mpSlideStartHandler = + std::make_shared<RewinderEventHandler>( + [this]() { return this->resetEffectCount(); } ); mrEventMultiplexer.addSlideStartHandler(mpSlideStartHandler); - mpSlideEndHandler.reset( - new RewinderEventHandler( - [this]() { return this->resetEffectCount(); } ) ); + mpSlideEndHandler = + std::make_shared<RewinderEventHandler>( + [this]() { return this->resetEffectCount(); } ); mrEventMultiplexer.addSlideEndHandler(mpSlideEndHandler); } diff --git a/slideshow/source/engine/rehearsetimingsactivity.cxx b/slideshow/source/engine/rehearsetimingsactivity.cxx index ce07413054a4..48920bae0e51 100644 --- a/slideshow/source/engine/rehearsetimingsactivity.cxx +++ b/slideshow/source/engine/rehearsetimingsactivity.cxx @@ -189,12 +189,12 @@ std::shared_ptr<RehearseTimingsActivity> RehearseTimingsActivity::create( std::shared_ptr<RehearseTimingsActivity> pActivity( new RehearseTimingsActivity( rContext )); - pActivity->mpMouseHandler.reset( - new MouseHandler(*pActivity) ); - pActivity->mpWakeUpEvent.reset( - new WakeupEvent( rContext.mrEventQueue.getTimer(), + pActivity->mpMouseHandler = + std::make_shared<MouseHandler>(*pActivity); + pActivity->mpWakeUpEvent = + std::make_shared<WakeupEvent>( rContext.mrEventQueue.getTimer(), pActivity, - rContext.mrActivitiesQueue )); + rContext.mrActivitiesQueue ); rContext.mrEventMultiplexer.addViewHandler( pActivity ); 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 { diff --git a/slideshow/source/engine/slide/layermanager.cxx b/slideshow/source/engine/slide/layermanager.cxx index 543308ef5496..eb97b32da11d 100644 --- a/slideshow/source/engine/slide/layermanager.cxx +++ b/slideshow/source/engine/slide/layermanager.cxx @@ -611,7 +611,7 @@ namespace slideshow bool LayerManager::renderTo( const ::cppcanvas::CanvasSharedPtr& rTargetCanvas ) const { bool bRet( true ); - ViewLayerSharedPtr pTmpLayer( new DummyLayer( rTargetCanvas ) ); + ViewLayerSharedPtr pTmpLayer = std::make_shared<DummyLayer>( rTargetCanvas ); for( const auto& rShape : maAllShapes ) { diff --git a/slideshow/source/engine/slide/slideimpl.cxx b/slideshow/source/engine/slide/slideimpl.cxx index f58cca2128e6..ebd16911d2c0 100644 --- a/slideshow/source/engine/slide/slideimpl.cxx +++ b/slideshow/source/engine/slide/slideimpl.cxx @@ -307,10 +307,10 @@ SlideImpl::SlideImpl( const uno::Reference< drawing::XDrawPage >& xDra mxDrawPage( xDrawPage ), mxDrawPagesSupplier( xDrawPages ), mxRootNode( xRootNode ), - mpLayerManager( new LayerManager( + mpLayerManager( std::make_shared<LayerManager>( rViewContainer, bDisableAnimationZOrder) ), - mpShapeManager( new ShapeManagerImpl( + mpShapeManager( std::make_shared<ShapeManagerImpl>( rEventMultiplexer, mpLayerManager, rCursorManager, diff --git a/slideshow/source/engine/slide/userpaintoverlay.cxx b/slideshow/source/engine/slide/userpaintoverlay.cxx index e3f1954557b5..179b937d874a 100644 --- a/slideshow/source/engine/slide/userpaintoverlay.cxx +++ b/slideshow/source/engine/slide/userpaintoverlay.cxx @@ -443,7 +443,7 @@ namespace slideshow const SlideShowContext& rContext, const PolyPolygonVector& rPolygons, bool bActive ) : - mpHandler( new PaintOverlayHandler( rStrokeColor, + mpHandler( std::make_shared<PaintOverlayHandler>( rStrokeColor, nStrokeWidth, rContext.mrScreenUpdater, rContext.mrViewContainer, diff --git a/slideshow/source/engine/slideshowimpl.cxx b/slideshow/source/engine/slideshowimpl.cxx index 9e9893ffdbba..0e3d0f87e927 100644 --- a/slideshow/source/engine/slideshowimpl.cxx +++ b/slideshow/source/engine/slideshowimpl.cxx @@ -534,7 +534,7 @@ SlideShowImpl::SlideShowImpl( maShapeCursors(), maUserPaintColor(), maUserPaintStrokeWidth(4.0), - mpPresTimer( new canvas::tools::ElapsedTime ), + mpPresTimer( std::make_shared<canvas::tools::ElapsedTime>() ), maScreenUpdater(maViewContainer), maEventQueue( mpPresTimer ), maEventMultiplexer( maEventQueue, @@ -593,10 +593,10 @@ SlideShowImpl::SlideShowImpl( } } - mpListener.reset( new SeparateListenerImpl( + mpListener = std::make_shared<SeparateListenerImpl>( *this, maScreenUpdater, - maEventQueue )); + maEventQueue ); maEventMultiplexer.addSlideAnimationsEndHandler( mpListener ); maEventMultiplexer.addViewRepaintHandler( mpListener ); maEventMultiplexer.addHyperlinkHandler( mpListener, 0.0 ); @@ -2332,7 +2332,7 @@ std::shared_ptr<avmedia::MediaTempFile> SlideShowImpl::getMediaTempFile(const OU OUString sTempUrl; if (::avmedia::CreateMediaTempFile(xInStream, sTempUrl, sDesiredExtension)) - aRet.reset(new avmedia::MediaTempFile(sTempUrl)); + aRet = std::make_shared<avmedia::MediaTempFile>(sTempUrl); xInStream->closeInput(); } diff --git a/slideshow/source/engine/smilfunctionparser.cxx b/slideshow/source/engine/smilfunctionparser.cxx index a2da99a4f29e..4953ccde2fcc 100644 --- a/slideshow/source/engine/smilfunctionparser.cxx +++ b/slideshow/source/engine/smilfunctionparser.cxx @@ -509,7 +509,7 @@ namespace slideshow const ParserContextSharedPtr& getParserContext() { - static ParserContextSharedPtr lcl_parserContext( new ParserContext ); + static ParserContextSharedPtr lcl_parserContext = std::make_shared<ParserContext>(); // clear node stack (since we reuse the static object, that's // the whole point here) diff --git a/slideshow/source/engine/transitions/parametricpolypolygonfactory.cxx b/slideshow/source/engine/transitions/parametricpolypolygonfactory.cxx index 2f190257902d..94ee99cecd48 100644 --- a/slideshow/source/engine/transitions/parametricpolypolygonfactory.cxx +++ b/slideshow/source/engine/transitions/parametricpolypolygonfactory.cxx @@ -61,61 +61,46 @@ namespace slideshow switch (nType) { case BARWIPE: - return ParametricPolyPolygonSharedPtr( - new BarWipePolyPolygon ); + return std::make_shared<BarWipePolyPolygon>(); case BLINDSWIPE: - return ParametricPolyPolygonSharedPtr( - new BarWipePolyPolygon( 6 ) ); + return std::make_shared<BarWipePolyPolygon>( 6 ); case BOXWIPE: - return ParametricPolyPolygonSharedPtr( - new BoxWipe( nSubType == LEFTCENTER || + return std::make_shared<BoxWipe>( nSubType == LEFTCENTER || nSubType == TOPCENTER || nSubType == RIGHTCENTER|| - nSubType == BOTTOMCENTER ) ); + nSubType == BOTTOMCENTER ); case FOURBOXWIPE: - return ParametricPolyPolygonSharedPtr( - new FourBoxWipe( nSubType == CORNERSOUT ) ); + return std::make_shared<FourBoxWipe>( nSubType == CORNERSOUT ); case BARNDOORWIPE: - return ParametricPolyPolygonSharedPtr( - new BarnDoorWipe ); + return std::make_shared<BarnDoorWipe>(); case DIAGONALWIPE: - return ParametricPolyPolygonSharedPtr( - new BarWipePolyPolygon ); + return std::make_shared<BarWipePolyPolygon>(); case VEEWIPE: - return ParametricPolyPolygonSharedPtr( - new VeeWipe ); + return std::make_shared<VeeWipe>(); case IRISWIPE: - return ParametricPolyPolygonSharedPtr( - new IrisWipe ); + return std::make_shared<IrisWipe>(); case ELLIPSEWIPE: - return ParametricPolyPolygonSharedPtr( - new EllipseWipe(nSubType) ); + return std::make_shared<EllipseWipe>(nSubType); case CHECKERBOARDWIPE: - return ParametricPolyPolygonSharedPtr( - new CheckerBoardWipe ); + return std::make_shared<CheckerBoardWipe>(); case RANDOMBARWIPE: - return ParametricPolyPolygonSharedPtr( - new RandomWipe( 128, true /* bars */ ) ); + return std::make_shared<RandomWipe>( 128, true /* bars */ ); case DISSOLVE: - return ParametricPolyPolygonSharedPtr( - new RandomWipe( 16 * 16, // for now until dxcanvas is faster + return std::make_shared<RandomWipe>( 16 * 16, // for now until dxcanvas is faster // 64 * 64 /* elements */, - false /* dissolve */ ) ); + false /* dissolve */ ); case WATERFALLWIPE: - return ParametricPolyPolygonSharedPtr( - new WaterfallWipe( + return std::make_shared<WaterfallWipe>( 128, // flipOnYAxis: nSubType == VERTICALRIGHT || - nSubType == HORIZONTALLEFT ) ); + nSubType == HORIZONTALLEFT ); case CLOCKWIPE: - return ParametricPolyPolygonSharedPtr( - new ClockWipe ); + return std::make_shared<ClockWipe>(); case FANWIPE: - return ParametricPolyPolygonSharedPtr( - new FanWipe( // center: + return std::make_shared<FanWipe>( // center: nSubType == CENTERTOP || - nSubType == CENTERRIGHT ) ); + nSubType == CENTERRIGHT ); case PINWHEELWIPE: { sal_Int32 blades; switch (nSubType) { @@ -135,12 +120,10 @@ namespace slideshow blades = 2; break; } - return ParametricPolyPolygonSharedPtr( - new PinWheelWipe( blades ) ); + return std::make_shared<PinWheelWipe>( blades ); } case SNAKEWIPE: - return ParametricPolyPolygonSharedPtr( - new SnakeWipe( + return std::make_shared<SnakeWipe>( // elements: 8 * 8, // diagonal: @@ -152,10 +135,9 @@ namespace slideshow nSubType == TOPLEFTVERTICAL || nSubType == TOPRIGHTDIAGONAL || nSubType == BOTTOMLEFTDIAGONAL - ) ); + ); case PARALLELSNAKESWIPE: - return ParametricPolyPolygonSharedPtr( - new ParallelSnakesWipe( + return std::make_shared<ParallelSnakesWipe>( // elements: 8 * 8, // diagonal: @@ -172,28 +154,25 @@ namespace slideshow nSubType == HORIZONTALTOPRIGHTOPPOSITE || nSubType == DIAGONALBOTTOMLEFTOPPOSITE || nSubType == DIAGONALTOPLEFTOPPOSITE - ) ); + ); case SPIRALWIPE: - return ParametricPolyPolygonSharedPtr( - new SpiralWipe( + return std::make_shared<SpiralWipe>( // elements: 8 * 8, // flipOnYAxis: nSubType == TOPLEFTCOUNTERCLOCKWISE || nSubType == TOPRIGHTCOUNTERCLOCKWISE || nSubType == BOTTOMRIGHTCOUNTERCLOCKWISE || - nSubType == BOTTOMLEFTCOUNTERCLOCKWISE ) ); + nSubType == BOTTOMLEFTCOUNTERCLOCKWISE ); case BOXSNAKESWIPE: - return ParametricPolyPolygonSharedPtr( - new BoxSnakesWipe( + return std::make_shared<BoxSnakesWipe>( // elements: 8 * 8, // fourBox: nSubType == FOURBOXVERTICAL || - nSubType == FOURBOXHORIZONTAL ) ); + nSubType == FOURBOXHORIZONTAL ); case SINGLESWEEPWIPE: - return ParametricPolyPolygonSharedPtr( - new SweepWipe( + return std::make_shared<SweepWipe>( // center: nSubType == CLOCKWISETOP || nSubType == CLOCKWISERIGHT || @@ -206,10 +185,9 @@ namespace slideshow // flipOnYAxis: nSubType == COUNTERCLOCKWISEBOTTOMLEFT || nSubType == COUNTERCLOCKWISETOPRIGHT - ) ); + ); case DOUBLESWEEPWIPE: - return ParametricPolyPolygonSharedPtr( - new SweepWipe( + return std::make_shared<SweepWipe>( // center: nSubType == PARALLELVERTICAL || nSubType == PARALLELDIAGONAL || @@ -221,17 +199,16 @@ namespace slideshow nSubType == OPPOSITEVERTICAL || nSubType == OPPOSITEHORIZONTAL, // flipOnYAxis: - false ) ); + false ); case DOUBLEFANWIPE: - return ParametricPolyPolygonSharedPtr( - new FanWipe( + return std::make_shared<FanWipe>( //center: true, // single: false, // fanIn: nSubType == FANINVERTICAL || - nSubType == FANINHORIZONTAL ) ); + nSubType == FANINHORIZONTAL ); case TRIANGLEWIPE: return ParametricPolyPolygonSharedPtr( FigureWipe::createTriangleWipe() ); @@ -263,18 +240,16 @@ namespace slideshow case MISCDIAGONALWIPE: { switch (nSubType) { case DOUBLEBARNDOOR: - return ParametricPolyPolygonSharedPtr( - new BarnDoorWipe( true /* doubled */ ) ); + return std::make_shared<BarnDoorWipe>( true /* doubled */ ); case DOUBLEDIAMOND: - return ParametricPolyPolygonSharedPtr( - new DoubleDiamondWipe ); + return std::make_shared<DoubleDiamondWipe>(); } break; } case ZIGZAGWIPE: - return ParametricPolyPolygonSharedPtr( new ZigZagWipe(5) ); + return std::make_shared<ZigZagWipe>(5); case BARNZIGZAGWIPE: - return ParametricPolyPolygonSharedPtr( new BarnZigZagWipe(5) ); + return std::make_shared<BarnZigZagWipe>(5); case BOWTIEWIPE: case BARNVEEWIPE: @@ -284,8 +259,7 @@ namespace slideshow case SALOONDOORWIPE: case WINDSHIELDWIPE: // for now, map to barwipe transition - return ParametricPolyPolygonSharedPtr( - new BarWipePolyPolygon ); + return std::make_shared<BarWipePolyPolygon>(); default: case PUSHWIPE: diff --git a/slideshow/source/engine/transitions/shapetransitionfactory.cxx b/slideshow/source/engine/transitions/shapetransitionfactory.cxx index 666ce116b6be..ce4da4cb1611 100644 --- a/slideshow/source/engine/transitions/shapetransitionfactory.cxx +++ b/slideshow/source/engine/transitions/shapetransitionfactory.cxx @@ -219,13 +219,12 @@ AnimationActivitySharedPtr createShapeTransitionByType( // create a clip activity from that pGeneratedActivity = ActivitiesFactory::createSimpleActivity( rParms, - NumberAnimationSharedPtr( - new ClippingAnimation( + std::make_shared<ClippingAnimation>( pPoly, rShapeManager, *pTransitionInfo, xTransition->getDirection(), - xTransition->getMode() ) ), + xTransition->getMode() ), true ); } break; @@ -302,14 +301,13 @@ AnimationActivitySharedPtr createShapeTransitionByType( // create a clip activity from that pGeneratedActivity = ActivitiesFactory::createSimpleActivity( rParms, - NumberAnimationSharedPtr( - new ClippingAnimation( + std::make_shared<ClippingAnimation>( pPoly, rShapeManager, *getTransitionInfo( animations::TransitionType::BARWIPE, nBarWipeSubType ), bDirectionForward, - xTransition->getMode() ) ), + xTransition->getMode() ), true ); } break; diff --git a/slideshow/source/engine/transitions/slidechangebase.cxx b/slideshow/source/engine/transitions/slidechangebase.cxx index 6c53690017cc..e0ef0b060b1f 100644 --- a/slideshow/source/engine/transitions/slidechangebase.cxx +++ b/slideshow/source/engine/transitions/slidechangebase.cxx @@ -125,7 +125,7 @@ SlideBitmapSharedPtr SlideChangeBase::createBitmap( const UnoViewSharedPtr& slideSizePixel.getY() ), 0x000000FFU ); - pRet.reset( new SlideBitmap( pBitmap )); + pRet = std::make_shared<SlideBitmap>( pBitmap ); } else { diff --git a/slideshow/source/engine/transitions/slidetransitionfactory.cxx b/slideshow/source/engine/transitions/slidetransitionfactory.cxx index 30724effa283..52b2bdc0b105 100644 --- a/slideshow/source/engine/transitions/slidetransitionfactory.cxx +++ b/slideshow/source/engine/transitions/slidetransitionfactory.cxx @@ -730,27 +730,25 @@ NumberAnimationSharedPtr createPushWipeTransition( if( bComb ) { - return NumberAnimationSharedPtr( - new CombTransition( leavingSlide, + return std::make_shared<CombTransition>( leavingSlide, pEnteringSlide, pSoundPlayer, rViewContainer, rScreenUpdater, rEventMultiplexer, aDirection, - 24 /* comb with 12 stripes */ )); + 24 /* comb with 12 stripes */ ); } else { - return NumberAnimationSharedPtr( - new MovingSlideChange( leavingSlide, + return std::make_shared<MovingSlideChange>( leavingSlide, pEnteringSlide, pSoundPlayer, rViewContainer, rScreenUpdater, rEventMultiplexer, aDirection, - aDirection )); + aDirection ); } } @@ -816,8 +814,7 @@ NumberAnimationSharedPtr createSlideWipeTransition( // the 'leaving' slide. - return NumberAnimationSharedPtr( - new MovingSlideChange( + return std::make_shared<MovingSlideChange>( o3tl::optional<SlideSharedPtr>() /* no slide */, pEnteringSlide, pSoundPlayer, @@ -825,7 +822,7 @@ NumberAnimationSharedPtr createSlideWipeTransition( rScreenUpdater, rEventMultiplexer, basegfx::B2DVector(), - aInDirection )); + aInDirection ); } else { @@ -834,15 +831,14 @@ NumberAnimationSharedPtr createSlideWipeTransition( // and the old one is moving off in the foreground. - return NumberAnimationSharedPtr( - new MovingSlideChange( leavingSlide, + return std::make_shared<MovingSlideChange>( leavingSlide, pEnteringSlide, pSoundPlayer, rViewContainer, rScreenUpdater, rEventMultiplexer, aInDirection, - basegfx::B2DVector() )); + basegfx::B2DVector() ); } } @@ -953,15 +949,14 @@ NumberAnimationSharedPtr TransitionFactory::createSlideTransition( nTransitionType, nTransitionSubType ) ); // create a clip transition from that - return NumberAnimationSharedPtr( - new ClippedSlideChange( pEnteringSlide, + return std::make_shared<ClippedSlideChange>( pEnteringSlide, pPoly, *pTransitionInfo, rViewContainer, rScreenUpdater, rEventMultiplexer, bTransitionDirection, - pSoundPlayer )); + pSoundPlayer ); } case TransitionInfo::TRANSITION_SPECIAL: @@ -1070,25 +1065,23 @@ NumberAnimationSharedPtr TransitionFactory::createSlideTransition( } if( nTransitionType == animations::TransitionType::FADE ) - return NumberAnimationSharedPtr( - new FadingSlideChange( + return std::make_shared<FadingSlideChange>( leavingSlide, pEnteringSlide, aFadeColor, pSoundPlayer, rViewContainer, rScreenUpdater, - rEventMultiplexer )); + rEventMultiplexer ); else - return NumberAnimationSharedPtr( - new CutSlideChange( + return std::make_shared<CutSlideChange>( leavingSlide, pEnteringSlide, rTransitionFadeColor, pSoundPlayer, rViewContainer, rScreenUpdater, - rEventMultiplexer )); + rEventMultiplexer ); } } } diff --git a/slideshow/source/engine/usereventqueue.cxx b/slideshow/source/engine/usereventqueue.cxx index 44078a390cb4..51a725fa7de7 100644 --- a/slideshow/source/engine/usereventqueue.cxx +++ b/slideshow/source/engine/usereventqueue.cxx @@ -495,7 +495,7 @@ void UserEventQueue::registerEvent( if( !rHandler ) { // create handler - rHandler.reset( new Handler( mrEventQueue ) ); + rHandler = std::make_shared<Handler>( mrEventQueue ); // register handler on EventMultiplexer rRegistrationFunctor( rHandler ); } @@ -515,7 +515,7 @@ void UserEventQueue::registerEvent( if( !rHandler ) { // create handler - rHandler.reset( new Handler( mrEventQueue ) ); + rHandler = std::make_shared<Handler>( mrEventQueue ); // register handler on EventMultiplexer rRegistrationFunctor( rHandler ); @@ -659,9 +659,9 @@ void UserEventQueue::registerShapeClickEvent( const EventSharedPtr& rEvent, if( !mpShapeClickEventHandler ) { // create handler - mpShapeClickEventHandler.reset( - new ShapeClickEventHandler(mrCursorManager, - mrEventQueue) ); + mpShapeClickEventHandler = + std::make_shared<ShapeClickEventHandler>(mrCursorManager, + mrEventQueue); // register handler on EventMultiplexer mrMultiplexer.addClickHandler( mpShapeClickEventHandler, 1.0 ); @@ -722,8 +722,8 @@ void UserEventQueue::registerSkipEffectEvent( { if(!mpSkipEffectEventHandler) { - mpSkipEffectEventHandler.reset( - new SkipEffectEventHandler( mrEventQueue, mrMultiplexer ) ); + mpSkipEffectEventHandler = + std::make_shared<SkipEffectEventHandler>( mrEventQueue, mrMultiplexer ); // register the handler on _two_ sources: we want the // nextEffect events, e.g. space bar, to trigger clicks, as well! mrMultiplexer.addClickHandler( mpSkipEffectEventHandler, @@ -750,9 +750,9 @@ void UserEventQueue::registerShapeDoubleClickEvent( if( !mpShapeDoubleClickEventHandler ) { // create handler - mpShapeDoubleClickEventHandler.reset( - new ShapeClickEventHandler(mrCursorManager, - mrEventQueue) ); + mpShapeDoubleClickEventHandler = + std::make_shared<ShapeClickEventHandler>(mrCursorManager, + mrEventQueue); // register handler on EventMultiplexer mrMultiplexer.addDoubleClickHandler( mpShapeDoubleClickEventHandler, diff --git a/slideshow/source/inc/delayevent.hxx b/slideshow/source/inc/delayevent.hxx index 1389b806885e..9585910bf689 100644 --- a/slideshow/source/inc/delayevent.hxx +++ b/slideshow/source/inc/delayevent.hxx @@ -78,7 +78,7 @@ private: template <typename FuncT> inline EventSharedPtr makeDelay_( FuncT const& func, double nTimeout, OUString const& rsDescription ) { - return EventSharedPtr( new Delay( func, nTimeout, rsDescription ) ); + return std::make_shared<Delay>( func, nTimeout, rsDescription ); } /** Generate immediate event @@ -91,7 +91,7 @@ inline EventSharedPtr makeDelay_( FuncT const& func, double nTimeout, OUString c template <typename FuncT> inline EventSharedPtr makeEvent_( FuncT const& func, OUString const& rsDescription) { - return EventSharedPtr( new Delay( func, 0.0, rsDescription ) ); + return std::make_shared<Delay>( func, 0.0, rsDescription ); } diff --git a/slideshow/source/inc/interruptabledelayevent.hxx b/slideshow/source/inc/interruptabledelayevent.hxx index 2d79625ee897..ee2ae17dfb15 100644 --- a/slideshow/source/inc/interruptabledelayevent.hxx +++ b/slideshow/source/inc/interruptabledelayevent.hxx @@ -129,8 +129,8 @@ namespace slideshow InterruptableEventPair aRes; aRes.mpImmediateEvent = makeEvent( rFunctor, "makeInterruptableDelay"); - aRes.mpTimeoutEvent.reset( new DelayFacade( aRes.mpImmediateEvent, - nTimeout ) ); + aRes.mpTimeoutEvent = std::make_shared<DelayFacade>( aRes.mpImmediateEvent, + nTimeout ); return aRes; } diff --git a/slideshow/test/slidetest.cxx b/slideshow/test/slidetest.cxx index e47d4a749dbf..1ba6e71638d1 100644 --- a/slideshow/test/slidetest.cxx +++ b/slideshow/test/slidetest.cxx @@ -51,10 +51,10 @@ public: mpTestView = createTestView(); maViews.addView( mpTestView ); - mpLayerManager.reset( - new target::LayerManager( + mpLayerManager = + std::make_shared<target::LayerManager>( maViews, - false )); + false ); } void tearDown() override diff --git a/slideshow/test/testview.cxx b/slideshow/test/testview.cxx index c4884516d490..237fb3d386b4 100644 --- a/slideshow/test/testview.cxx +++ b/slideshow/test/testview.cxx @@ -213,7 +213,7 @@ public: virtual target::ViewLayerSharedPtr createViewLayer( const basegfx::B2DRange& rLayerBounds ) const override { - maViewLayers.push_back( TestViewSharedPtr(new ImplTestView())); + maViewLayers.push_back( std::make_shared<ImplTestView>()); maViewLayers.back()->resize( rLayerBounds ); return maViewLayers.back(); |