diff options
author | Tobias Madl <tobias.madl.dev@gmail.com> | 2014-11-20 16:21:17 +0000 |
---|---|---|
committer | Tobias Madl <tobias.madl.dev@gmail.com> | 2014-12-09 12:35:04 +0000 |
commit | eef25e0e7c03b53881e19bedb20532950323ef09 (patch) | |
tree | d44b0a32f20ba1a09c62bbb9dfa296eb3b0a3463 /formula | |
parent | 50fdcff56a863ef69245c628e68d8673830ebbaa (diff) |
changed timers to idles
Change-Id: Iaceef008e7df91f3a9ad54fdaec25f2170100ee0
Diffstat (limited to 'formula')
-rw-r--r-- | formula/source/ui/dlg/formula.cxx | 18 | ||||
-rw-r--r-- | formula/source/ui/dlg/funcutl.cxx | 26 |
2 files changed, 21 insertions, 23 deletions
diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx index b17da4f5d3d2..6e39f6e1e82c 100644 --- a/formula/source/ui/dlg/formula.cxx +++ b/formula/source/ui/dlg/formula.cxx @@ -183,7 +183,7 @@ namespace formula bool bStructUpdate; MultiLineEdit* pMEdit; bool bUserMatrixFlag; - Timer aTimer; + Idle aIdle; const OUString aTitle1; const OUString aTitle2; @@ -353,11 +353,11 @@ FormulaDlg_Impl::FormulaDlg_Impl(Dialog* pParent FormulaDlg_Impl::~FormulaDlg_Impl() { - if(aTimer.IsActive()) + if(aIdle.IsActive()) { - aTimer.SetTimeoutHdl(Link()); - aTimer.Stop(); - }// if(aTimer.IsActive()) + aIdle.SetIdleHdl(Link()); + aIdle.Stop(); + }// if(aIdle.IsActive()) bIsShutDown=true;// Set it in order to PreNotify not to save GetFocus. m_pTabCtrl->RemovePage(TP_FUNCTION); @@ -412,7 +412,7 @@ void FormulaDlg_Impl::PreNotify( NotifyEvent& rNEvt ) FormEditData* pData = m_pHelper->getFormEditData(); - if (pData && !aTimer.IsActive()) // won't be destroyed via Close + if (pData && !aIdle.IsActive()) // won't be destroyed via Close { pData->SetUniqueId(aActivWinId); } @@ -1773,9 +1773,9 @@ OUString FormulaDlg::GetMeText() const void FormulaDlg::Update() { m_pImpl->Update(); - m_pImpl->aTimer.SetTimeout(200); - m_pImpl->aTimer.SetTimeoutHdl(LINK( this, FormulaDlg, UpdateFocusHdl)); - m_pImpl->aTimer.Start(); + m_pImpl->aIdle.SetPriority(VCL_IDLE_PRIORITY_LOWER); + m_pImpl->aIdle.SetIdleHdl(LINK( this, FormulaDlg, UpdateFocusHdl)); + m_pImpl->aIdle.Start(); } void FormulaDlg::DoEnter(bool _bOk) diff --git a/formula/source/ui/dlg/funcutl.cxx b/formula/source/ui/dlg/funcutl.cxx index 65fd1f4d4e2b..8a3de8c9581a 100644 --- a/formula/source/ui/dlg/funcutl.cxx +++ b/formula/source/ui/dlg/funcutl.cxx @@ -455,15 +455,13 @@ void EditBox::UpdateOldSel() // class RefEdit -#define SC_ENABLE_TIME 100 - RefEdit::RefEdit( vcl::Window* _pParent, vcl::Window* pShrinkModeLabel, WinBits nStyle ) : Edit( _pParent, nStyle ) , pAnyRefDlg( NULL ) , pLabelWidget(pShrinkModeLabel) { - aTimer.SetTimeoutHdl( LINK( this, RefEdit, UpdateHdl ) ); - aTimer.SetTimeout( SC_ENABLE_TIME ); + aIdle.SetIdleHdl( LINK( this, RefEdit, UpdateHdl ) ); + aIdle.SetPriority( VCL_IDLE_PRIORITY_LOW ); } RefEdit::RefEdit( vcl::Window* _pParent,IControlReferenceHandler* pParent, @@ -472,8 +470,8 @@ RefEdit::RefEdit( vcl::Window* _pParent,IControlReferenceHandler* pParent, , pAnyRefDlg( pParent ) , pLabelWidget(pShrinkModeLabel) { - aTimer.SetTimeoutHdl( LINK( this, RefEdit, UpdateHdl ) ); - aTimer.SetTimeout( SC_ENABLE_TIME ); + aIdle.SetIdleHdl( LINK( this, RefEdit, UpdateHdl ) ); + aIdle.SetPriority( VCL_IDLE_PRIORITY_LOW ); } extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeRefEdit(vcl::Window *pParent, VclBuilder::stringmap &) @@ -483,8 +481,8 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeRefEdit(vcl::Window *p RefEdit::~RefEdit() { - aTimer.SetTimeoutHdl( Link() ); - aTimer.Stop(); + aIdle.SetIdleHdl( Link() ); + aIdle.Stop(); } void RefEdit::SetRefString( const OUString& rStr ) @@ -509,12 +507,12 @@ void RefEdit::SetRefValid(bool bValid) void RefEdit::SetText(const OUString& rStr) { Edit::SetText( rStr ); - UpdateHdl( &aTimer ); + UpdateHdl( &aIdle ); } void RefEdit::StartUpdateData() { - aTimer.Start(); + aIdle.Start(); } void RefEdit::SetReferences( IControlReferenceHandler* pDlg, vcl::Window* pLabel ) @@ -524,13 +522,13 @@ void RefEdit::SetReferences( IControlReferenceHandler* pDlg, vcl::Window* pLabel if( pDlg ) { - aTimer.SetTimeoutHdl( LINK( this, RefEdit, UpdateHdl ) ); - aTimer.SetTimeout( SC_ENABLE_TIME ); + aIdle.SetIdleHdl( LINK( this, RefEdit, UpdateHdl ) ); + aIdle.SetPriority( VCL_IDLE_PRIORITY_LOW ); } else { - aTimer.SetTimeoutHdl( Link() ); - aTimer.Stop(); + aIdle.SetIdleHdl( Link() ); + aIdle.Stop(); } } |