diff options
Diffstat (limited to 'sdext')
-rw-r--r-- | sdext/source/presenter/PresenterController.cxx | 14 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterController.hxx | 1 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterProtocolHandler.cxx | 26 |
3 files changed, 41 insertions, 0 deletions
diff --git a/sdext/source/presenter/PresenterController.cxx b/sdext/source/presenter/PresenterController.cxx index c37ee6f8b097..281f77e59d5e 100644 --- a/sdext/source/presenter/PresenterController.cxx +++ b/sdext/source/presenter/PresenterController.cxx @@ -1157,6 +1157,20 @@ void PresenterController::SwitchMonitors() pScreen->SwitchMonitors(); } +void PresenterController::ExitPresenter() +{ + if( mxController.is() ) + { + Reference< XPresentationSupplier > xPS( mxController->getModel(), UNO_QUERY ); + if( xPS.is() ) + { + Reference< XPresentation > xP( xPS->getPresentation() ); + if( xP.is() ) + xP->end(); + } + } +} + } // end of namespace ::sdext::presenter /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sdext/source/presenter/PresenterController.hxx b/sdext/source/presenter/PresenterController.hxx index 400fb9174f11..1a9d8a1aaa04 100644 --- a/sdext/source/presenter/PresenterController.hxx +++ b/sdext/source/presenter/PresenterController.hxx @@ -110,6 +110,7 @@ public: void ShowView (const OUString& rsViewURL); void HideView (const OUString& rsViewURL); void SwitchMonitors(); + void ExitPresenter(); void DispatchUnoCommand (const OUString& rsCommand) const; css::uno::Reference<css::frame::XDispatch> GetDispatch ( const css::util::URL& rURL) const; diff --git a/sdext/source/presenter/PresenterProtocolHandler.cxx b/sdext/source/presenter/PresenterProtocolHandler.cxx index 029365e3b21d..64b00fd36f67 100644 --- a/sdext/source/presenter/PresenterProtocolHandler.cxx +++ b/sdext/source/presenter/PresenterProtocolHandler.cxx @@ -164,6 +164,15 @@ namespace { const sal_Int32 mnSizeChange; }; + class ExitPresenterCommand : public Command + { + public: + explicit ExitPresenterCommand(const rtl::Reference<PresenterController>& rpPresenterController); + virtual void Execute() override; + private: + rtl::Reference<PresenterController> mpPresenterController; + }; + } // end of anonymous namespace namespace { @@ -398,6 +407,8 @@ Command* PresenterProtocolHandler::Dispatch::CreateCommand ( return new SetHelpViewCommand(true, rpPresenterController); if (rsURLPath == "ShrinkNotesFont") return new NotesFontSizeCommand(rpPresenterController, -1); + if (rsURLPath == "ExitPresenter") + return new ExitPresenterCommand(rpPresenterController); return nullptr; } @@ -805,6 +816,21 @@ Any NotesFontSizeCommand::GetState() const return Any(); } +//===== ExitPresenterCommand ================================================== + +ExitPresenterCommand::ExitPresenterCommand (const rtl::Reference<PresenterController>& rpPresenterController) +: mpPresenterController(rpPresenterController) +{ +} + +void ExitPresenterCommand::Execute() +{ + if ( ! mpPresenterController.is()) + return; + + mpPresenterController->ExitPresenter(); +} + } // end of namespace ::sdext::presenter /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |