forms/source/component/ListBox.cxx | 16 +++++++-------- forms/source/component/ListBox.hxx | 2 - linguistic/source/lngsvcmgr.cxx | 6 ++--- linguistic/source/lngsvcmgr.hxx | 2 - sfx2/source/dialog/filedlghelper.cxx | 12 +++++------ sfx2/source/dialog/filedlgimpl.hxx | 2 - sfx2/source/dialog/templdlg.cxx | 18 ++++++++--------- sfx2/source/doc/new.cxx | 8 +++---- sfx2/source/inc/templdgi.hxx | 2 - starmath/inc/edit.hxx | 4 +-- starmath/source/edit.cxx | 36 +++++++++++++++++------------------ 11 files changed, 54 insertions(+), 54 deletions(-)
New commits: commit dd523a5f478420d15ace896a961c02ad048ab43d Author: Tobias Madl <tobias.madl....@gmail.com> Date: Thu Nov 13 14:50:26 2014 +0000 changed timers to idles Change-Id: Ic0d7730f7880dfe2e83c84e773b8cc420249b269 diff --git a/forms/source/component/ListBox.cxx b/forms/source/component/ListBox.cxx index 2d42a97..e86bef7 100644 --- a/forms/source/component/ListBox.cxx +++ b/forms/source/component/ListBox.cxx @@ -1789,8 +1789,8 @@ namespace frm doSetDelegator(); - m_aChangeTimer.SetTimeout(500); - m_aChangeTimer.SetTimeoutHdl(LINK(this,OListBoxControl,OnTimeout)); + m_aChangeIdle.SetPriority(VCL_IDLE_PRIORITY_LOWEST); + m_aChangeIdle.SetIdleHdl(LINK(this,OListBoxControl,OnTimeout)); } @@ -1866,13 +1866,13 @@ namespace frm // and do the handling for the ChangeListeners ::osl::ClearableMutexGuard aGuard(m_aMutex); - if ( m_aChangeTimer.IsActive() ) + if ( m_aChangeIdle.IsActive() ) { Reference<XPropertySet> xSet(getModel(), UNO_QUERY); m_aCurrentSelection = xSet->getPropertyValue(PROPERTY_SELECT_SEQ); - m_aChangeTimer.Stop(); - m_aChangeTimer.Start(); + m_aChangeIdle.Stop(); + m_aChangeIdle.Start(); } else { @@ -1902,7 +1902,7 @@ namespace frm if (bModified) { m_aCurrentSelection = aValue; - m_aChangeTimer.Start(); + m_aChangeIdle.Start(); } } } @@ -1935,8 +1935,8 @@ namespace frm void OListBoxControl::disposing() { - if (m_aChangeTimer.IsActive()) - m_aChangeTimer.Stop(); + if (m_aChangeIdle.IsActive()) + m_aChangeIdle.Stop(); EventObject aEvent( *this ); m_aChangeListeners.disposeAndClear( aEvent ); diff --git a/forms/source/component/ListBox.hxx b/forms/source/component/ListBox.hxx index 991627c..85b380c 100644 --- a/forms/source/component/ListBox.hxx +++ b/forms/source/component/ListBox.hxx @@ -255,7 +255,7 @@ private: ::cppu::OInterfaceContainerHelper m_aItemListeners; ::com::sun::star::uno::Any m_aCurrentSelection; - Timer m_aChangeTimer; + Idle m_aChangeIdle; ::com::sun::star::uno::Reference< ::com::sun::star::awt::XListBox > m_xAggregateListBox; diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx index 259dd8f..2538f41 100644 --- a/linguistic/source/lngsvcmgr.cxx +++ b/linguistic/source/lngsvcmgr.cxx @@ -476,8 +476,8 @@ LngSvcMgr::LngSvcMgr() UpdateAll(); - aUpdateTimer.SetTimeout(500); - aUpdateTimer.SetTimeoutHdl(LINK(this, LngSvcMgr, updateAndBroadcast)); + aUpdateIdle.SetPriority(VCL_IDLE_PRIORITY_LOWEST); + aUpdateIdle.SetIdleHdl(LINK(this, LngSvcMgr, updateAndBroadcast)); // request to be notified if an extension has been added/removed uno::Reference<uno::XComponentContext> xContext(comphelper::getProcessComponentContext()); @@ -513,7 +513,7 @@ void LngSvcMgr::modified(const lang::EventObject&) clearSvcInfoArray(pAvailThesSvcs); //schedule in an update to execute in the main thread - aUpdateTimer.Start(); + aUpdateIdle.Start(); } //run update, and inform everyone that dictionaries (may) have changed, this diff --git a/linguistic/source/lngsvcmgr.hxx b/linguistic/source/lngsvcmgr.hxx index 1b0d664..c3046e8 100644 --- a/linguistic/source/lngsvcmgr.hxx +++ b/linguistic/source/lngsvcmgr.hxx @@ -81,7 +81,7 @@ class LngSvcMgr : com::sun::star::uno::Reference< ::com::sun::star::util::XModifyBroadcaster> xMB; - Timer aUpdateTimer; + Idle aUpdateIdle; com::sun::star::uno::Sequence< diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 18da893..fe2fe37 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -200,7 +200,7 @@ void FileDialogHelper_Impl::handleFileSelectionChanged( const FilePickerEvent& ) updateVersions(); if ( mbShowPreview ) - maPreviewTimer.Start(); + maPreviewIdle.Start(); } void FileDialogHelper_Impl::handleDirectoryChanged( const FilePickerEvent& ) @@ -983,8 +983,8 @@ FileDialogHelper_Impl::FileDialogHelper_Impl( mbHasPreview = true; // aPreviewTimer - maPreviewTimer.SetTimeout( 500 ); - maPreviewTimer.SetTimeoutHdl( LINK( this, FileDialogHelper_Impl, TimeOutHdl_Impl ) ); + maPreviewIdle.SetPriority( VCL_IDLE_PRIORITY_LOWEST ); + maPreviewIdle.SetIdleHdl( LINK( this, FileDialogHelper_Impl, TimeOutHdl_Impl ) ); break; case FILEOPEN_PLAY: @@ -1000,8 +1000,8 @@ FileDialogHelper_Impl::FileDialogHelper_Impl( nTemplateDescription = TemplateDescription::FILEOPEN_LINK_PREVIEW; mbHasPreview = true; // aPreviewTimer - maPreviewTimer.SetTimeout( 500 ); - maPreviewTimer.SetTimeoutHdl( LINK( this, FileDialogHelper_Impl, TimeOutHdl_Impl ) ); + maPreviewIdle.SetPriority( VCL_IDLE_PRIORITY_LOWEST ); + maPreviewIdle.SetIdleHdl( LINK( this, FileDialogHelper_Impl, TimeOutHdl_Impl ) ); break; case FILESAVE_AUTOEXTENSION: @@ -1122,7 +1122,7 @@ FileDialogHelper_Impl::~FileDialogHelper_Impl() if ( mbDeleteMatcher ) delete mpMatcher; - maPreviewTimer.SetTimeoutHdl( Link() ); + maPreviewIdle.SetIdleHdl( Link() ); ::comphelper::disposeComponent( mxFileDlg ); } diff --git a/sfx2/source/dialog/filedlgimpl.hxx b/sfx2/source/dialog/filedlgimpl.hxx index 4d663d2..e202421 100644 --- a/sfx2/source/dialog/filedlgimpl.hxx +++ b/sfx2/source/dialog/filedlgimpl.hxx @@ -64,7 +64,7 @@ namespace sfx2 OUString maSelectFilter; OUString maButtonLabel; - Timer maPreviewTimer; + Idle maPreviewIdle; Graphic maGraphic; const short m_nDialogType; diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index 0aaf37b..f29c9e5 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -645,7 +645,7 @@ SfxCommonTemplateDialog_Impl::SfxCommonTemplateDialog_Impl( SfxBindings* pB, vcl pBindings ( pB ), pWindow ( pW ), pModule ( NULL ), - pTimer ( NULL ), + pIdle ( NULL ), m_pStyleFamiliesId ( NULL ), pStyleFamilies ( NULL ), pStyleSheetPool ( NULL ), @@ -873,7 +873,7 @@ SfxCommonTemplateDialog_Impl::~SfxCommonTemplateDialog_Impl() EndListening(*pStyleSheetPool); pStyleSheetPool = NULL; delete pTreeBox; - delete pTimer; + delete pIdle; if ( m_pDeletionWatcher ) m_pDeletionWatcher->signal(); } @@ -1435,10 +1435,10 @@ IMPL_LINK( SfxCommonTemplateDialog_Impl, TimeOut, Timer *, pTim ) } } bDontUpdate=false; - DELETEZ(pTimer); + DELETEZ(pIdle); } else - pTimer->Start(); + pIdle->Start(); return 0; } @@ -1527,13 +1527,13 @@ void SfxCommonTemplateDialog_Impl::Notify(SfxBroadcaster& /*rBC*/, const SfxHint dynamic_cast<const SfxStyleSheetHint*>(&rHint) || dynamic_cast<const SfxStyleSheetHintExtended*>(&rHint))) { - if(!pTimer) + if(!pIdle) { - pTimer=new Timer; - pTimer->SetTimeout(500); - pTimer->SetTimeoutHdl(LINK(this,SfxCommonTemplateDialog_Impl,TimeOut)); + pIdle=new Idle; + pIdle->SetPriority(VCL_IDLE_PRIORITY_LOWEST); + pIdle->SetIdleHdl(LINK(this,SfxCommonTemplateDialog_Impl,TimeOut)); } - pTimer->Start(); + pIdle->Start(); } } diff --git a/sfx2/source/doc/new.cxx b/sfx2/source/doc/new.cxx index 65dfc7e..6779c40 100644 --- a/sfx2/source/doc/new.cxx +++ b/sfx2/source/doc/new.cxx @@ -135,7 +135,7 @@ class SfxNewFileDialog_Impl PushButton* m_pLoadFilePB; VclExpander* m_pMoreBt; - Timer aPrevTimer; + Idle aPrevIdle; OUString aNone; OUString sLoadTemplate; @@ -285,7 +285,7 @@ IMPL_LINK_NOARG(SfxNewFileDialog_Impl, TemplateSelect) // Dialog is not opened return 0; - aPrevTimer.Start(); + aPrevIdle.Start(); return 0; } @@ -431,8 +431,8 @@ SfxNewFileDialog_Impl::SfxNewFileDialog_Impl( m_pRegionLb->SetSelectHdl(LINK(this, SfxNewFileDialog_Impl, RegionSelect)); } - aPrevTimer.SetTimeout( 500 ); - aPrevTimer.SetTimeoutHdl( LINK( this, SfxNewFileDialog_Impl, Update)); + aPrevIdle.SetPriority( VCL_IDLE_PRIORITY_LOWEST ); + aPrevIdle.SetIdleHdl( LINK( this, SfxNewFileDialog_Impl, Update)); m_pRegionLb->SelectEntryPos(0); RegionSelect(m_pRegionLb); diff --git a/sfx2/source/inc/templdgi.hxx b/sfx2/source/inc/templdgi.hxx index b6ca268..fa7a26b 100644 --- a/sfx2/source/inc/templdgi.hxx +++ b/sfx2/source/inc/templdgi.hxx @@ -159,7 +159,7 @@ protected: vcl::Window* pWindow; SfxModule* pModule; - Timer* pTimer; + Idle* pIdle; ResId* m_pStyleFamiliesId; SfxStyleFamilies* pStyleFamilies; diff --git a/starmath/inc/edit.hxx b/starmath/inc/edit.hxx index 7c66fa6..4aef879 100644 --- a/starmath/inc/edit.hxx +++ b/starmath/inc/edit.hxx @@ -56,8 +56,8 @@ class SmEditWindow : public vcl::Window, public DropTargetHelper ScrollBar *pHScrollBar, *pVScrollBar; ScrollBarBox *pScrollBox; - Timer aModifyTimer, - aCursorMoveTimer; + Idle aModifyIdle, + aCursorMoveIdle; ESelection aOldSelection; virtual void KeyInput(const KeyEvent& rKEvt) SAL_OVERRIDE; diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx index 672a775..f05f3dd 100644 --- a/starmath/source/edit.cxx +++ b/starmath/source/edit.cxx @@ -105,13 +105,13 @@ SmEditWindow::SmEditWindow( SmCmdBoxWindow &rMyCmdBoxWin ) : // compare DataChanged SetBackground( GetSettings().GetStyleSettings().GetWindowColor() ); - aModifyTimer.SetTimeoutHdl(LINK(this, SmEditWindow, ModifyTimerHdl)); - aModifyTimer.SetTimeout(500); + aModifyIdle.SetIdleHdl(LINK(this, SmEditWindow, ModifyTimerHdl)); + aModifyIdle.SetPriority(VCL_IDLE_PRIORITY_LOWEST); if (!IsInlineEditEnabled()) { - aCursorMoveTimer.SetTimeoutHdl(LINK(this, SmEditWindow, CursorMoveTimerHdl)); - aCursorMoveTimer.SetTimeout(500); + aCursorMoveIdle.SetIdleHdl(LINK(this, SmEditWindow, CursorMoveTimerHdl)); + aCursorMoveIdle.SetPriority(VCL_IDLE_PRIORITY_LOWEST); } // if not called explicitly the this edit window within the @@ -122,7 +122,7 @@ SmEditWindow::SmEditWindow( SmCmdBoxWindow &rMyCmdBoxWin ) : SmEditWindow::~SmEditWindow() { - aModifyTimer.Stop(); + aModifyIdle.Stop(); StartCursorMove(); @@ -152,7 +152,7 @@ SmEditWindow::~SmEditWindow() void SmEditWindow::StartCursorMove() { if (!IsInlineEditEnabled()) - aCursorMoveTimer.Stop(); + aCursorMoveIdle.Stop(); } void SmEditWindow::InvalidateSlots() @@ -246,7 +246,7 @@ void SmEditWindow::DataChanged( const DataChangedEvent& ) IMPL_LINK( SmEditWindow, ModifyTimerHdl, Timer *, EMPTYARG /*pTimer*/ ) { UpdateStatus(); - aModifyTimer.Stop(); + aModifyIdle.Stop(); return 0; } @@ -275,7 +275,7 @@ IMPL_LINK(SmEditWindow, CursorMoveTimerHdl, Timer *, EMPTYARG /*pTimer*/) aOldSelection = aNewSelection; } } - aCursorMoveTimer.Stop(); + aCursorMoveIdle.Stop(); return 0; } @@ -314,7 +314,7 @@ void SmEditWindow::MouseButtonUp(const MouseEvent &rEvt) Window::MouseButtonUp (rEvt); if (!IsInlineEditEnabled()) - CursorMoveTimerHdl(&aCursorMoveTimer); + CursorMoveTimerHdl(&aCursorMoveIdle); InvalidateSlots(); } @@ -468,8 +468,8 @@ void SmEditWindow::KeyInput(const KeyEvent& rKEvt) { // F1 (help) leads to the destruction of this Flush(); - if ( aModifyTimer.IsActive() ) - aModifyTimer.Stop(); + if ( aModifyIdle.IsActive() ) + aModifyIdle.Stop(); Window::KeyInput(rKEvt); } else @@ -492,7 +492,7 @@ void SmEditWindow::KeyInput(const KeyEvent& rKEvt) EditEngine *pEditEngine = GetEditEngine(); if (pDocShell && pEditEngine) pDocShell->SetModified(pEditEngine->IsModified()); - aModifyTimer.Start(); + aModifyIdle.Start(); } // get the current char of the key event @@ -680,7 +680,7 @@ void SmEditWindow::SetText(const OUString& rText) // Restarting the timer here, prevents calling the handlers for other (currently inactive) // math tasks - aModifyTimer.Start(); + aModifyIdle.Start(); pEditView->SetSelection(eSelection); } @@ -814,7 +814,7 @@ void SmEditWindow::InsertCommand(sal_uInt16 nCommand) pEditView->SetSelection(aSelection); } - aModifyTimer.Start(); + aModifyIdle.Start(); StartCursorMove(); GrabFocus(); } @@ -1062,7 +1062,7 @@ void SmEditWindow::InsertText(const OUString& rText) pEditView->SetSelection(aSelection); } - aModifyTimer.Start(); + aModifyIdle.Start(); StartCursorMove(); GrabFocus(); } @@ -1082,10 +1082,10 @@ void SmEditWindow::Flush() new SfxStringItem(SID_TEXT, GetText()), 0L); } } - if (aCursorMoveTimer.IsActive()) + if (aCursorMoveIdle.IsActive()) { - aCursorMoveTimer.Stop(); - CursorMoveTimerHdl(&aCursorMoveTimer); + aCursorMoveIdle.Stop(); + CursorMoveTimerHdl(&aCursorMoveIdle); } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits