[Libreoffice-commits] core.git: Branch 'feature/priorities' - basctl/source cui/source dbaccess/source linguistic/source sc/source starmath/inc starmath/source svx/inc svx/source sw/source toolkit/source vcl/Library_vcl.mk vcl/qa vcl/source
Tobias Madl
tobias.madl.dev at gmail.com
Wed Jan 14 05:13:42 PST 2015
basctl/source/basicide/baside2b.cxx | 2 +-
cui/source/inc/backgrnd.hxx | 2 +-
cui/source/tabpages/backgrnd.cxx | 8 ++++----
cui/source/tabpages/macroass.cxx | 2 +-
dbaccess/source/ui/inc/JoinTableView.hxx | 1 +
dbaccess/source/ui/querydesign/JoinTableView.cxx | 2 +-
linguistic/source/lngsvcmgr.hxx | 1 +
sc/source/ui/dbgui/sfiltdlg.cxx | 2 +-
sc/source/ui/inc/navipi.hxx | 2 +-
sc/source/ui/navipi/navipi.cxx | 6 +++---
starmath/inc/edit.hxx | 4 ++--
starmath/source/edit.cxx | 4 ++--
svx/inc/sdr/contact/objectcontactofpageview.hxx | 1 +
svx/source/inc/eventhandler.hxx | 3 ++-
svx/source/sdr/contact/objectcontactofpageview.cxx | 2 +-
svx/source/sdr/contact/viewobjectcontactofpageobj.cxx | 3 ++-
sw/source/uibase/inc/srcedtw.hxx | 1 +
toolkit/source/awt/vclxtoolkit.cxx | 3 ++-
vcl/Library_vcl.mk | 1 +
vcl/qa/cppunit/timer.cxx | 8 +++++---
vcl/source/app/idle.cxx | 9 +++++----
vcl/source/edit/textdata.cxx | 2 +-
22 files changed, 40 insertions(+), 29 deletions(-)
New commits:
commit b26abd5a75444714cdb3d8fc4c00161f96ab06c6
Author: Tobias Madl <tobias.madl.dev at gmail.com>
Date: Wed Jan 14 13:11:28 2015 +0000
Idle and Timer are now completely independent
And everything is functionating pretty well.
Change-Id: Id7f5a995362f6f7c5235f2e9facb7c7f119f3140
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 0540ea5..3a2789c 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -1334,7 +1334,7 @@ void EditorWindow::DestroyProgress()
void EditorWindow::ForceSyntaxTimeout()
{
aSyntaxIdle.Stop();
- aSyntaxIdle.GetTimeoutHdl().Call(&aSyntaxIdle);
+ aSyntaxIdle.GetIdleHdl().Call(&aSyntaxIdle);
}
diff --git a/cui/source/inc/backgrnd.hxx b/cui/source/inc/backgrnd.hxx
index ab4145f..9e34d66 100644
--- a/cui/source/inc/backgrnd.hxx
+++ b/cui/source/inc/backgrnd.hxx
@@ -137,7 +137,7 @@ private:
bool FillItemSetWithWallpaperItem( SfxItemSet& rCoreSet, sal_uInt16 nSlot);
void ResetFromWallpaperItem( const SfxItemSet& rSet );
- DECL_LINK( LoadTimerHdl_Impl, Timer* );
+ DECL_LINK( LoadIdleHdl_Impl, Idle* );
DECL_LINK(SelectHdl_Impl, void *);
DECL_LINK(BrowseHdl_Impl, void *);
DECL_LINK( RadioClickHdl_Impl, RadioButton* );
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index 1b27534..4217da6 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -723,7 +723,7 @@ bool SvxBackgroundTabPage::FillItemSet( SfxItemSet* rCoreSet )
if ( pPageImpl->pLoadIdle && pPageImpl->pLoadIdle->IsActive() )
{
pPageImpl->pLoadIdle->Stop();
- LoadTimerHdl_Impl( pPageImpl->pLoadIdle );
+ LoadIdleHdl_Impl( pPageImpl->pLoadIdle );
}
// os: Such a nonsense! One will always find such an item somewhere,
// but it must be existing in the rSet!
@@ -1095,7 +1095,7 @@ void SvxBackgroundTabPage::ShowSelector()
pPageImpl->pLoadIdle = new Idle;
pPageImpl->pLoadIdle->SetPriority( IdlePriority::VCL_IDLE_PRIORITY_LOWEST );
pPageImpl->pLoadIdle->SetIdleHdl(
- LINK( this, SvxBackgroundTabPage, LoadTimerHdl_Impl ) );
+ LINK( this, SvxBackgroundTabPage, LoadIdleHdl_Impl ) );
bAllowShowSelector = false;
@@ -1453,7 +1453,7 @@ IMPL_LINK_NOARG(SvxBackgroundTabPage, BrowseHdl_Impl)
-IMPL_LINK( SvxBackgroundTabPage, LoadTimerHdl_Impl, Timer* , pTimer )
+IMPL_LINK( SvxBackgroundTabPage, LoadIdleHdl_Impl, Idle* , pIdle )
/* [Description]
@@ -1463,7 +1463,7 @@ IMPL_LINK( SvxBackgroundTabPage, LoadTimerHdl_Impl, Timer* , pTimer )
*/
{
- if ( pTimer == pPageImpl->pLoadIdle )
+ if ( pIdle == pPageImpl->pLoadIdle )
{
pPageImpl->pLoadIdle->Stop();
diff --git a/cui/source/tabpages/macroass.cxx b/cui/source/tabpages/macroass.cxx
index a4a23b2..3a160a0 100644
--- a/cui/source/tabpages/macroass.cxx
+++ b/cui/source/tabpages/macroass.cxx
@@ -189,7 +189,7 @@ bool _SfxMacroTabPage::FillItemSet( SfxItemSet* rSet )
void _SfxMacroTabPage::LaunchFillGroup()
{
- if (!mpImpl->maFillGroupIdle.GetTimeoutHdl().IsSet())
+ if (!mpImpl->maFillGroupIdle.GetIdleHdl().IsSet())
{
mpImpl->maFillGroupIdle.SetIdleHdl( STATIC_LINK( this, _SfxMacroTabPage, TimeOut_Impl ) );
mpImpl->maFillGroupIdle.SetPriority( IdlePriority::VCL_IDLE_PRIORITY_HIGHEST );
diff --git a/dbaccess/source/ui/inc/JoinTableView.hxx b/dbaccess/source/ui/inc/JoinTableView.hxx
index a14be0d..c5399ba 100644
--- a/dbaccess/source/ui/inc/JoinTableView.hxx
+++ b/dbaccess/source/ui/inc/JoinTableView.hxx
@@ -21,6 +21,7 @@
#include <vcl/window.hxx>
#include <vcl/timer.hxx>
+#include <vcl/idle.hxx>
#include <vcl/scrbar.hxx>
#include <tools/rtti.hxx>
#include <svtools/transfer.hxx>
diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx
index 020e990..00f07ab 100644
--- a/dbaccess/source/ui/querydesign/JoinTableView.cxx
+++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx
@@ -1048,7 +1048,7 @@ bool OJoinTableView::ScrollWhileDragging()
// resetting timer, if still necessary
if (bNeedScrollTimer)
{
- m_aDragScrollIdle.SetPriority(VCL_IDLE_PRIORITY_LOW);
+ m_aDragScrollIdle.SetPriority(IdlePriority::VCL_IDLE_PRIORITY_LOW);
m_aDragScrollIdle.Start();
}
diff --git a/linguistic/source/lngsvcmgr.hxx b/linguistic/source/lngsvcmgr.hxx
index c3046e8..5a91a9e 100644
--- a/linguistic/source/lngsvcmgr.hxx
+++ b/linguistic/source/lngsvcmgr.hxx
@@ -31,6 +31,7 @@
#include <com/sun/star/util/XModifyListener.hpp>
#include <unotools/configitem.hxx>
#include <vcl/timer.hxx>
+#include <vcl/idle.hxx>
#include <boost/ptr_container/ptr_vector.hpp>
#include "linguistic/misc.hxx"
diff --git a/sc/source/ui/dbgui/sfiltdlg.cxx b/sc/source/ui/dbgui/sfiltdlg.cxx
index 2d13078..164554e 100644
--- a/sc/source/ui/dbgui/sfiltdlg.cxx
+++ b/sc/source/ui/dbgui/sfiltdlg.cxx
@@ -87,7 +87,7 @@ ScSpecialFilterDlg::ScSpecialFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, vc
// Hack: RefInput-Kontrolle
pIdle = new Idle;
- pIdle->SetTimeout( IdlePriority::VCL_IDLE_PRIORITY_MEDIUM ); // 50ms warten
+ pIdle->SetPriority( IdlePriority::VCL_IDLE_PRIORITY_MEDIUM ); // 50ms warten
pIdle->SetIdleHdl( LINK( this, ScSpecialFilterDlg, TimeOutHdl ) );
pIdle->Start();
diff --git a/sc/source/ui/inc/navipi.hxx b/sc/source/ui/inc/navipi.hxx
index a153361..01578ab 100644
--- a/sc/source/ui/inc/navipi.hxx
+++ b/sc/source/ui/inc/navipi.hxx
@@ -257,7 +257,7 @@ private:
ScNavigatorControllerItem** ppBoundItems;
- DECL_LINK( TimeHdl, Timer* );
+ DECL_LINK( TimeHdl, Idle* );
void DoResize();
diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index fc4fbbd..820c972 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -657,7 +657,7 @@ ScNavigatorDlg::ScNavigatorDlg( SfxBindings* pB, SfxChildWindowContext* pCW, vcl
aWndScenarios.SetPosPixel( aLbEntries.GetPosPixel() );
aContentIdle.SetIdleHdl( LINK( this, ScNavigatorDlg, TimeHdl ) );
- aContentIdle.SetPriority( VCL_IDLE_PRIORITY_LOWEST );
+ aContentIdle.SetPriority( IdlePriority::VCL_IDLE_PRIORITY_LOWEST );
FreeResource();
@@ -878,9 +878,9 @@ void ScNavigatorDlg::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
}
-IMPL_LINK( ScNavigatorDlg, TimeHdl, Timer*, pTimer )
+IMPL_LINK( ScNavigatorDlg, TimeHdl, Idle*, pIdle )
{
- if ( pTimer != &aContentIdle )
+ if ( pIdle != &aContentIdle )
return 0;
aLbEntries.Refresh( SC_CONTENT_NOTE );
diff --git a/starmath/inc/edit.hxx b/starmath/inc/edit.hxx
index ece8824..601b3b9 100644
--- a/starmath/inc/edit.hxx
+++ b/starmath/inc/edit.hxx
@@ -64,8 +64,8 @@ class SmEditWindow : public vcl::Window, public DropTargetHelper
virtual void KeyInput(const KeyEvent& rKEvt) SAL_OVERRIDE;
virtual void Command(const CommandEvent& rCEvt) SAL_OVERRIDE;
DECL_LINK(MenuSelectHdl, Menu *);
- DECL_LINK(ModifyTimerHdl, Timer *);
- DECL_LINK(CursorMoveTimerHdl, Timer *);
+ DECL_LINK(ModifyTimerHdl, Idle *);
+ DECL_LINK(CursorMoveTimerHdl, Idle *);
virtual void DataChanged( const DataChangedEvent& ) SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx
index 00c7dda..c85e9bf 100644
--- a/starmath/source/edit.cxx
+++ b/starmath/source/edit.cxx
@@ -244,14 +244,14 @@ void SmEditWindow::DataChanged( const DataChangedEvent& )
Resize();
}
-IMPL_LINK( SmEditWindow, ModifyTimerHdl, Timer *, EMPTYARG /*pTimer*/ )
+IMPL_LINK( SmEditWindow, ModifyTimerHdl, Idle *, EMPTYARG /*pTimer*/ )
{
UpdateStatus();
aModifyIdle.Stop();
return 0;
}
-IMPL_LINK(SmEditWindow, CursorMoveTimerHdl, Timer *, EMPTYARG /*pTimer*/)
+IMPL_LINK(SmEditWindow, CursorMoveTimerHdl, Idle *, EMPTYARG /*pTimer*/)
// every once in a while check cursor position (selection) of edit
// window and if it has changed (try to) set the formula-cursor
// according to that.
diff --git a/svx/inc/sdr/contact/objectcontactofpageview.hxx b/svx/inc/sdr/contact/objectcontactofpageview.hxx
index c5e07fa..3a82250 100644
--- a/svx/inc/sdr/contact/objectcontactofpageview.hxx
+++ b/svx/inc/sdr/contact/objectcontactofpageview.hxx
@@ -21,6 +21,7 @@
#define INCLUDED_SVX_INC_SDR_CONTACT_OBJECTCONTACTOFPAGEVIEW_HXX
#include <svx/sdr/contact/objectcontact.hxx>
+#include <vcl/idle.hxx>
// predeclarations
diff --git a/svx/source/inc/eventhandler.hxx b/svx/source/inc/eventhandler.hxx
index f3a31de..f8fc04e 100644
--- a/svx/source/inc/eventhandler.hxx
+++ b/svx/source/inc/eventhandler.hxx
@@ -24,6 +24,7 @@
#include <vector>
#include <vcl/timer.hxx>
+#include <vcl/idle.hxx>
namespace sdr
{
@@ -95,7 +96,7 @@ namespace sdr
class TimerEventHandler : public EventHandler, public Idle
{
public:
- TimerEventHandler(IdlePriority ePriority = VCL_IDLE_PRIORITY_HIGH);
+ TimerEventHandler(IdlePriority ePriority = IdlePriority::VCL_IDLE_PRIORITY_HIGH);
virtual ~TimerEventHandler();
diff --git a/svx/source/sdr/contact/objectcontactofpageview.cxx b/svx/source/sdr/contact/objectcontactofpageview.cxx
index 949ac76..fa1b39d 100644
--- a/svx/source/sdr/contact/objectcontactofpageview.cxx
+++ b/svx/source/sdr/contact/objectcontactofpageview.cxx
@@ -59,7 +59,7 @@ namespace sdr
setPreviewRenderer(((SdrPaintView&)rPageWindow.GetPageView().GetView()).IsPreviewRenderer());
// init timer
- SetPriority(VCL_IDLE_PRIORITY_HIGH);
+ SetPriority(IdlePriority::VCL_IDLE_PRIORITY_HIGH);
Stop();
}
diff --git a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx
index 007dc7d..a7806ff 100644
--- a/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx
+++ b/svx/source/sdr/contact/viewobjectcontactofpageobj.cxx
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <vcl/idle.hxx>
#include <svx/sdr/contact/viewobjectcontactofpageobj.hxx>
#include <svx/sdr/contact/viewcontactofpageobj.hxx>
#include <svx/svdopage.hxx>
@@ -83,7 +84,7 @@ PagePrimitiveExtractor::PagePrimitiveExtractor(
setPreviewRenderer(true);
// init timer
- SetPriority(VCL_IDLE_PRIORITY_HIGH);
+ SetPriority(IdlePriority::VCL_IDLE_PRIORITY_HIGH);
Stop();
}
diff --git a/sw/source/uibase/inc/srcedtw.hxx b/sw/source/uibase/inc/srcedtw.hxx
index 3a53386..153d9e1 100644
--- a/sw/source/uibase/inc/srcedtw.hxx
+++ b/sw/source/uibase/inc/srcedtw.hxx
@@ -22,6 +22,7 @@
#include <vcl/window.hxx>
#include <svl/lstner.hxx>
#include <vcl/timer.hxx>
+#include <vcl/idle.hxx>
#include <vcl/xtextedt.hxx>
#include <set>
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index 38b55027..dfdec71 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -91,6 +91,7 @@
#include <vcl/fixed.hxx>
#include <vcl/floatwin.hxx>
#include <vcl/group.hxx>
+#include <vcl/idle.hxx>
#include <vcl/imgctrl.hxx>
#include <vcl/longcurr.hxx>
#include <vcl/lstbox.hxx>
@@ -1868,7 +1869,7 @@ void SAL_CALL VCLXToolkit::processEventsToIdle()
throw (::com::sun::star::uno::RuntimeException, std::exception)
{
SolarMutexGuard aSolarGuard;
- Timer::ProcessAllIdleHandlers();
+ Idle::ProcessAllIdleHandlers();
}
}
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index e8df725..1266e07 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -324,6 +324,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/source/app/dndhelp \
vcl/source/app/help \
vcl/source/app/i18nhelp \
+ vcl/source/app/idle \
vcl/source/app/idlemgr \
vcl/source/app/salvtables \
vcl/source/app/session \
diff --git a/vcl/qa/cppunit/timer.cxx b/vcl/qa/cppunit/timer.cxx
index 4e2bb56..f33578a 100644
--- a/vcl/qa/cppunit/timer.cxx
+++ b/vcl/qa/cppunit/timer.cxx
@@ -16,6 +16,7 @@
#include <salhelper/thread.hxx>
#include <vcl/timer.hxx>
+#include <vcl/idle.hxx>
#include <vcl/svapp.hxx>
/// Avoid our timer tests just wedging the build if they fail.
@@ -86,12 +87,13 @@ class IdleBool : public Idle
bool &mrBool;
public:
IdleBool( bool &rBool ) :
- Idle( VCL_IDLE_PRIORITY_LOWEST ), mrBool( rBool )
+ Idle(), mrBool( rBool )
{
+ SetPriority( IdlePriority::VCL_IDLE_PRIORITY_LOWEST );
Start();
mrBool = false;
}
- virtual void Timeout() SAL_OVERRIDE
+ virtual void DoIdle() SAL_OVERRIDE
{
mrBool = true;
Application::EndYield();
@@ -102,7 +104,7 @@ void TimerTest::testIdle()
{
bool bTriggered = false;
IdleBool aTest( bTriggered );
- Timer::ProcessAllIdleHandlers();
+ Idle::ProcessAllIdleHandlers();
CPPUNIT_ASSERT_MESSAGE("watchdog triggered", bTriggered);
}
diff --git a/vcl/source/app/idle.cxx b/vcl/source/app/idle.cxx
index bf715fb..15427d6 100644
--- a/vcl/source/app/idle.cxx
+++ b/vcl/source/app/idle.cxx
@@ -94,9 +94,10 @@ void Idle::ImplDeInitIdle()
void Idle::ProcessAllIdleHandlers()
{
// process all pending Idle
- ImplIdleData* pIdleData;
- ImplIdleData* pPrevIdleData;
- while (pIdleData = ImplIdleData::GetFirstIdle())
+ ImplIdleData* pIdleData = NULL;
+ ImplIdleData* pPrevIdleData = NULL;
+ ImplSVData* pSVData = ImplGetSVData();
+ while ((pIdleData = ImplIdleData::GetFirstIdle()))
{
pIdleData->Invoke();
}
@@ -192,7 +193,7 @@ Idle& Idle::operator=( const Idle& rIdle )
Idle::Idle():
mpIdleData(NULL),
- mePriority(VCL_IDLE_PRIORITY_HIGH),
+ mePriority(IdlePriority::VCL_IDLE_PRIORITY_HIGH),
mbActive(false)
{
}
diff --git a/vcl/source/edit/textdata.cxx b/vcl/source/edit/textdata.cxx
index b4f5047..2004d6e 100644
--- a/vcl/source/edit/textdata.cxx
+++ b/vcl/source/edit/textdata.cxx
@@ -223,7 +223,7 @@ IdleFormatter::IdleFormatter()
{
mpView = 0;
mnRestarts = 0;
- SetPriority(VCL_IDLE_PRIORITY_HIGH);
+ SetPriority(IdlePriority::VCL_IDLE_PRIORITY_HIGH);
}
IdleFormatter::~IdleFormatter()
More information about the Libreoffice-commits
mailing list