summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorheiko tietze <tietze.heiko@gmail.com>2018-08-27 11:33:35 +0200
committerHeiko Tietze <tietze.heiko@gmail.com>2018-08-27 19:53:28 +0200
commit8e79ca904622a90b72e198f97441452d1bfffdc0 (patch)
treeaccebc3072bcf582297b72f020fd1b1d7d2e3cd6
parentc3c4847d359ad74f0ba45a36c28ecb75f4694ca1 (diff)
tdf#118443 - Presenter Console
"Next" button disabled with the last slide Change-Id: Iebb7c46b9838f5372cb68c51daa41d114309d613 Reviewed-on: https://gerrit.libreoffice.org/59642 Tested-by: Jenkins Reviewed-by: Heiko Tietze <tietze.heiko@gmail.com>
-rw-r--r--sdext/source/presenter/PresenterProtocolHandler.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/sdext/source/presenter/PresenterProtocolHandler.cxx b/sdext/source/presenter/PresenterProtocolHandler.cxx
index b7ca0c08a4b2..b0c0f640870d 100644
--- a/sdext/source/presenter/PresenterProtocolHandler.cxx
+++ b/sdext/source/presenter/PresenterProtocolHandler.cxx
@@ -83,6 +83,7 @@ namespace {
explicit GotoNextEffectCommand (
const rtl::Reference<PresenterController>& rpPresenterController);
virtual void Execute() override;
+ virtual bool IsEnabled() const override;
private:
rtl::Reference<PresenterController> mpPresenterController;
};
@@ -538,6 +539,18 @@ void GotoNextEffectCommand::Execute()
mpPresenterController->GetSlideShowController()->gotoNextEffect();
}
+bool GotoNextEffectCommand::IsEnabled() const
+{
+ if ( ! mpPresenterController.is())
+ return false;
+
+ if ( ! mpPresenterController->GetSlideShowController().is())
+ return false;
+
+ return ( mpPresenterController->GetSlideShowController()->getNextSlideIndex() < mpPresenterController->GetSlideShowController()->getSlideCount() );
+
+}
+
//===== GotoNextSlide =========================================================
GotoNextSlideCommand::GotoNextSlideCommand (