diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index ae24d94dcf6f..e45eb04bbf4a 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -1534,10 +1534,10 @@ void SlideshowImpl::registerShapeEvents( Reference< XShapes > const & xShapes ) if( !xSetInfo.is() || !xSetInfo->hasPropertyByName( gsOnClick ) ) continue; - WrappedShapeEventImplPtr pEvent = std::make_shared(); - xSet->getPropertyValue( gsOnClick ) >>= pEvent->meClickAction; + WrappedShapeEventImpl aEvent; + xSet->getPropertyValue( gsOnClick ) >>= aEvent.meClickAction; - switch( pEvent->meClickAction ) + switch( aEvent.meClickAction ) { case ClickAction_PREVPAGE: case ClickAction_NEXTPAGE: @@ -1547,8 +1547,8 @@ void SlideshowImpl::registerShapeEvents( Reference< XShapes > const & xShapes ) break; case ClickAction_BOOKMARK: if( xSetInfo->hasPropertyByName( gsBookmark ) ) - xSet->getPropertyValue( gsBookmark ) >>= pEvent->maStrBookmark; - if( getSlideNumberForBookmark( pEvent->maStrBookmark ) == -1 ) + xSet->getPropertyValue( gsBookmark ) >>= aEvent.maStrBookmark; + if( getSlideNumberForBookmark( aEvent.maStrBookmark ) == -1 ) continue; break; case ClickAction_DOCUMENT: @@ -1556,17 +1556,17 @@ void SlideshowImpl::registerShapeEvents( Reference< XShapes > const & xShapes ) case ClickAction_PROGRAM: case ClickAction_MACRO: if( xSetInfo->hasPropertyByName( gsBookmark ) ) - xSet->getPropertyValue( gsBookmark ) >>= pEvent->maStrBookmark; + xSet->getPropertyValue( gsBookmark ) >>= aEvent.maStrBookmark; break; case ClickAction_VERB: if( xSetInfo->hasPropertyByName( gsVerb ) ) - xSet->getPropertyValue( gsVerb ) >>= pEvent->mnVerb; + xSet->getPropertyValue( gsVerb ) >>= aEvent.mnVerb; break; default: continue; // skip all others } - maShapeEventMap[ xShape ] = std::move(pEvent); + maShapeEventMap[ xShape ] = std::move(aEvent); if( mxListenerProxy.is() ) mxListenerProxy->addShapeEventListener( xShape ); @@ -1705,9 +1705,10 @@ void SlideshowImpl::click( const Reference< XShape >& xShape ) { SolarMutexGuard aSolarGuard; - WrappedShapeEventImplPtr pEvent = maShapeEventMap[xShape]; - if( !pEvent ) + auto it = maShapeEventMap.find(xShape); + if (it == maShapeEventMap.end()) return; + WrappedShapeEventImpl* pEvent = &it->second; switch( pEvent->meClickAction ) { diff --git a/sd/source/ui/slideshow/slideshowimpl.hxx b/sd/source/ui/slideshow/slideshowimpl.hxx index c0bbc1f9e72b..e4a48d6cbc86 100644 --- a/sd/source/ui/slideshow/slideshowimpl.hxx +++ b/sd/source/ui/slideshow/slideshowimpl.hxx @@ -77,8 +77,6 @@ struct WrappedShapeEventImpl WrappedShapeEventImpl() : meClickAction( css::presentation::ClickAction_NONE ), mnVerb( 0 ) {}; }; -typedef std::shared_ptr< WrappedShapeEventImpl > WrappedShapeEventImplPtr; - class SlideShowListenerProxy : public ::cppu::WeakImplHelper< css::presentation::XSlideShowNavigationListener, css::presentation::XShapeEventListener > { @@ -347,7 +345,7 @@ private: bool mbUsePen; double mdUserPaintStrokeWidth; - std::map< css::uno::Reference< css::drawing::XShape >, WrappedShapeEventImplPtr > + std::map< css::uno::Reference< css::drawing::XShape >, WrappedShapeEventImpl > maShapeEventMap; css::uno::Reference< css::drawing::XDrawPage > mxPreviewDrawPage;