diff options
Diffstat (limited to 'slideshow/source/engine/slideshowimpl.cxx')
-rw-r--r-- | slideshow/source/engine/slideshowimpl.cxx | 532 |
1 files changed, 266 insertions, 266 deletions
diff --git a/slideshow/source/engine/slideshowimpl.cxx b/slideshow/source/engine/slideshowimpl.cxx index 4ef0ca09f4f7..41b5f664a341 100644 --- a/slideshow/source/engine/slideshowimpl.cxx +++ b/slideshow/source/engine/slideshowimpl.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -138,7 +138,7 @@ public: seconds. */ FrameSynchronization (const double nFrameDuration); - + /** Set the current time as the time at which the current frame is displayed. From this the target time of the next frame is derived. */ @@ -191,22 +191,22 @@ private: /****************************************************************************** - + SlideShowImpl This class encapsulates the slideshow presentation viewer. - + With an instance of this class, it is possible to statically and dynamically show a presentation, as defined by the constructor-provided draw model (represented by a sequence of ::com::sun::star::drawing::XDrawPage objects). - + It is possible to show the presentation on multiple views simultaneously (e.g. for a multi-monitor setup). Since this class also relies on user interaction, the corresponding XSlideShowView interface provides means to register some UI event listeners (mostly borrowed from awt::XWindow interface). - + Since currently (mid 2004), OOo isn't very well suited to multi-threaded rendering, this class relies on <em>very frequent</em> external update() calls, which will render the @@ -220,18 +220,18 @@ private: affairs (I've actually tried threading here, but failed miserably when using the VCL canvas as the render backend - deadlocked). - + ******************************************************************************/ typedef cppu::WeakComponentImplHelper1<presentation::XSlideShow> SlideShowImplBase; typedef ::std::vector< ::cppcanvas::PolyPolygonSharedPtr> PolyPolygonVector; - + /// Maps XDrawPage for annotations persistence typedef ::std::map< ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage>, PolyPolygonVector> PolygonMap; - + class SlideShowImpl : private cppu::BaseMutex, public CursorManager, public SlideShowImplBase @@ -281,7 +281,7 @@ public: phase, when shape effects are running, and the phase after the last shape animation has ended, but before the next slide transition starts. - + This method notifies the end of the third phase. */ void notifySlideEnded (const bool bReverse); @@ -290,7 +290,7 @@ public: has been clicked. */ bool notifyHyperLinkClicked( rtl::OUString const& hyperLink ); - + /** Notification from eventmultiplexer that an animation event has occoured. This will be forewarded to all registered XSlideShowListener */ @@ -358,32 +358,32 @@ private: transition. */ void redisplayCurrentSlide (void); - + protected: // WeakComponentImplHelperBase - virtual void SAL_CALL disposing(); - - bool isDisposed() const + virtual void SAL_CALL disposing(); + + bool isDisposed() const { return (rBHelper.bDisposed || rBHelper.bInDispose); } - + private: struct SeparateListenerImpl; friend struct SeparateListenerImpl; struct PrefetchPropertiesFunc; friend struct PrefetchPropertiesFunc; - + /// Stop currently running show. void stopShow(); - + ///Find a polygons vector in maPolygons (map) PolygonMap::iterator findPolygons( uno::Reference<drawing::XDrawPage> const& xDrawPage); - + /// Creates a new slide. SlideSharedPtr makeSlide( uno::Reference<drawing::XDrawPage> const& xDrawPage, uno::Reference<drawing::XDrawPagesSupplier> const& xDrawPages, uno::Reference<animations::XAnimationNode> const& xRootNode ); - + /// Checks whether the given slide/animation node matches mpPrefetchSlide static bool matches( SlideSharedPtr const& pSlide, @@ -396,19 +396,19 @@ private: else return (!xSlide.is() && !xNode.is()); } - + /// Resets the current slide transition sound object with a new one: SoundPlayerSharedPtr resetSlideTransitionSound( uno::Any const& url = uno::Any(), bool bLoopSound = false ); - + /// stops the current slide transition sound void stopSlideTransitionSound(); /** Prepare a slide transition - + This method registers all necessary events and activities for a slide transition. - + @return the slide change activity, or NULL for no transition effect */ ActivitySharedPtr createSlideTransition( @@ -416,11 +416,11 @@ private: const SlideSharedPtr& rLeavingSlide, const SlideSharedPtr& rEnteringSlide, const EventSharedPtr& rTransitionEndEvent ); - + /** Request/release the wait symbol. The wait symbol is displayed when there are more requests then releases. Locking the wait symbol helps to avoid intermediate repaints. - + Do not call this method directly. Use WaitSymbolLock instead. */ void requestWaitSymbol (void); @@ -433,7 +433,7 @@ private: { mrSlideShowImpl.releaseWaitSymbol(); } private: SlideShowImpl& mrSlideShowImpl; }; - + /// Filter requested cursor shape against hard slideshow cursors (wait, etc.) sal_Int16 calcActiveCursor( sal_Int16 nCursorShape ) const; @@ -445,29 +445,29 @@ private: /// all registered views UnoViewContainer maViewContainer; - + /// all registered slide show listeners cppu::OInterfaceContainerHelper maListenerContainer; - + /// map of vectors, containing all registered listeners for a shape ShapeEventListenerMap maShapeEventListeners; /// map of sal_Int16 values, specifying the mouse cursor for every shape ShapeCursorMap maShapeCursors; - + //map of vector of Polygons, containing polygons drawn on each slide. PolygonMap maPolygons; - + boost::optional<RGBColor> maUserPaintColor; - + boost::optional<double> maUserPaintStrokeWidth; - + //changed for the eraser project - boost::optional<bool> maEraseAllInk; - boost::optional<bool> maSwitchPenMode; - boost::optional<bool> maSwitchEraserMode; - boost::optional<sal_Int32> maEraseInk; + boost::optional<bool> maEraseAllInk; + boost::optional<bool> maSwitchPenMode; + boost::optional<bool> maSwitchEraserMode; + boost::optional<sal_Int32> maEraseInk; //end changed - + boost::shared_ptr<canvas::tools::ElapsedTime> mpPresTimer; ScreenUpdater maScreenUpdater; EventQueue maEventQueue; @@ -483,7 +483,7 @@ private: /// the current slide transition sound object: SoundPlayerSharedPtr mpCurrentSlideTransitionSound; - + uno::Reference<uno::XComponentContext> mxComponentContext; uno::Reference< presentation::XTransitionFactory> mxOptionalTransitionFactory; @@ -502,7 +502,7 @@ private: uno::Reference<animations::XAnimationNode> mxPrefetchAnimationNode; sal_Int16 mnCurrentCursor; - + sal_Int32 mnWaitSymbolRequestCount; bool mbAutomaticAdvancementMode; bool mbImageAnimationsAllowed; @@ -534,12 +534,12 @@ struct SlideShowImpl::SeparateListenerImpl : public EventHandler, ScreenUpdater& mrScreenUpdater; EventQueue& mrEventQueue; - SeparateListenerImpl( SlideShowImpl& rShow, + SeparateListenerImpl( SlideShowImpl& rShow, ScreenUpdater& rScreenUpdater, EventQueue& rEventQueue ) : - mrShow( rShow ), + mrShow( rShow ), mrScreenUpdater( rScreenUpdater ), - mrEventQueue( rEventQueue ) + mrEventQueue( rEventQueue ) {} // EventHandler @@ -596,7 +596,7 @@ SlideShowImpl::SlideShowImpl( maEventMultiplexer( maEventQueue, maViewContainer ), maActivitiesQueue( mpPresTimer ), - maUserEventQueue( maEventMultiplexer, + maUserEventQueue( maEventMultiplexer, maEventQueue, *this ), mpDummyPtr(), @@ -627,8 +627,8 @@ SlideShowImpl::SlideShowImpl( { // keep care not constructing any UNO references to this inside ctor, // shift that code to create()! - - uno::Reference<lang::XMultiComponentFactory> xFactory( + + uno::Reference<lang::XMultiComponentFactory> xFactory( mxComponentContext->getServiceManager() ); if( xFactory.is() ) @@ -636,10 +636,10 @@ SlideShowImpl::SlideShowImpl( try { // #i82460# try to retrieve special transition factory - mxOptionalTransitionFactory.set( - xFactory->createInstanceWithContext( + mxOptionalTransitionFactory.set( + xFactory->createInstanceWithContext( ::rtl::OUString::createFromAscii( "com.sun.star.presentation.TransitionFactory" ), - mxComponentContext ), + mxComponentContext ), uno::UNO_QUERY ); } catch (loader::CannotActivateFactoryException const&) @@ -648,7 +648,7 @@ SlideShowImpl::SlideShowImpl( } mpListener.reset( new SeparateListenerImpl( - *this, + *this, maScreenUpdater, maEventQueue )); maEventMultiplexer.addSlideAnimationsEndHandler( mpListener ); @@ -664,7 +664,7 @@ void SlideShowImpl::disposing() osl::MutexGuard const guard( m_aMutex ); maEffectRewinder.dispose(); - + // stop slide transition sound, if any: stopSlideTransitionSound(); @@ -678,13 +678,13 @@ void SlideShowImpl::disposing() mpWaitSymbol.reset(); - if( mpRehearseTimingsActivity ) + if( mpRehearseTimingsActivity ) { mpRehearseTimingsActivity->dispose(); mpRehearseTimingsActivity.reset(); } - if( mpListener ) + if( mpListener ) { maEventMultiplexer.removeSlideAnimationsEndHandler(mpListener); maEventMultiplexer.removeViewRepaintHandler(mpListener); @@ -693,7 +693,7 @@ void SlideShowImpl::disposing() maEventMultiplexer.removeAnimationEndHandler( mpListener ); mpListener.reset(); - } + } maUserEventQueue.clear(); maActivitiesQueue.clear(); @@ -720,7 +720,7 @@ void SlideShowImpl::disposing() /// stops the current slide transition sound void SlideShowImpl::stopSlideTransitionSound() { - if (mpCurrentSlideTransitionSound) + if (mpCurrentSlideTransitionSound) { mpCurrentSlideTransitionSound->stopPlayback(); mpCurrentSlideTransitionSound->dispose(); @@ -742,15 +742,15 @@ SoundPlayerSharedPtr SlideShowImpl::resetSlideTransitionSound( const uno::Any& r stopSlideTransitionSound(); - if (url.getLength() > 0) + if (url.getLength() > 0) { - try + try { mpCurrentSlideTransitionSound = SoundPlayer::create( maEventMultiplexer, url, mxComponentContext ); mpCurrentSlideTransitionSound->setPlaybackLoop( bLoopSound ); } - catch (lang::NoSupportException const&) + catch (lang::NoSupportException const&) { // catch possible exceptions from SoundPlayer, since // being not able to playback the sound is not a hard @@ -771,12 +771,12 @@ ActivitySharedPtr SlideShowImpl::createSlideTransition( "createSlideTransition(): No views" ); ENSURE_OR_THROW( rEnteringSlide, "createSlideTransition(): No entering slide" ); - + // return empty transition, if slide transitions // are disabled. if (mbNoSlideTransitions) return ActivitySharedPtr(); - + // retrieve slide change parameters from XDrawPage uno::Reference< beans::XPropertySet > xPropSet( xDrawPage, uno::UNO_QUERY ); @@ -797,7 +797,7 @@ ActivitySharedPtr SlideShowImpl::createSlideTransition( "Could not extract slide transition type from XDrawPage - assuming no transition\n" ); return ActivitySharedPtr(); } - + sal_Int16 nTransitionSubType(0); if( !getPropertyValue( nTransitionSubType, xPropSet, @@ -807,7 +807,7 @@ ActivitySharedPtr SlideShowImpl::createSlideTransition( "Could not extract slide transition subtype from XDrawPage - assuming no transition\n" ); return ActivitySharedPtr(); } - + bool bTransitionDirection(false); if( !getPropertyValue( bTransitionDirection, xPropSet, @@ -816,7 +816,7 @@ ActivitySharedPtr SlideShowImpl::createSlideTransition( OSL_TRACE( "createSlideTransition(): " "Could not extract slide transition direction from XDrawPage - assuming default direction\n" ); } - + sal_Int32 aUnoColor(0); if( !getPropertyValue( aUnoColor, xPropSet, @@ -836,7 +836,7 @@ ActivitySharedPtr SlideShowImpl::createSlideTransition( if( !getPropertyValue( bLoopSound, xPropSet, OUSTR("LoopSound") ) ) OSL_TRACE( "createSlideTransition(): Could not get slide property 'LoopSound' - using no sound\n" ); - + NumberAnimationSharedPtr pTransition( TransitionFactory::createSlideTransition( rLeavingSlide, @@ -866,7 +866,7 @@ ActivitySharedPtr SlideShowImpl::createSlideTransition( "Could not extract slide transition duration from XDrawPage - assuming no transition\n" ); return ActivitySharedPtr(); } - + sal_Int32 nMinFrames(5); if( !getPropertyValue( nMinFrames, xPropSet, @@ -875,12 +875,12 @@ ActivitySharedPtr SlideShowImpl::createSlideTransition( OSL_TRACE( "createSlideTransition(): " "No minimal number of frames given - assuming 5\n" ); } - + // prefetch slide transition bitmaps, but postpone it after // displaySlide() has finished - sometimes, view size has not yet // reached final size - maEventQueue.addEvent( - makeEvent( + maEventQueue.addEvent( + makeEvent( boost::bind( &::slideshow::internal::Animation::prefetch, pTransition, @@ -911,9 +911,9 @@ PolygonMap::iterator SlideShowImpl::findPolygons( uno::Reference<drawing::XDrawP // TODO(P2) : Optimze research in the map. bool bFound = false; PolygonMap::iterator aIter=maPolygons.begin(); - - - while(aIter!=maPolygons.end() && !bFound) + + + while(aIter!=maPolygons.end() && !bFound) { if(aIter->first == xDrawPage) bFound = true; @@ -922,7 +922,7 @@ PolygonMap::iterator SlideShowImpl::findPolygons( uno::Reference<drawing::XDrawP } return aIter; -} +} SlideSharedPtr SlideShowImpl::makeSlide( uno::Reference<drawing::XDrawPage> const& xDrawPage, @@ -935,8 +935,8 @@ SlideSharedPtr SlideShowImpl::makeSlide( //Retrieve polygons for the current slide PolygonMap::iterator aIter; aIter = findPolygons(xDrawPage); - - const SlideSharedPtr pSlide( createSlide(xDrawPage, + + const SlideSharedPtr pSlide( createSlide(xDrawPage, xDrawPages, xRootNode, maEventQueue, @@ -955,8 +955,8 @@ SlideSharedPtr SlideShowImpl::makeSlide( !!maUserPaintColor, mbImageAnimationsAllowed, mbDisableAnimationZOrder) ); - - // prefetch show content (reducing latency for slide + + // prefetch show content (reducing latency for slide // bitmap and effect start later on) pSlide->prefetch(); @@ -979,7 +979,7 @@ void SlideShowImpl::requestWaitSymbol (void) mpWaitSymbol->show(); } } - + void SlideShowImpl::releaseWaitSymbol (void) { --mnWaitSymbolRequestCount; @@ -1009,7 +1009,7 @@ sal_Int16 SlideShowImpl::calcActiveCursor( sal_Int16 nCursorShape ) const return nCursorShape; } - + void SlideShowImpl::stopShow() { @@ -1021,10 +1021,10 @@ void SlideShowImpl::stopShow() //Register polygons in the map if(findPolygons(mpCurrentSlide->getXDrawPage()) != maPolygons.end()) maPolygons.erase(mpCurrentSlide->getXDrawPage()); - - maPolygons.insert(make_pair(mpCurrentSlide->getXDrawPage(),mpCurrentSlide->getPolygons())); + + maPolygons.insert(make_pair(mpCurrentSlide->getXDrawPage(),mpCurrentSlide->getPolygons())); } - + // clear all queues maEventQueue.clear(); maActivitiesQueue.clear(); @@ -1041,7 +1041,7 @@ void SlideShowImpl::stopShow() // re-enable automatic effect advancement // (maEventQueue.clear() above might have killed // maEventMultiplexer's tick events) - if (mbAutomaticAdvancementMode) + if (mbAutomaticAdvancementMode) { // toggle automatic mode (enabling just again is // ignored by EventMultiplexer) @@ -1052,7 +1052,7 @@ void SlideShowImpl::stopShow() -class SlideShowImpl::PrefetchPropertiesFunc +class SlideShowImpl::PrefetchPropertiesFunc { public: PrefetchPropertiesFunc( SlideShowImpl * that_, @@ -1062,13 +1062,13 @@ public: mrbSkipAllMainSequenceEffects(rbSkipAllMainSequenceEffects), mrbSkipSlideTransition(rbSkipSlideTransition) {} - + void operator()( beans::PropertyValue const& rProperty ) const { if (rProperty.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM("Prefetch") )) + RTL_CONSTASCII_STRINGPARAM("Prefetch") )) { uno::Sequence<uno::Any> seq; - if ((rProperty.Value >>= seq) && seq.getLength() == 2) + if ((rProperty.Value >>= seq) && seq.getLength() == 2) { seq[0] >>= mpSlideShowImpl->mxPrefetchSlide; seq[1] >>= mpSlideShowImpl->mxPrefetchAnimationNode; @@ -1084,7 +1084,7 @@ public: { rProperty.Value >>= mrbSkipSlideTransition; } - else + else { OSL_ENSURE( false, rtl::OUStringToOString( rProperty.Name, RTL_TEXTENCODING_UTF8 ).getStr() ); @@ -1117,8 +1117,8 @@ void SlideShowImpl::displaySlide( mxDrawPagesSupplier = xDrawPages; #else mxDrawPagesSupplier = NULL; -#endif - +#endif + stopShow(); // MUST call that: results in // maUserEventQueue.clear(). What's more, // stopShow()'s currSlide->hide() call is @@ -1133,7 +1133,7 @@ void SlideShowImpl::displaySlide( std::for_each( rProperties.getConstArray(), rProperties.getConstArray() + rProperties.getLength(), PrefetchPropertiesFunc(this, bSkipAllMainSequenceEffects, bSkipSlideTransition) ); - + OSL_ENSURE( !maViewContainer.empty(), "### no views!" ); if (maViewContainer.empty()) return; @@ -1141,20 +1141,20 @@ void SlideShowImpl::displaySlide( // this here might take some time { WaitSymbolLock aLock (*this); - + mpPreviousSlide = mpCurrentSlide; mpCurrentSlide.reset(); - if (matches( mpPrefetchSlide, xSlide, xRootNode )) + if (matches( mpPrefetchSlide, xSlide, xRootNode )) { // prefetched slide matches: mpCurrentSlide = mpPrefetchSlide; } - else + else mpCurrentSlide = makeSlide( xSlide, xDrawPages, xRootNode ); - + OSL_ASSERT( mpCurrentSlide ); - if (mpCurrentSlide) + if (mpCurrentSlide) { basegfx::B2DSize oldSlideSize; if( mpPreviousSlide ) @@ -1165,19 +1165,19 @@ void SlideShowImpl::displaySlide( // push new transformation to all views, if size changed if( !mpPreviousSlide || oldSlideSize != slideSize ) { - std::for_each( maViewContainer.begin(), + std::for_each( maViewContainer.begin(), maViewContainer.end(), boost::bind( &View::setViewSize, _1, boost::cref(slideSize) )); - + // explicitly notify view change here, // because transformation might have changed: // optimization, this->notifyViewChange() would // repaint slide which is not necessary. maEventMultiplexer.notifyViewsChanged(); } - - // create slide transition, and add proper end event + + // create slide transition, and add proper end event // (which then starts the slide effects // via CURRENT_SLIDE.show()) ActivitySharedPtr pSlideChangeActivity ( @@ -1185,7 +1185,7 @@ void SlideShowImpl::displaySlide( mpCurrentSlide->getXDrawPage(), mpPreviousSlide, mpCurrentSlide, - makeEvent( + makeEvent( boost::bind( &SlideShowImpl::notifySlideTransitionEnded, this, @@ -1200,18 +1200,18 @@ void SlideShowImpl::displaySlide( // anymore. pSlideChangeActivity.reset(); } - - if (pSlideChangeActivity) + + if (pSlideChangeActivity) { // factory generated a slide transition - activate it! maActivitiesQueue.addActivity( pSlideChangeActivity ); } - else + else { // no transition effect on this slide - schedule slide // effect start event right away. - maEventQueue.addEvent( - makeEvent( + maEventQueue.addEvent( + makeEvent( boost::bind( &SlideShowImpl::notifySlideTransitionEnded, this, @@ -1242,15 +1242,15 @@ void SlideShowImpl::redisplayCurrentSlide (void) // precondition: must only be called from the main thread! DBG_TESTSOLARMUTEX(); stopShow(); - + OSL_ENSURE( !maViewContainer.empty(), "### no views!" ); if (maViewContainer.empty()) return; // No transition effect on this slide - schedule slide // effect start event right away. - maEventQueue.addEvent( - makeEvent( + maEventQueue.addEvent( + makeEvent( boost::bind( &SlideShowImpl::notifySlideTransitionEnded, this, @@ -1268,7 +1268,7 @@ sal_Bool SlideShowImpl::nextEffect() throw (uno::RuntimeException) if (isDisposed()) return false; - + // precondition: must only be called from the main thread! DBG_TESTSOLARMUTEX(); @@ -1278,14 +1278,14 @@ sal_Bool SlideShowImpl::nextEffect() throw (uno::RuntimeException) return maEventMultiplexer.notifyNextEffect(); } - + sal_Bool SlideShowImpl::previousEffect() throw (uno::RuntimeException) { osl::MutexGuard const guard( m_aMutex ); if (isDisposed()) return false; - + // precondition: must only be called from the main thread! DBG_TESTSOLARMUTEX(); @@ -1310,12 +1310,12 @@ void SlideShowImpl::rewindEffectToPreviousSlide (void) // effect because there are no effects on the current slide or none has // yet been displayed. Go to the previous slide. notifySlideEnded(true); - + // Process pending events once more in order to have the following // screen update show the last effect. Not sure whether this should be // necessary. maEventQueue.forceEmpty(); - + // We have to call the screen updater before the wait symbol is turned // off. Otherwise the wait symbol would force the display of an // intermediate state of the slide (before the effects are replayed.) @@ -1357,7 +1357,7 @@ sal_Bool SlideShowImpl::pause( sal_Bool bPauseShow ) if (isDisposed()) return false; - + // precondition: must only be called from the main thread! DBG_TESTSOLARMUTEX(); @@ -1366,9 +1366,9 @@ sal_Bool SlideShowImpl::pause( sal_Bool bPauseShow ) mpPresTimer->pauseTimer(); else mpPresTimer->continueTimer(); - + maEventMultiplexer.notifyPauseMode(bPauseShow); - + mbShowPaused = bPauseShow; return true; } @@ -1380,7 +1380,7 @@ uno::Reference<drawing::XDrawPage> SlideShowImpl::getCurrentSlide() if (isDisposed()) return uno::Reference<drawing::XDrawPage>(); - + // precondition: must only be called from the main thread! DBG_TESTSOLARMUTEX(); @@ -1398,7 +1398,7 @@ sal_Bool SlideShowImpl::addView( if (isDisposed()) return false; - + // precondition: must only be called from the main thread! DBG_TESTSOLARMUTEX(); @@ -1406,18 +1406,18 @@ sal_Bool SlideShowImpl::addView( ENSURE_OR_RETURN_FALSE( xView.is(), "addView(): Invalid view" ); ENSURE_OR_RETURN_FALSE( xView->getCanvas().is(), "addView(): View does not provide a valid canvas" ); - + UnoViewSharedPtr const pView( createSlideView( - xView, + xView, maEventQueue, maEventMultiplexer )); if (!maViewContainer.addView( pView )) return false; // view already added - + // initialize view content // ======================= - if (mpCurrentSlide) + if (mpCurrentSlide) { // set view transformation const basegfx::B2ISize slideSize = mpCurrentSlide->getSlideSize(); @@ -1425,7 +1425,7 @@ sal_Bool SlideShowImpl::addView( slideSize.getY() ) ); } - // clear view area (since its newly added, + // clear view area (since its newly added, // we need a clean slate) pView->clearAll(); @@ -1443,26 +1443,26 @@ sal_Bool SlideShowImpl::removeView( throw (uno::RuntimeException) { osl::MutexGuard const guard( m_aMutex ); - + // precondition: must only be called from the main thread! DBG_TESTSOLARMUTEX(); ENSURE_OR_RETURN_FALSE( xView.is(), "removeView(): Invalid view" ); - + UnoViewSharedPtr const pView( maViewContainer.removeView( xView ) ); if( !pView ) return false; // view was not added in the first place - + // remove view from EventMultiplexer (mouse events etc.) maEventMultiplexer.notifyViewRemoved( pView ); - + pView->_dispose(); return true; } void SlideShowImpl::registerUserPaintPolygons( const uno::Reference< lang::XMultiServiceFactory >& xDocFactory ) throw (uno::RuntimeException) -{ +{ //Retrieve Polygons if user ends presentation by context menu if (mpCurrentSlide) { @@ -1471,67 +1471,67 @@ void SlideShowImpl::registerUserPaintPolygons( const uno::Reference< lang::XMult maPolygons.insert(make_pair(mpCurrentSlide->getXDrawPage(),mpCurrentSlide->getPolygons())); } - + //Creating the layer for shapes // query for the XLayerManager uno::Reference< drawing::XLayerSupplier > xLayerSupplier(xDocFactory, uno::UNO_QUERY); uno::Reference< container::XNameAccess > xNameAccess = xLayerSupplier->getLayerManager(); - + uno::Reference< drawing::XLayerManager > xLayerManager(xNameAccess, uno::UNO_QUERY); // create a layer and set its properties uno::Reference< drawing::XLayer > xDrawnInSlideshow = xLayerManager->insertNewByIndex(xLayerManager->getCount()); uno::Reference< beans::XPropertySet > xLayerPropSet(xDrawnInSlideshow, uno::UNO_QUERY); - + //Layer Name which enables to catch annotations rtl::OUString layerName = rtl::OUString::createFromAscii("DrawnInSlideshow"); uno::Any aPropLayer; - + aPropLayer <<= layerName; xLayerPropSet->setPropertyValue(rtl::OUString::createFromAscii("Name"), aPropLayer); - + aPropLayer <<= true; xLayerPropSet->setPropertyValue(rtl::OUString::createFromAscii("IsVisible"), aPropLayer); - + aPropLayer <<= false; xLayerPropSet->setPropertyValue(rtl::OUString::createFromAscii("IsLocked"), aPropLayer); PolygonMap::iterator aIter=maPolygons.begin(); - + PolyPolygonVector aPolygons; ::cppcanvas::PolyPolygonSharedPtr pPolyPoly; ::basegfx::B2DPolyPolygon b2DPolyPoly; - + //Register polygons for each slide - while(aIter!=maPolygons.end()) + while(aIter!=maPolygons.end()) { aPolygons = aIter->second; //Get shapes for the slide ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > Shapes(aIter->first, ::com::sun::star::uno::UNO_QUERY); //Retrieve polygons for one slide - for( PolyPolygonVector::iterator aIterPoly=aPolygons.begin(), + for( PolyPolygonVector::iterator aIterPoly=aPolygons.begin(), aEnd=aPolygons.end(); aIterPoly!=aEnd; ++aIterPoly ) - { + { pPolyPoly = (*aIterPoly); - b2DPolyPoly = ::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(pPolyPoly->getUNOPolyPolygon()); - - //Normally there is only one polygon + b2DPolyPoly = ::basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(pPolyPoly->getUNOPolyPolygon()); + + //Normally there is only one polygon for(sal_uInt32 i=0; i< b2DPolyPoly.count();i++) { const ::basegfx::B2DPolygon& aPoly = b2DPolyPoly.getB2DPolygon(i); sal_uInt32 nPoints = aPoly.count(); - + if( nPoints > 1) { //create the PolyLineShape uno::Reference< uno::XInterface > polyshape(xDocFactory->createInstance( - rtl::OUString::createFromAscii("com.sun.star.drawing.PolyLineShape") ) ); + rtl::OUString::createFromAscii("com.sun.star.drawing.PolyLineShape") ) ); uno::Reference< drawing::XShape > rPolyShape(polyshape, uno::UNO_QUERY); - + //Add the shape to the slide Shapes->add(rPolyShape); - - //Retrieve shape properties + + //Retrieve shape properties uno::Reference< beans::XPropertySet > aXPropSet = uno::Reference< beans::XPropertySet >( rPolyShape, uno::UNO_QUERY ); //Construct a sequence of points sequence drawing::PointSequenceSequence aRetval; @@ -1546,8 +1546,8 @@ void SlideShowImpl::registerUserPaintPolygons( const uno::Reference< lang::XMult for( sal_uInt32 n = 0; n < nPoints; n++ ) { //Create a point from the polygon - *pInnerSequence++ = awt::Point( - basegfx::fround(aPoly.getB2DPoint(n).getX()), + *pInnerSequence++ = awt::Point( + basegfx::fround(aPoly.getB2DPoint(n).getX()), basegfx::fround(aPoly.getB2DPoint(n).getY())); } @@ -1555,37 +1555,37 @@ void SlideShowImpl::registerUserPaintPolygons( const uno::Reference< lang::XMult //Give the built PointSequenceSequence. uno::Any aParam; aParam <<= aRetval; - aXPropSet->setPropertyValue( rtl::OUString::createFromAscii("PolyPolygon"), aParam ); + aXPropSet->setPropertyValue( rtl::OUString::createFromAscii("PolyPolygon"), aParam ); //LineStyle : SOLID by default - uno::Any aAny; - drawing::LineStyle eLS; + uno::Any aAny; + drawing::LineStyle eLS; eLS = drawing::LineStyle_SOLID; aAny <<= eLS; aXPropSet->setPropertyValue( rtl::OUString::createFromAscii("LineStyle"), aAny ); //LineColor - sal_uInt32 nLineColor; + sal_uInt32 nLineColor; nLineColor = pPolyPoly->getRGBALineColor(); - //Transform polygon color from RRGGBBAA to AARRGGBB + //Transform polygon color from RRGGBBAA to AARRGGBB aAny <<= RGBAColor2UnoColor(nLineColor); aXPropSet->setPropertyValue( rtl::OUString::createFromAscii("LineColor"), aAny ); - + //LineWidth - double fLineWidth; + double fLineWidth; fLineWidth = pPolyPoly->getStrokeWidth(); aAny <<= (sal_Int32)fLineWidth; - aXPropSet->setPropertyValue( rtl::OUString::createFromAscii("LineWidth"), aAny ); + aXPropSet->setPropertyValue( rtl::OUString::createFromAscii("LineWidth"), aAny ); - // make polygons special + // make polygons special xLayerManager->attachShapeToLayer(rPolyShape, xDrawnInSlideshow); } - } + } } ++aIter; } } - + sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) throw (uno::RuntimeException) { @@ -1602,19 +1602,19 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) { double nTimeout(0.0); mbAutomaticAdvancementMode = (rProperty.Value >>= nTimeout); - if (mbAutomaticAdvancementMode) + if (mbAutomaticAdvancementMode) { maEventMultiplexer.setAutomaticTimeout( nTimeout ); } maEventMultiplexer.setAutomaticMode( mbAutomaticAdvancementMode ); return true; } - + if (rProperty.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("UserPaintColor") )) { sal_Int32 nColor(0); - if (rProperty.Value >>= nColor) + if (rProperty.Value >>= nColor) { OSL_ENSURE( mbMouseVisible, "setProperty(): User paint overrides invisible mouse" ); @@ -1623,7 +1623,7 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) maUserPaintColor.reset( unoColor2RGBColor( nColor ) ); maEventMultiplexer.notifyUserPaintColor( *maUserPaintColor ); } - else + else { // disable user paint maUserPaintColor.reset(); @@ -1635,31 +1635,31 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) return true; } - + //adding support for erasing features in UserPaintOverlay if (rProperty.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("EraseAllInk") )) { bool nEraseAllInk(false); - if (rProperty.Value >>= nEraseAllInk) + if (rProperty.Value >>= nEraseAllInk) { OSL_ENSURE( mbMouseVisible, "setProperty(): User paint overrides invisible mouse" ); - + // enable user paint maEraseAllInk.reset( nEraseAllInk ); maEventMultiplexer.notifyEraseAllInk( *maEraseAllInk ); } - else + else { // disable user paint maEraseAllInk.reset(); maEventMultiplexer.notifyUserPaintDisabled(); } - + if( mnCurrentCursor == awt::SystemPointer::ARROW ) resetCursor(); - + return true; } @@ -1667,7 +1667,7 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) RTL_CONSTASCII_STRINGPARAM("SwitchPenMode") )) { bool nSwitchPenMode(false); - if (rProperty.Value >>= nSwitchPenMode) + if (rProperty.Value >>= nSwitchPenMode) { OSL_ENSURE( mbMouseVisible, "setProperty(): User paint overrides invisible mouse" ); @@ -1678,7 +1678,7 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) maEventMultiplexer.notifySwitchPenMode(); } } - + if( mnCurrentCursor == awt::SystemPointer::ARROW ) resetCursor(); return true; @@ -1689,7 +1689,7 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) RTL_CONSTASCII_STRINGPARAM("SwitchEraserMode") )) { bool nSwitchEraserMode(false); - if (rProperty.Value >>= nSwitchEraserMode) + if (rProperty.Value >>= nSwitchEraserMode) { OSL_ENSURE( mbMouseVisible, "setProperty(): User paint overrides invisible mouse" ); @@ -1699,7 +1699,7 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) maEventMultiplexer.notifySwitchEraserMode(); } } - + if( mnCurrentCursor == awt::SystemPointer::ARROW ) resetCursor(); return true; @@ -1711,28 +1711,28 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) RTL_CONSTASCII_STRINGPARAM("EraseInk") )) { sal_Int32 nEraseInk(100); - if (rProperty.Value >>= nEraseInk) + if (rProperty.Value >>= nEraseInk) { OSL_ENSURE( mbMouseVisible, "setProperty(): User paint overrides invisible mouse" ); - + // enable user paint maEraseInk.reset( nEraseInk ); maEventMultiplexer.notifyEraseInkWidth( *maEraseInk ); } - else - { + else + { // disable user paint maEraseInk.reset(); maEventMultiplexer.notifyUserPaintDisabled(); } - + if( mnCurrentCursor == awt::SystemPointer::ARROW ) resetCursor(); - + return true; } - + // new Property for pen's width if (rProperty.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("UserPaintStrokeWidth") )) @@ -1755,27 +1755,27 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) resetCursor(); return true; } - + if (rProperty.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM("AdvanceOnClick") )) + RTL_CONSTASCII_STRINGPARAM("AdvanceOnClick") )) { sal_Bool bAdvanceOnClick = sal_False; if (! (rProperty.Value >>= bAdvanceOnClick)) return false; maUserEventQueue.setAdvanceOnClick( bAdvanceOnClick ); return true; - } - + } + if (rProperty.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM("DisableAnimationZOrder") )) + RTL_CONSTASCII_STRINGPARAM("DisableAnimationZOrder") )) { sal_Bool bDisableAnimationZOrder = sal_False; if (! (rProperty.Value >>= bDisableAnimationZOrder)) return false; mbDisableAnimationZOrder = bDisableAnimationZOrder == sal_True; return true; - } - + } + if (rProperty.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ImageAnimationsAllowed") ) ) { @@ -1793,7 +1793,7 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) return true; } - + if (rProperty.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("MouseVisible") )) { @@ -1804,28 +1804,28 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) return true; } - + if (rProperty.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM("ForceManualAdvance") )) + RTL_CONSTASCII_STRINGPARAM("ForceManualAdvance") )) { return (rProperty.Value >>= mbForceManualAdvance); } - + if (rProperty.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("RehearseTimings") )) { bool bRehearseTimings = false; if (! (rProperty.Value >>= bRehearseTimings)) return false; - - if (bRehearseTimings) + + if (bRehearseTimings) { // TODO(Q3): Move to slide mpRehearseTimingsActivity = RehearseTimingsActivity::create( SlideShowContext( mpDummyPtr, - maEventQueue, - maEventMultiplexer, + maEventQueue, + maEventMultiplexer, maScreenUpdater, maActivitiesQueue, maUserEventQueue, @@ -1833,7 +1833,7 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) maViewContainer, mxComponentContext) ); } - else if (mpRehearseTimingsActivity) + else if (mpRehearseTimingsActivity) { // removes timer from all views: mpRehearseTimingsActivity->dispose(); @@ -1841,28 +1841,28 @@ sal_Bool SlideShowImpl::setProperty( beans::PropertyValue const& rProperty ) } return true; } - + if (rProperty.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("WaitSymbolBitmap") )) { uno::Reference<rendering::XBitmap> xBitmap; if (! (rProperty.Value >>= xBitmap)) return false; - - mpWaitSymbol = WaitSymbol::create( xBitmap, + + mpWaitSymbol = WaitSymbol::create( xBitmap, maScreenUpdater, maEventMultiplexer, maViewContainer ); return true; } - + if (rProperty.Name.equalsAsciiL( - RTL_CONSTASCII_STRINGPARAM("NoSlideTransitions") )) + RTL_CONSTASCII_STRINGPARAM("NoSlideTransitions") )) { return (rProperty.Value >>= mbNoSlideTransitions); } - + if (rProperty.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("IsSoundEnabled"))) { uno::Sequence<uno::Any> aValues; @@ -1926,7 +1926,7 @@ void SlideShowImpl::addShapeEventListener( if (isDisposed()) return; - + // precondition: must only be called from the main thread! DBG_TESTSOLARMUTEX(); @@ -1935,11 +1935,11 @@ void SlideShowImpl::addShapeEventListener( maShapeEventListeners.end() ) { // no entry for this shape -> create one - aIter = maShapeEventListeners.insert( + aIter = maShapeEventListeners.insert( ShapeEventListenerMap::value_type( xShape, - boost::shared_ptr<cppu::OInterfaceContainerHelper>( - new cppu::OInterfaceContainerHelper(m_aMutex)))).first; + boost::shared_ptr<cppu::OInterfaceContainerHelper>( + new cppu::OInterfaceContainerHelper(m_aMutex)))).first; } // add new listener to broadcaster @@ -1956,7 +1956,7 @@ void SlideShowImpl::removeShapeEventListener( throw (uno::RuntimeException) { osl::MutexGuard const guard( m_aMutex ); - + // precondition: must only be called from the main thread! DBG_TESTSOLARMUTEX(); @@ -1970,7 +1970,7 @@ void SlideShowImpl::removeShapeEventListener( aIter->second.get(), "SlideShowImpl::removeShapeEventListener(): " "listener map contains NULL broadcast helper" ); - + aIter->second->removeInterface( xListener ); } @@ -1986,37 +1986,37 @@ void SlideShowImpl::setShapeCursor( if (isDisposed()) return; - + // precondition: must only be called from the main thread! DBG_TESTSOLARMUTEX(); ShapeCursorMap::iterator aIter; - if( (aIter=maShapeCursors.find( xShape )) == maShapeCursors.end() ) + if( (aIter=maShapeCursors.find( xShape )) == maShapeCursors.end() ) { // no entry for this shape -> create one - if( nPointerShape != awt::SystemPointer::ARROW ) + if( nPointerShape != awt::SystemPointer::ARROW ) { // add new entry, unless shape shall display // normal pointer arrow -> no need to handle that // case maShapeCursors.insert( - ShapeCursorMap::value_type(xShape, + ShapeCursorMap::value_type(xShape, nPointerShape) ); } } - else if( nPointerShape == awt::SystemPointer::ARROW ) + else if( nPointerShape == awt::SystemPointer::ARROW ) { // shape shall display normal cursor -> can disable // the cursor and clear the entry maShapeCursors.erase( xShape ); } - else + else { // existing entry found, update with new cursor ID aIter->second = nPointerShape; } - maEventMultiplexer.notifyShapeCursorChange(xShape, + maEventMultiplexer.notifyShapeCursorChange(xShape, nPointerShape); } @@ -2027,10 +2027,10 @@ bool SlideShowImpl::requestCursor( sal_Int16 nCursorShape ) const sal_Int16 nActualCursor = calcActiveCursor(mnCurrentCursor); // change all views to the requested cursor ID - std::for_each( maViewContainer.begin(), + std::for_each( maViewContainer.begin(), maViewContainer.end(), - boost::bind( &View::setCursorShape, - _1, + boost::bind( &View::setCursorShape, + _1, nActualCursor )); return nActualCursor==nCursorShape; @@ -2041,10 +2041,10 @@ void SlideShowImpl::resetCursor() mnCurrentCursor = awt::SystemPointer::ARROW; // change all views to the default cursor ID - std::for_each( maViewContainer.begin(), + std::for_each( maViewContainer.begin(), maViewContainer.end(), - boost::bind( &View::setCursorShape, - _1, + boost::bind( &View::setCursorShape, + _1, calcActiveCursor(mnCurrentCursor) )); } @@ -2055,23 +2055,23 @@ sal_Bool SlideShowImpl::update( double & nNextTimeout ) if (isDisposed()) return false; - + // precondition: update() must only be called from the // main thread! DBG_TESTSOLARMUTEX(); - if( mbShowPaused ) + if( mbShowPaused ) { // commit frame (might be repaints pending) maScreenUpdater.commitUpdates(); return false; } - else + else { // TODO(F2): re-evaluate whether that timer lagging makes // sense. - + // hold timer, while processing the queues: // 1. when there is more than one active activity this ensures the // same time for all activities and events @@ -2113,7 +2113,7 @@ sal_Bool SlideShowImpl::update( double & nNextTimeout ) // that to the next round, no updated static slide // content. In short, the last shape animation of a slide // tends to blink at its end. - + // process dequeued activities _after_ commit to screen maActivitiesQueue.processDequeued(); @@ -2121,15 +2121,15 @@ sal_Bool SlideShowImpl::update( double & nNextTimeout ) maScreenUpdater.commitUpdates(); } // Time held until here - + const bool bActivitiesLeft = (! maActivitiesQueue.isEmpty()); const bool bTimerEventsLeft = (! maEventQueue.isEmpty()); const bool bRet = (bActivitiesLeft || bTimerEventsLeft); - - if (bRet) + + if (bRet) { // calc nNextTimeout value: - if (bActivitiesLeft) + if (bActivitiesLeft) { // Activity queue is not empty. Tell caller that we would // like to render another frame. @@ -2141,7 +2141,7 @@ sal_Bool SlideShowImpl::update( double & nNextTimeout ) nNextTimeout = 0; maFrameSynchronization.Activate(); } - else + else { // timer events left: // difference from current time (nota bene: @@ -2182,7 +2182,7 @@ sal_Bool SlideShowImpl::update( double & nNextTimeout ) uno::Reference< util::XUpdatable > xUpdatable( xView->getCanvas(), uno::UNO_QUERY_THROW ); xUpdatable->update(); - } + } catch( uno::RuntimeException& ) { throw; @@ -2201,7 +2201,7 @@ sal_Bool SlideShowImpl::update( double & nNextTimeout ) mbSlideShowIdle = true; } #endif - + return bRet; } } @@ -2213,7 +2213,7 @@ void SlideShowImpl::notifySlideTransitionEnded( bool bPaintSlide ) OSL_ENSURE( !isDisposed(), "### already disposed!" ); OSL_ENSURE( mpCurrentSlide, "notifySlideTransitionEnded(): Invalid current slide" ); - if (mpCurrentSlide) + if (mpCurrentSlide) { // first init show, to give the animations // the chance to register SlideStartEvents @@ -2232,25 +2232,25 @@ void queryAutomaticSlideTransition( uno::Reference<drawing::XDrawPage> const& xD uno::Reference< beans::XPropertySet > xPropSet( xDrawPage, uno::UNO_QUERY ); - + sal_Int32 nChange(0); if( !xPropSet.is() || !getPropertyValue( nChange, xPropSet, - ::rtl::OUString( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Change"))) ) { OSL_TRACE( "queryAutomaticSlideTransition(): " "Could not extract slide change mode from XDrawPage - assuming <none>\n" ); } - + bHasAutomaticNextSlide = nChange == 1; if( !xPropSet.is() || !getPropertyValue( nAutomaticNextSlideTimeout, xPropSet, - ::rtl::OUString( + ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Duration"))) ) { OSL_TRACE( @@ -2266,29 +2266,29 @@ void SlideShowImpl::notifySlideAnimationsEnded() //Draw polygons above animations mpCurrentSlide->drawPolygons(); - + OSL_ENSURE( !isDisposed(), "### already disposed!" ); - + // This struct will receive the (interruptable) event, // that triggers the notifySlideEnded() method. InterruptableEventPair aNotificationEvents; - if( maEventMultiplexer.getAutomaticMode() ) + if( maEventMultiplexer.getAutomaticMode() ) { OSL_ENSURE( ! mpRehearseTimingsActivity, "unexpected: RehearseTimings mode!" ); - + // schedule a slide end event, with automatic mode's // delay aNotificationEvents = makeInterruptableDelay( boost::bind<void>( boost::mem_fn(&SlideShowImpl::notifySlideEnded), this, false ), maEventMultiplexer.getAutomaticTimeout() ); } - else + else { OSL_ENSURE( mpCurrentSlide, "notifySlideAnimationsEnded(): Invalid current slide!" ); - + bool bHasAutomaticNextSlide=false; double nAutomaticNextSlideTimeout=0.0; queryAutomaticSlideTransition(mpCurrentSlide->getXDrawPage(), @@ -2308,37 +2308,37 @@ void SlideShowImpl::notifySlideAnimationsEnded() aNotificationEvents = makeInterruptableDelay( boost::bind<void>( boost::mem_fn(&SlideShowImpl::notifySlideEnded), this, false ), nAutomaticNextSlideTimeout); - - // TODO(F2): Provide a mechanism to let the user override + + // TODO(F2): Provide a mechanism to let the user override // this automatic timeout via next() } - else + else { if (mpRehearseTimingsActivity) mpRehearseTimingsActivity->start(); - + // generate click event. Thus, the user must // trigger the actual end of a slide. No need to // generate interruptable event here, there's no // timeout involved. - aNotificationEvents.mpImmediateEvent = + aNotificationEvents.mpImmediateEvent = makeEvent( boost::bind<void>( boost::mem_fn(&SlideShowImpl::notifySlideEnded), this, false ), "SlideShowImpl::notifySlideEnded"); } } - + // register events on the queues. To make automatic slide // changes interruptable, register the interruption event // as a nextEffectEvent target. Note that the timeout // event is optional (e.g. manual slide changes don't - // generate a timeout) + // generate a timeout) maUserEventQueue.registerNextEffectEvent( aNotificationEvents.mpImmediateEvent ); - + if( aNotificationEvents.mpTimeoutEvent ) maEventQueue.addEvent( aNotificationEvents.mpTimeoutEvent ); - + // current slide's main sequence is over. Now should be // the time to prefetch the next slide (if any), and // prepare the initial slide bitmap (speeds up slide @@ -2346,14 +2346,14 @@ void SlideShowImpl::notifySlideAnimationsEnded() // indeed might take some seconds. { WaitSymbolLock aLock (*this); - + if (! matches( mpPrefetchSlide, - mxPrefetchSlide, mxPrefetchAnimationNode )) + mxPrefetchSlide, mxPrefetchAnimationNode )) { mpPrefetchSlide = makeSlide( mxPrefetchSlide, mxDrawPagesSupplier, mxPrefetchAnimationNode ); } - if (mpPrefetchSlide) + if (mpPrefetchSlide) { // ignore return value, this is just to populate // Slide's internal bitmap buffer, such that the time @@ -2372,17 +2372,17 @@ void SlideShowImpl::notifySlideEnded (const bool bReverse) osl::MutexGuard const guard( m_aMutex ); OSL_ENSURE( !isDisposed(), "### already disposed!" ); - - if (mpRehearseTimingsActivity && !bReverse) + + if (mpRehearseTimingsActivity && !bReverse) { const double time = mpRehearseTimingsActivity->stop(); - if (mpRehearseTimingsActivity->hasBeenClicked()) + if (mpRehearseTimingsActivity->hasBeenClicked()) { // save time at current drawpage: uno::Reference<beans::XPropertySet> xPropSet( mpCurrentSlide->getXDrawPage(), uno::UNO_QUERY ); OSL_ASSERT( xPropSet.is() ); - if (xPropSet.is()) + if (xPropSet.is()) { xPropSet->setPropertyValue( OUSTR("Change"), @@ -2396,7 +2396,7 @@ void SlideShowImpl::notifySlideEnded (const bool bReverse) if (bReverse) maEventMultiplexer.notifySlideEndEvent(); - + stopShow(); // MUST call that: results in // maUserEventQueue.clear(). What's more, // stopShow()'s currSlide->hide() call is @@ -2419,7 +2419,7 @@ bool SlideShowImpl::notifyHyperLinkClicked( rtl::OUString const& hyperLink ) maListenerContainer.forEach<presentation::XSlideShowListener>( boost::bind( &presentation::XSlideShowListener::hyperLinkClicked, - _1, + _1, boost::cref(hyperLink) )); return true; } @@ -2438,15 +2438,15 @@ bool SlideShowImpl::handleAnimationEvent( const AnimationNodeSharedPtr& rNode ) case AnimationNode::ACTIVE: maListenerContainer.forEach<presentation::XSlideShowListener>( boost::bind( &animations::XAnimationListener::beginEvent, - _1, + _1, boost::cref(xNode) )); break; - + case AnimationNode::FROZEN: case AnimationNode::ENDED: maListenerContainer.forEach<presentation::XSlideShowListener>( boost::bind( &animations::XAnimationListener::endEvent, - _1, + _1, boost::cref(xNode) )); if(mpCurrentSlide->isPaintOverlayActive()) mpCurrentSlide->drawPolygons(); |