diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-15 11:05:29 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-16 08:55:08 +0200 |
commit | ef62f7bdfc5ff6e1a2c23f67a3339fd24608f4f5 (patch) | |
tree | 200107875e344e46e34e3743a8cd9408560c0972 | |
parent | 0025cb72f2b6b19d63fb1393df910845f255a6d0 (diff) |
loplugin:returnconstant in PresenterFrameworkObserver
the Predicate stuff is effectively unused
Change-Id: Icdba9872f9915f1c7bae89548343580e97ff5de2
Reviewed-on: https://gerrit.libreoffice.org/59129
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | sdext/source/presenter/PresenterFrameworkObserver.cxx | 17 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterFrameworkObserver.hxx | 7 |
2 files changed, 3 insertions, 21 deletions
diff --git a/sdext/source/presenter/PresenterFrameworkObserver.cxx b/sdext/source/presenter/PresenterFrameworkObserver.cxx index b153f385acf8..55e0bf891da9 100644 --- a/sdext/source/presenter/PresenterFrameworkObserver.cxx +++ b/sdext/source/presenter/PresenterFrameworkObserver.cxx @@ -29,11 +29,9 @@ namespace sdext { namespace presenter { PresenterFrameworkObserver::PresenterFrameworkObserver ( const css::uno::Reference<css::drawing::framework::XConfigurationController>&rxController, - const Predicate& rPredicate, const Action& rAction) : PresenterFrameworkObserverInterfaceBase(m_aMutex), mxConfigurationController(rxController), - maPredicate(rPredicate), maAction(rAction) { if ( ! mxConfigurationController.is()) @@ -48,7 +46,7 @@ PresenterFrameworkObserver::PresenterFrameworkObserver ( } else { - rAction(maPredicate()); + rAction(true); } } @@ -62,15 +60,9 @@ void PresenterFrameworkObserver::RunOnUpdateEnd ( { new PresenterFrameworkObserver( rxController, - &PresenterFrameworkObserver::True, rAction); } -bool PresenterFrameworkObserver::True() -{ - return true; -} - void SAL_CALL PresenterFrameworkObserver::disposing() { if (maAction) @@ -81,8 +73,6 @@ void SAL_CALL PresenterFrameworkObserver::disposing() void PresenterFrameworkObserver::Shutdown() { maAction = Action(); - maPredicate = Predicate(); - if (mxConfigurationController != nullptr) { mxConfigurationController->removeConfigurationChangeListener(this); @@ -109,14 +99,13 @@ void SAL_CALL PresenterFrameworkObserver::notifyConfigurationChange ( bool bDispose(false); Action aAction (maAction); - Predicate aPredicate (maPredicate); if (rEvent.Type == "ConfigurationUpdateEnd") { Shutdown(); - aAction(aPredicate()); + aAction(true); bDispose = true; } - else if (aPredicate()) + else { Shutdown(); aAction(true); diff --git a/sdext/source/presenter/PresenterFrameworkObserver.hxx b/sdext/source/presenter/PresenterFrameworkObserver.hxx index 33e8e4fff31d..c5614229adf3 100644 --- a/sdext/source/presenter/PresenterFrameworkObserver.hxx +++ b/sdext/source/presenter/PresenterFrameworkObserver.hxx @@ -41,7 +41,6 @@ class PresenterFrameworkObserver public PresenterFrameworkObserverInterfaceBase { public: - typedef ::std::function<bool ()> Predicate; typedef ::std::function<void (bool)> Action; PresenterFrameworkObserver(const PresenterFrameworkObserver&) = delete; @@ -58,7 +57,6 @@ public: private: css::uno::Reference<css::drawing::framework::XConfigurationController> mxConfigurationController; - Predicate maPredicate; Action maAction; /** Create a new PresenterFrameworkObserver object. @@ -70,15 +68,10 @@ private: */ PresenterFrameworkObserver ( const css::uno::Reference<css::drawing::framework::XConfigurationController>&rxController, - const Predicate& rPredicate, const Action& rAction); virtual ~PresenterFrameworkObserver() override; void Shutdown(); - - /** Predicate that always returns true. - */ - static bool True(); }; } } // end of namespace ::sdext::presenter |