[Libreoffice-commits] core.git: sdext/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Aug 16 06:55:39 UTC 2018


 sdext/source/presenter/PresenterFrameworkObserver.cxx |   17 +++--------------
 sdext/source/presenter/PresenterFrameworkObserver.hxx |    7 -------
 2 files changed, 3 insertions(+), 21 deletions(-)

New commits:
commit ef62f7bdfc5ff6e1a2c23f67a3339fd24608f4f5
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Aug 15 11:05:29 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Aug 16 08:55:08 2018 +0200

    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 at collabora.co.uk>

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


More information about the Libreoffice-commits mailing list