[Libreoffice-commits] core.git: compilerplugins/clang svx/source

Noel Grandin noel at peralex.com
Mon Jul 4 12:55:46 UTC 2016


 compilerplugins/clang/mergeclasses.results            |    1 
 svx/source/inc/eventhandler.hxx                       |   31 +++-----------
 svx/source/sdr/contact/viewobjectcontactofgraphic.cxx |    4 -
 svx/source/sdr/event/eventhandler.cxx                 |   39 +++++-------------
 4 files changed, 21 insertions(+), 54 deletions(-)

New commits:
commit f81316af4f3c69d1f405040f4eddc523ce792add
Author: Noel Grandin <noel at peralex.com>
Date:   Mon Jul 4 13:35:04 2016 +0200

    merge sdr::event::EventHandler with sdr::event::TimerEventHandler
    
    Change-Id: Id81c6b67d95d976dae417cf225bd43347c716d06
    Reviewed-on: https://gerrit.libreoffice.org/26905
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/compilerplugins/clang/mergeclasses.results b/compilerplugins/clang/mergeclasses.results
index 5b4c8e1..a033c15 100644
--- a/compilerplugins/clang/mergeclasses.results
+++ b/compilerplugins/clang/mergeclasses.results
@@ -323,7 +323,6 @@ merge sdext::presenter::PresenterScrollBar with sdext::presenter::PresenterVerti
 merge sdext::presenter::PresenterSlidePreview with sdext::presenter::(anonymous namespace)::NextSlidePreview
 merge sdr::SelectionController with sdr::table::SvxTableController
 merge sdr::contact::ObjectContactOfPagePainter with sdr::contact::PagePrimitiveExtractor
-merge sdr::event::EventHandler with sdr::event::TimerEventHandler
 merge sdr::table::TableDesignUser with sdr::table::SdrTableObjImpl
 merge sfx2::IXmlIdRegistry with sfx2::XmlIdRegistry
 merge sfx::DummyWindowWrapper with sfx::DummyItemConnection
diff --git a/svx/source/inc/eventhandler.hxx b/svx/source/inc/eventhandler.hxx
index a0ca821..3e79e7f 100644
--- a/svx/source/inc/eventhandler.hxx
+++ b/svx/source/inc/eventhandler.hxx
@@ -31,9 +31,7 @@ namespace sdr
     namespace event
     {
         class BaseEvent;
-        class EventHandler;
-
-        typedef ::std::vector< BaseEvent* > BaseEventVector;
+        class TimerEventHandler;
     } // end of namespace event
 } // end of namespace sdr
 
@@ -44,10 +42,10 @@ namespace sdr
         class BaseEvent
         {
             // the EventHandler this event is registered at
-            EventHandler& mrEventHandler;
+            TimerEventHandler& mrEventHandler;
 
         public:
-            BaseEvent(EventHandler& rEventHandler);
+            BaseEvent(TimerEventHandler& rEventHandler);
 
             virtual ~BaseEvent();
 
@@ -61,9 +59,9 @@ namespace sdr
 {
     namespace event
     {
-        class EventHandler
+        class TimerEventHandler : public Idle
         {
-            BaseEventVector maVector;
+            ::std::vector< BaseEvent* >  maVector;
 
             // to allow BaseEvents to use the add/remove functionality
             friend class BaseEvent;
@@ -77,28 +75,13 @@ namespace sdr
             BaseEvent* GetEvent();
 
         public:
-            EventHandler();
-
-            virtual ~EventHandler();
+            TimerEventHandler();
+            ~TimerEventHandler() override;
 
             // Trigger and consume the events
             void ExecuteEvents();
 
             bool IsEmpty() const;
-        };
-    } // end of namespace event
-} // end of namespace sdr
-
-namespace sdr
-{
-    namespace event
-    {
-        class TimerEventHandler : public EventHandler, public Idle
-        {
-        public:
-            TimerEventHandler();
-
-            virtual ~TimerEventHandler();
 
             // The timer when it is triggered; from class Timer
             virtual void Invoke() override;
diff --git a/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx b/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx
index 7b04b17..fa5028a 100644
--- a/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofgraphic.cxx
@@ -37,7 +37,7 @@ namespace sdr
 
         public:
             // basic constructor.
-            AsynchGraphicLoadingEvent(EventHandler& rEventHandler, sdr::contact::ViewObjectContactOfGraphic& rVOCOfGraphic);
+            AsynchGraphicLoadingEvent(TimerEventHandler& rEventHandler, sdr::contact::ViewObjectContactOfGraphic& rVOCOfGraphic);
 
             // destructor
             virtual ~AsynchGraphicLoadingEvent();
@@ -47,7 +47,7 @@ namespace sdr
         };
 
         AsynchGraphicLoadingEvent::AsynchGraphicLoadingEvent(
-            EventHandler& rEventHandler, sdr::contact::ViewObjectContactOfGraphic& rVOCOfGraphic)
+            TimerEventHandler& rEventHandler, sdr::contact::ViewObjectContactOfGraphic& rVOCOfGraphic)
         :   BaseEvent(rEventHandler),
             mrVOCOfGraphic(rVOCOfGraphic)
         {
diff --git a/svx/source/sdr/event/eventhandler.cxx b/svx/source/sdr/event/eventhandler.cxx
index 908a7b4..681d9cf 100644
--- a/svx/source/sdr/event/eventhandler.cxx
+++ b/svx/source/sdr/event/eventhandler.cxx
@@ -28,7 +28,7 @@ namespace sdr
 {
     namespace event
     {
-        BaseEvent::BaseEvent(EventHandler& rEventHandler)
+        BaseEvent::BaseEvent(TimerEventHandler& rEventHandler)
         :   mrEventHandler(rEventHandler)
         {
             mrEventHandler.AddEvent(*this);
@@ -46,12 +46,12 @@ namespace sdr
 {
     namespace event
     {
-        void EventHandler::AddEvent(BaseEvent& rBaseEvent)
+        void TimerEventHandler::AddEvent(BaseEvent& rBaseEvent)
         {
             maVector.push_back(&rBaseEvent);
         }
 
-        void EventHandler::RemoveEvent(BaseEvent& rBaseEvent)
+        void TimerEventHandler::RemoveEvent(BaseEvent& rBaseEvent)
         {
             if(maVector.back() == &rBaseEvent)
             {
@@ -60,7 +60,7 @@ namespace sdr
             }
             else
             {
-                const BaseEventVector::iterator aFindResult = ::std::find(
+                const auto aFindResult = ::std::find(
                     maVector.begin(), maVector.end(), &rBaseEvent);
                 DBG_ASSERT(aFindResult != maVector.end(),
                     "EventHandler::RemoveEvent: Event to be removed not found (!)");
@@ -68,7 +68,7 @@ namespace sdr
             }
         }
 
-        BaseEvent* EventHandler::GetEvent()
+        BaseEvent* TimerEventHandler::GetEvent()
         {
             if(!maVector.empty())
             {
@@ -81,12 +81,15 @@ namespace sdr
             }
         }
 
-        EventHandler::EventHandler()
+        TimerEventHandler::TimerEventHandler()
         {
+            SetPriority(SchedulerPriority::HIGH);
+            Stop();
         }
 
-        EventHandler::~EventHandler()
+        TimerEventHandler::~TimerEventHandler()
         {
+            Stop();
             while(!maVector.empty())
             {
                 delete GetEvent();
@@ -94,7 +97,7 @@ namespace sdr
         }
 
         // Trigger and consume the events
-        void EventHandler::ExecuteEvents()
+        void TimerEventHandler::ExecuteEvents()
         {
             for(;;)
             {
@@ -107,28 +110,10 @@ namespace sdr
         }
 
         // for control
-        bool EventHandler::IsEmpty() const
+        bool TimerEventHandler::IsEmpty() const
         {
             return (0L == maVector.size());
         }
-    } // end of namespace mixer
-} // end of namespace sdr
-
-
-namespace sdr
-{
-    namespace event
-    {
-        TimerEventHandler::TimerEventHandler()
-        {
-            SetPriority(SchedulerPriority::HIGH);
-            Stop();
-        }
-
-        TimerEventHandler::~TimerEventHandler()
-        {
-            Stop();
-        }
 
         // The timer when it is triggered; from class Timer
         void TimerEventHandler::Invoke()


More information about the Libreoffice-commits mailing list