diff options
-rw-r--r-- | sd/source/console/PresenterScreen.cxx | 28 | ||||
-rw-r--r-- | sd/source/console/PresenterScreen.hxx | 3 | ||||
-rw-r--r-- | sd/source/ui/slideshow/slideshowimpl.cxx | 17 |
3 files changed, 42 insertions, 6 deletions
diff --git a/sd/source/console/PresenterScreen.cxx b/sd/source/console/PresenterScreen.cxx index cd6c20d38cc5..64e8c8e11e5f 100644 --- a/sd/source/console/PresenterScreen.cxx +++ b/sd/source/console/PresenterScreen.cxx @@ -240,9 +240,17 @@ void SAL_CALL PresenterScreenListener::disposing (const css::lang::EventObject&) PresenterScreen::PresenterScreen ( const Reference<XComponentContext>& rxContext, css::uno::Reference<css::frame::XModel2> xModel) - : PresenterScreenInterfaceBase(m_aMutex), - mxModel(std::move(xModel)), - mxContextWeak(rxContext) +: PresenterScreenInterfaceBase(m_aMutex) +, mxModel(std::move(xModel)) +, mxController() +, mxConfigurationControllerWeak() +, mxContextWeak(rxContext) +, mpPresenterController() +, mxSavedConfiguration() +, mpPaneContainer() +, mxPaneFactory() +, mxViewFactory() +, mbIsInitialized(false) { } @@ -303,6 +311,10 @@ void SAL_CALL PresenterScreen::disposing (const lang::EventObject& /*rEvent*/) void PresenterScreen::InitializePresenterScreen() { + // IASS: already initialized (may even assert here?) + if (mbIsInitialized) + return; + try { Reference<XComponentContext> xContext (mxContextWeak); @@ -388,6 +400,9 @@ void PresenterScreen::InitializePresenterScreen() catch (const Exception&) { } + + // IASS: Remember we are initialized + mbIsInitialized = true; } void PresenterScreen::SwitchMonitors() @@ -545,6 +560,10 @@ Reference<drawing::framework::XResourceId> PresenterScreen::GetMainPaneId ( void PresenterScreen::RequestShutdownPresenterScreen() { + // IASS: only cleanup when we are initialized + if (!mbIsInitialized) + return; + // Restore the configuration that was active before the presenter screen // has been activated. Now, that the presenter screen is displayed in // its own top level window this probably not necessary, but one never knows. @@ -567,6 +586,9 @@ void PresenterScreen::RequestShutdownPresenterScreen() [pSelf](bool){ return pSelf->ShutdownPresenterScreen(); }); xCC->update(); } + + // IASS: reset to non-initialized + mbIsInitialized = false; } void PresenterScreen::ShutdownPresenterScreen() diff --git a/sd/source/console/PresenterScreen.hxx b/sd/source/console/PresenterScreen.hxx index 0445311b9603..430384a45c6d 100644 --- a/sd/source/console/PresenterScreen.hxx +++ b/sd/source/console/PresenterScreen.hxx @@ -139,6 +139,9 @@ private: css::uno::Reference<css::drawing::framework::XResourceFactory> mxPaneFactory; css::uno::Reference<css::drawing::framework::XResourceFactory> mxViewFactory; + // IASS: Flag to note if InitializePresenterScreen() was executed + bool mbIsInitialized; + class ViewDescriptor { public: diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index 4987a598ae1a..8b5a5977c8cb 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -644,6 +644,8 @@ void SlideshowImpl::disposing(std::unique_lock<std::mutex>&) #ifdef ENABLE_SDREMOTE RemoteServer::presentationStopped(); #endif + // IASS: This is the central methodology to 'steer' the + // PresenterConsole - in this case, to shut it down if( mxShow.is() && mpDoc ) NotifyDocumentEvent( *mpDoc, @@ -1314,9 +1316,18 @@ bool SlideshowImpl::startShowImpl( const Sequence< beans::PropertyValue >& aProp mxListenerProxy.set( new SlideShowListenerProxy( this, mxShow ) ); mxListenerProxy->addAsSlideShowListener(); - NotifyDocumentEvent( - *mpDoc, - "OnStartPresentation"); + // IASS: Do only startup the PresenterConsole if this is not + // the SlideShow Preview mode (else would be double) + if (!mbInterActiveSetup) + { + // IASS: This is the central methodology to 'steer' the + // PresenterConsole - in this case, to start it up and make + // it visible (if activated) + NotifyDocumentEvent( + *mpDoc, + "OnStartPresentation"); + } + displaySlideIndex( mpSlideController->getStartSlideIndex() ); return true; |