[Libreoffice-commits] core.git: Branch 'feature/fixes19' - include/sfx2 include/vcl sfx2/source vcl/source

László Németh laszlo.nemeth at collabora.com
Tue Apr 5 22:21:14 UTC 2016


 include/sfx2/bindings.hxx        |    6 ++---
 include/vcl/idle.hxx             |   13 -----------
 sfx2/source/control/bindings.cxx |   45 +++++++++++++++------------------------
 vcl/source/app/idle.cxx          |   28 ------------------------
 4 files changed, 21 insertions(+), 71 deletions(-)

New commits:
commit 13e2133199a0fcfca79a21fa8be475d446b685d0
Author: László Németh <laszlo.nemeth at collabora.com>
Date:   Wed Apr 6 00:20:10 2016 +0200

    Revert "process SfxBindings in idle"
    
    This reverts commit fa629000e02448c201f3b7afad0ba29b40b115ec.

diff --git a/include/sfx2/bindings.hxx b/include/sfx2/bindings.hxx
index 4708ca2..bbe5cc4 100644
--- a/include/sfx2/bindings.hxx
+++ b/include/sfx2/bindings.hxx
@@ -44,7 +44,7 @@ class SfxItemSet;
 class SfxDispatcher;
 class SfxBindings;
 class SfxBindings_Impl;
-class Idle;
+class Timer;
 class SfxWorkWindow;
 class SfxUnoControllerItem;
 struct SfxFoundCache_Impl;
@@ -131,8 +131,8 @@ private:
                             const SfxPoolItem *pItem,
                             SfxItemState eItemState );
     SAL_DLLPRIVATE SfxStateCache* GetStateCache( sal_uInt16 nId, sal_uInt16 *pPos);
-    DECL_DLLPRIVATE_LINK_TYPED( NextJob, Idle *, void );
-    SAL_DLLPRIVATE bool NextJob_Impl(Idle * pTimer);
+    DECL_DLLPRIVATE_LINK_TYPED( NextJob, Timer *, void );
+    SAL_DLLPRIVATE bool NextJob_Impl(Timer * pTimer);
 
 public:
                      SfxBindings();
diff --git a/include/vcl/idle.hxx b/include/vcl/idle.hxx
index e3e7a99..5460d33 100644
--- a/include/vcl/idle.hxx
+++ b/include/vcl/idle.hxx
@@ -27,7 +27,6 @@ class VCL_DLLPUBLIC Idle : public Scheduler
 {
 protected:
     Link<Idle *, void> maIdleHdl;          // Callback Link
-    bool mbAuto;
 
 public:
     Idle( const sal_Char *pDebugName = nullptr );
@@ -40,24 +39,12 @@ public:
     void            SetIdleHdl( const Link<Idle *, void>& rLink ) { maIdleHdl = rLink; }
     const Link<Idle *, void>& GetIdleHdl() const { return maIdleHdl; }
     virtual void Invoke() override;
-    virtual void SetDeletionFlags() override;
     virtual bool ReadyForSchedule( bool bTimerOnly, sal_uInt64 nTimeNow ) const override;
     virtual bool IsIdle() const override;
     virtual sal_uInt64 UpdateMinPeriod( sal_uInt64 nMinPeriod, sal_uInt64 nTime ) const override;
     Idle&           operator=( const Idle& rIdle );
 };
 
-/// An auto-timer is a multi-shot timer re-emitting itself at
-/// interval until destroyed.
-class VCL_DLLPUBLIC AutoIdle : public Idle
-{
-public:
-                    AutoIdle();
-                    AutoIdle( const AutoIdle& rIdle );
-
-    AutoIdle&      operator=( const AutoIdle& rIdle );
-};
-
 #endif // INCLUDED_VCL_IDLE_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index 35f9f45..5d13693 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -71,11 +71,11 @@ using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::util;
 
-//static sal_uInt16 nTimeOut = 300;
+static sal_uInt16 nTimeOut = 300;
 
-//#define TIMEOUT_FIRST       nTimeOut
-//#define TIMEOUT_UPDATING     20
-//#define TIMEOUT_IDLE       2500
+#define TIMEOUT_FIRST       nTimeOut
+#define TIMEOUT_UPDATING     20
+#define TIMEOUT_IDLE       2500
 
 typedef std::unordered_map< sal_uInt16, bool > InvalidateSlotMap;
 
@@ -218,7 +218,7 @@ public:
     bool                    bAllMsgDirty;   //  Has a MessageServer been invalidated?
     bool                    bAllDirty;      // After InvalidateAll
     bool                    bCtrlReleased;  // while EnterRegistrations
-    AutoIdle                aTimer;         // for volatile Slots
+    AutoTimer               aTimer;         // for volatile Slots
     bool                    bInUpdate;      // for Assertions
     bool                    bInNextJob;     // for Assertions
     bool                    bFirstRound;    // First round in Update
@@ -253,7 +253,7 @@ SfxBindings::SfxBindings()
     // all caches are valid (no pending invalidate-job)
     // create the list of caches
     pImp->pCaches = new SfxStateCacheArr_Impl;
-    pImp->aTimer.SetIdleHdl( LINK(this, SfxBindings, NextJob) );
+    pImp->aTimer.SetTimeoutHdl( LINK(this, SfxBindings, NextJob) );
 }
 
 
@@ -708,8 +708,7 @@ void SfxBindings::InvalidateAll
     if ( !nRegLevel )
     {
         pImp->aTimer.Stop();
-        //pImp->aTimer.SetTimeout(TIMEOUT_FIRST);
-        pImp->aTimer.SetPriority( SchedulerPriority::LOWER );
+        pImp->aTimer.SetTimeout(TIMEOUT_FIRST);
         pImp->aTimer.Start();
     }
 }
@@ -761,8 +760,7 @@ void SfxBindings::Invalidate
     if ( !nRegLevel )
     {
         pImp->aTimer.Stop();
-        //pImp->aTimer.SetTimeout(TIMEOUT_FIRST);
-        pImp->aTimer.SetPriority( SchedulerPriority::LOWER );
+        pImp->aTimer.SetTimeout(TIMEOUT_FIRST);
         pImp->aTimer.Start();
     }
 }
@@ -816,8 +814,7 @@ void SfxBindings::InvalidateShell
         if ( !nRegLevel )
         {
             pImp->aTimer.Stop();
-            //pImp->aTimer.SetTimeout(TIMEOUT_FIRST);
-            pImp->aTimer.SetPriority( SchedulerPriority::LOWER );
+            pImp->aTimer.SetTimeout(TIMEOUT_FIRST);
             pImp->aTimer.Start();
             pImp->bFirstRound = true;
             pImp->nFirstShell = nLevel;
@@ -854,8 +851,7 @@ void SfxBindings::Invalidate
         if ( !nRegLevel )
         {
             pImp->aTimer.Stop();
-            //pImp->aTimer.SetTimeout(TIMEOUT_FIRST);
-            pImp->aTimer.SetPriority( SchedulerPriority::LOWER );
+            pImp->aTimer.SetTimeout(TIMEOUT_FIRST);
             pImp->aTimer.Start();
         }
     }
@@ -892,8 +888,7 @@ void SfxBindings::Invalidate
         if ( !nRegLevel )
         {
             pImp->aTimer.Stop();
-            //pImp->aTimer.SetTimeout(TIMEOUT_FIRST);
-            pImp->aTimer.SetPriority( SchedulerPriority::LOWER );
+            pImp->aTimer.SetTimeout(TIMEOUT_FIRST);
             pImp->aTimer.Start();
         }
     }
@@ -1552,12 +1547,12 @@ void SfxBindings::UpdateControllers_Impl
     }
 }
 
-IMPL_LINK_TYPED( SfxBindings, NextJob, Idle *, pTimer, void )
+IMPL_LINK_TYPED( SfxBindings, NextJob, Timer *, pTimer, void )
 {
     NextJob_Impl(pTimer);
 }
 
-bool SfxBindings::NextJob_Impl(Idle * pTimer)
+bool SfxBindings::NextJob_Impl(Timer * pTimer)
 {
 #ifdef DBG_UTIL
     // on Windows very often C++ Exceptions (GPF etc.) are caught by MSVCRT
@@ -1571,8 +1566,7 @@ bool SfxBindings::NextJob_Impl(Idle * pTimer)
 
     if ( Application::GetLastInputInterval() < MAX_INPUT_DELAY && pTimer )
     {
-        //pImp->aTimer.SetTimeout(TIMEOUT_UPDATING);
-        pImp->aTimer.SetPriority( SchedulerPriority::LOW );
+        pImp->aTimer.SetTimeout(TIMEOUT_UPDATING);
         return true;
     }
 
@@ -1600,10 +1594,9 @@ bool SfxBindings::NextJob_Impl(Idle * pTimer)
     }
 
     pImp->bAllDirty = false;
-    //pImp->aTimer.SetTimeout(TIMEOUT_UPDATING);
-    pImp->aTimer.SetPriority( SchedulerPriority::LOW );
+    pImp->aTimer.SetTimeout(TIMEOUT_UPDATING);
 
-    // at least .0 loops and further if more jobs are available but no input
+    // at least 10 loops and further if more jobs are available but no input
     bool bPreEmptive = pTimer && !pSfxApp->Get_Impl()->nInReschedule;
     sal_uInt16 nLoops = 10;
     pImp->bInNextJob = true;
@@ -1663,8 +1656,7 @@ bool SfxBindings::NextJob_Impl(Idle * pTimer)
     }
 
     if (bVolatileSlotsPresent)
-        //pImp->aTimer.SetTimeout(TIMEOUT_IDLE);
-        pImp->aTimer.SetPriority( SchedulerPriority::LOWEST );
+        pImp->aTimer.SetTimeout(TIMEOUT_IDLE);
     else
         pImp->aTimer.Stop();
 
@@ -1782,8 +1774,7 @@ void SfxBindings::LeaveRegistrations( sal_uInt16 nLevel, const char *pFile, int
         if ( pImp->pCaches && !pImp->pCaches->empty() )
         {
             pImp->aTimer.Stop();
-            //pImp->aTimer.SetTimeout(TIMEOUT_FIRST);
-            pImp->aTimer.SetPriority( SchedulerPriority::LOWER );
+            pImp->aTimer.SetTimeout(TIMEOUT_FIRST);
             pImp->aTimer.Start();
         }
     }
diff --git a/vcl/source/app/idle.cxx b/vcl/source/app/idle.cxx
index 870406f..123f37a 100644
--- a/vcl/source/app/idle.cxx
+++ b/vcl/source/app/idle.cxx
@@ -20,16 +20,6 @@
 #include <vcl/idle.hxx>
 #include "saltimer.hxx"
 
-void Idle::SetDeletionFlags()
-{
-    // If no AutoIdle, then stop.
-    if ( !mbAuto )
-    {
-        mpSchedulerData->mbDelete = true;
-        mbActive = false;
-    }
-}
-
 void Idle::Invoke()
 {
     maIdleHdl.Call( this );
@@ -44,13 +34,11 @@ Idle& Idle::operator=( const Idle& rIdle )
 
 Idle::Idle( const sal_Char *pDebugName ) : Scheduler( pDebugName )
 {
-    mbAuto = false;
 }
 
 Idle::Idle( const Idle& rIdle ) : Scheduler(rIdle)
 {
     maIdleHdl = rIdle.maIdleHdl;
-    mbAuto = rIdle.mbAuto;
 }
 
 void Idle::Start()
@@ -88,20 +76,4 @@ sal_uInt64 Idle::UpdateMinPeriod( sal_uInt64 nMinPeriod, sal_uInt64 /* nTime */
     return nMinPeriod;
 }
 
-AutoIdle::AutoIdle()
-{
-    mbAuto = true;
-}
-
-AutoIdle::AutoIdle( const AutoIdle& rIdle ) : Idle( rIdle )
-{
-    mbAuto = true;
-}
-
-AutoIdle& AutoIdle::operator=( const AutoIdle& rIdle )
-{
-    Idle::operator=( rIdle );
-    return *this;
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list