[Libreoffice-commits] core.git: Branch 'feature/priorities' - basctl/source sc/source svtools/source

Jennifer Liebel jliebel94 at gmail.com
Thu Nov 6 06:47:30 PST 2014


 basctl/source/dlged/dlged.cxx      |   16 ++++++++--------
 basctl/source/inc/dlged.hxx        |    4 ++--
 sc/source/ui/docshell/autostyl.cxx |    6 +++---
 sc/source/ui/inc/autostyl.hxx      |    2 +-
 svtools/source/contnr/svimpbox.cxx |   22 +++++++++++-----------
 svtools/source/inc/svimpbox.hxx    |    9 ++++-----
 6 files changed, 29 insertions(+), 30 deletions(-)

New commits:
commit 60895673b95736b04ae207c48ac746cd8093f9bc
Author: Jennifer Liebel <jliebel94 at gmail.com>
Date:   Thu Nov 6 14:18:54 2014 +0000

    changed timers to idles
    
    Change-Id: Ic045e0c066ff1f607f0582b88e72375efaaa708f

diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx
index ba1a87a..2afb90d 100644
--- a/basctl/source/dlged/dlged.cxx
+++ b/basctl/source/dlged/dlged.cxx
@@ -219,11 +219,11 @@ DlgEditor::DlgEditor (
     m_ClipboardDataFlavorsResource[1].HumanPresentableName = "Dialog 8.0" ;
     m_ClipboardDataFlavorsResource[1].DataType =             ::getCppuType( (const Sequence< sal_Int8 >*) 0 );
 
-    aPaintTimer.SetTimeout( 1 );
-    aPaintTimer.SetTimeoutHdl( LINK( this, DlgEditor, PaintTimeout ) );
+    aPaintIdle.SetPriority( VCL_IDLE_PRIORITY_HIGH );
+    aPaintIdle.SetIdleHdl( LINK( this, DlgEditor, PaintTimeout ) );
 
-    aMarkTimer.SetTimeout( 100 );
-    aMarkTimer.SetTimeoutHdl( LINK( this, DlgEditor, MarkTimeout ) );
+    aMarkIdle.SetPriority(VCL_IDLE_PRIORITY_LOW);
+    aMarkIdle.SetIdleHdl( LINK( this, DlgEditor, MarkTimeout ) );
 
     rWindow.SetMapMode( MapMode( MAP_100TH_MM ) );
     pDlgEdPage->SetSize( rWindow.PixelToLogic( Size(DLGED_PAGE_WIDTH_MIN, DLGED_PAGE_HEIGHT_MIN) ) );
@@ -249,8 +249,8 @@ DlgEditor::DlgEditor (
 
 DlgEditor::~DlgEditor()
 {
-    aPaintTimer.Stop();
-    aMarkTimer.Stop();
+    aPaintIdle.Stop();
+    aMarkIdle.Stop();
 
     ::comphelper::disposeComponent( m_xControlContainer );
 }
@@ -478,7 +478,7 @@ bool DlgEditor::KeyInput( const KeyEvent& rKEvt )
 void DlgEditor::Paint( const Rectangle& rRect )
 {
     aPaintRect = rRect;
-    PaintTimeout( &aPaintTimer );
+    PaintTimeout( &aPaintIdle );
 }
 
 
@@ -1089,7 +1089,7 @@ void DlgEditor::ShowProperties()
 
 void DlgEditor::UpdatePropertyBrowserDelayed()
 {
-    aMarkTimer.Start();
+    aMarkIdle.Start();
 }
 
 
diff --git a/basctl/source/inc/dlged.hxx b/basctl/source/inc/dlged.hxx
index 981bc08..794f3f7 100644
--- a/basctl/source/inc/dlged.hxx
+++ b/basctl/source/inc/dlged.hxx
@@ -128,10 +128,10 @@ private:
     bool                bGridVisible;
     bool                bGridSnap;
     bool                bCreateOK;
-    Timer               aPaintTimer;
+    Idle                aPaintIdle;
     Rectangle           aPaintRect;
     bool                bDialogModelChanged;
-    Timer               aMarkTimer;
+    Idle                aMarkIdle;
     long                mnPaintGuard;
     ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > m_xDocument;
 
diff --git a/sc/source/ui/docshell/autostyl.cxx b/sc/source/ui/docshell/autostyl.cxx
index 7873310..d7b9374 100644
--- a/sc/source/ui/docshell/autostyl.cxx
+++ b/sc/source/ui/docshell/autostyl.cxx
@@ -83,8 +83,8 @@ ScAutoStyleList::ScAutoStyleList(ScDocShell* pShell)
     , nTimerStart(0)
 {
     aTimer.SetTimeoutHdl( LINK( this, ScAutoStyleList, TimerHdl ) );
-    aInitTimer.SetTimeoutHdl( LINK( this, ScAutoStyleList, InitHdl ) );
-    aInitTimer.SetTimeout( 0 );
+    aInitIdle.SetIdleHdl( LINK( this, ScAutoStyleList, InitHdl ) );
+    aInitIdle.SetPriority( VCL_IDLE_PRIORITY_HIGHEST );
 }
 
 ScAutoStyleList::~ScAutoStyleList()
@@ -97,7 +97,7 @@ void ScAutoStyleList::AddInitial( const ScRange& rRange, const OUString& rStyle1
                                     sal_uLong nTimeout, const OUString& rStyle2 )
 {
     aInitials.push_back(new ScAutoStyleInitData( rRange, rStyle1, nTimeout, rStyle2 ));
-    aInitTimer.Start();
+    aInitIdle.Start();
 }
 
 IMPL_LINK_NOARG(ScAutoStyleList, InitHdl)
diff --git a/sc/source/ui/inc/autostyl.hxx b/sc/source/ui/inc/autostyl.hxx
index 746f52e..6ffd437 100644
--- a/sc/source/ui/inc/autostyl.hxx
+++ b/sc/source/ui/inc/autostyl.hxx
@@ -35,7 +35,7 @@ private:
 
     ScDocShell*     pDocSh;
     Timer           aTimer;
-    Timer           aInitTimer;
+    Idle            aInitIdle;
     sal_uLong           nTimerStart;
     boost::ptr_vector<ScAutoStyleData> aEntries;
     boost::ptr_vector<ScAutoStyleInitData> aInitials;
diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx
index aed04d3..e7bc872 100644
--- a/svtools/source/contnr/svimpbox.cxx
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -89,8 +89,8 @@ SvImpLBox::SvImpLBox( SvTreeListBox* pLBView, SvTreeList* pLBTree, WinBits nWinS
     nNodeBmpWidth       = 0;
 
     bAsyncBeginDrag     = false;
-    aAsyncBeginDragTimer.SetTimeout( 0 );
-    aAsyncBeginDragTimer.SetTimeoutHdl( LINK(this,SvImpLBox,BeginDragHdl));
+    aAsyncBeginDragIdle.SetPriority( VCL_IDLE_PRIORITY_HIGHEST );
+    aAsyncBeginDragIdle.SetIdleHdl( LINK(this,SvImpLBox,BeginDragHdl));
     // button animation in listbox
     pActiveButton = 0;
     pActiveEntry = 0;
@@ -99,8 +99,8 @@ SvImpLBox::SvImpLBox( SvTreeListBox* pLBView, SvTreeList* pLBTree, WinBits nWinS
     nFlags = 0;
     nCurTabPos = FIRST_ENTRY_TAB;
 
-    aEditTimer.SetTimeout( 800 );
-    aEditTimer.SetTimeoutHdl( LINK(this,SvImpLBox,EditTimerCall) );
+    aEditIdle.SetPriority( VCL_IDLE_PRIORITY_LOWEST );
+    aEditIdle.SetIdleHdl( LINK(this,SvImpLBox,EditTimerCall) );
 
     nMostRight = -1;
     pMostRightEntry = 0;
@@ -115,7 +115,7 @@ SvImpLBox::SvImpLBox( SvTreeListBox* pLBView, SvTreeList* pLBTree, WinBits nWinS
 
 SvImpLBox::~SvImpLBox()
 {
-    aEditTimer.Stop();
+    aEditIdle.Stop();
     StopUserEvent();
 
     delete m_pStringSorter;
@@ -2037,7 +2037,7 @@ void SvImpLBox::MouseButtonDown( const MouseEvent& rMEvt )
     if ( !rMEvt.IsLeft() && !rMEvt.IsRight())
         return;
 
-    aEditTimer.Stop();
+    aEditIdle.Stop();
     Point aPos( rMEvt.GetPosPixel());
 
     if( aPos.X() > aOutputSize.Width() || aPos.Y() > aOutputSize.Height() )
@@ -2128,7 +2128,7 @@ void SvImpLBox::MouseButtonUp( const MouseEvent& rMEvt)
     {
         nFlags &= (~F_START_EDITTIMER);
         aEditClickPos = rMEvt.GetPosPixel();
-        aEditTimer.Start();
+        aEditIdle.Start();
     }
 
     return;
@@ -2144,7 +2144,7 @@ void SvImpLBox::MouseMove( const MouseEvent& rMEvt)
 
 bool SvImpLBox::KeyInput( const KeyEvent& rKEvt)
 {
-    aEditTimer.Stop();
+    aEditIdle.Stop();
     const vcl::KeyCode& rKeyCode = rKEvt.GetKeyCode();
 
     if( rKeyCode.IsMod2() )
@@ -2622,7 +2622,7 @@ void SvImpLBox::GetFocus()
 
 void SvImpLBox::LoseFocus()
 {
-    aEditTimer.Stop();
+    aEditIdle.Stop();
     if( pCursor )
         pView->SetEntryFocus( pCursor,false );
     ShowCursor( false );
@@ -2933,7 +2933,7 @@ void SvImpLBox::BeginDrag()
     else
     {
         aAsyncBeginDragPos = aSelEng.GetMousePosPixel();
-        aAsyncBeginDragTimer.Start();
+        aAsyncBeginDragIdle.Start();
     }
 }
 
@@ -2981,7 +2981,7 @@ void SvImpLBox::Command( const CommandEvent& rCEvt )
     sal_uInt16              nCommand = rCEvt.GetCommand();
 
     if( nCommand == COMMAND_CONTEXTMENU )
-        aEditTimer.Stop();
+        aEditIdle.Stop();
 
     // scroll mouse event?
     if( ( ( nCommand == COMMAND_WHEEL ) || ( nCommand == COMMAND_STARTAUTOSCROLL ) || ( nCommand == COMMAND_AUTOSCROLL ) )
diff --git a/svtools/source/inc/svimpbox.hxx b/svtools/source/inc/svimpbox.hxx
index a897aa3..84a5235 100644
--- a/svtools/source/inc/svimpbox.hxx
+++ b/svtools/source/inc/svimpbox.hxx
@@ -122,19 +122,18 @@ private:
     // all our images
     Image               m_aNodeAndEntryImages[ IT_IMAGE_COUNT ];
 
-    // wg. kompat. hier
     Size                aOutputSize;
     SelectionEngine     aSelEng;
     ImpLBSelEng         aFctSet;
-    Timer               aAsyncBeginDragTimer;
+    Idle                aAsyncBeginDragIdle;
     Point               aAsyncBeginDragPos;
 
     long                nYoffsNodeBmp;
-    long                nNodeBmpTabDistance; // typisch kleiner 0
+    long                nNodeBmpTabDistance; // typical smaller than 0
     long                nNodeBmpWidth;
     long                nNextVerVisSize;
     long                nMostRight;
-    sal_uLong               nVisibleCount;  // Anzahl Zeilen im Control
+    sal_uLong               nVisibleCount;  // Number of lines in control
     ImplSVEvent *       nCurUserEvent;
     short               nHorSBarHeight, nVerSBarWidth;
     sal_uInt16              nFlags;
@@ -154,7 +153,7 @@ private:
     bool                bAreChildrenTransient;
 
     Point               aEditClickPos;
-    Timer               aEditTimer;
+    Idle                aEditIdle;
 
     // #102891# -------------------
     comphelper::string::NaturalStringSorter *m_pStringSorter;


More information about the Libreoffice-commits mailing list