From ed6aceab08e1c3951e1e33aa3d8070c57589b5db Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Thu, 26 Nov 2015 11:15:11 +0000 Subject: vcl: reduce pointless timer / scheduler / idle includes. Change-Id: I8bf7f8d6ba1a54f2969e055956fadc52ff6c8673 --- include/sfx2/objsh.hxx | 12 ------------ include/vcl/dialog.hxx | 1 - include/vcl/edit.hxx | 6 +++--- include/vcl/toolbox.hxx | 7 +++---- sfx2/source/inc/objshimp.hxx | 12 ++++++++++++ vcl/source/control/edit.cxx | 6 ++++++ vcl/source/window/toolbox.cxx | 9 +++++++-- 7 files changed, 31 insertions(+), 22 deletions(-) diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx index 8eca878255ac..09f8f074c2ff 100644 --- a/include/sfx2/objsh.hxx +++ b/include/sfx2/objsh.hxx @@ -37,7 +37,6 @@ #include #include -#include #include #include #include @@ -805,17 +804,6 @@ inline SfxObjectShellLock & SfxObjectShellLock:: inline SfxObjectShellLock & SfxObjectShellLock::operator = ( SfxObjectShell * pObjP ) { return *this = SfxObjectShellLock( pObjP ); } -class AutoReloadTimer_Impl : public Timer -{ - OUString aUrl; - SfxObjectShell* pObjSh; - -public: - AutoReloadTimer_Impl( const OUString& rURL, sal_uInt32 nTime, - SfxObjectShell* pSh ); - virtual void Invoke() override; -}; - class SFX2_DLLPUBLIC SfxObjectShellItem: public SfxPoolItem { SfxObjectShell* pObjSh; diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx index d4bbe5ce21dd..eb4a2fdda033 100644 --- a/include/vcl/dialog.hxx +++ b/include/vcl/dialog.hxx @@ -23,7 +23,6 @@ #include #include #include -#include #include // - Dialog - diff --git a/include/vcl/edit.hxx b/include/vcl/edit.hxx index da5dc164e739..3e6fbb77c5da 100644 --- a/include/vcl/edit.hxx +++ b/include/vcl/edit.hxx @@ -27,8 +27,6 @@ #include #include -#include -#include #include #include #include @@ -70,6 +68,8 @@ public: enum AutocompleteAction{ AUTOCOMPLETE_KEYINPUT, AUTOCOMPLETE_TABFORWARD, AUTOCOMPLETE_TABBACKWARD }; +class Timer; + // - Edit - class VCL_DLLPUBLIC Edit : public Control, public vcl::unohelper::DragAndDropClient { @@ -205,7 +205,7 @@ public: virtual bool IsModified() const { return mpSubEdit ? mpSubEdit->mbModified : mbModified; } virtual void EnableUpdateData( sal_uLong nTimeout = EDIT_UPDATEDATA_TIMEOUT ); - virtual void DisableUpdateData() { delete mpUpdateDataTimer; mpUpdateDataTimer = nullptr; } + virtual void DisableUpdateData(); void SetEchoChar( sal_Unicode c ); sal_Unicode GetEchoChar() const { return mcEchoChar; } diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx index a2e5a0ac1e27..e0b4fd731fde 100644 --- a/include/vcl/toolbox.hxx +++ b/include/vcl/toolbox.hxx @@ -25,12 +25,10 @@ #include #include #include -#include -#include #include +class Timer; class UserDrawEvent; - struct ImplToolItem; struct ImplToolSize; struct ImplToolBoxPrivateData; @@ -67,6 +65,7 @@ struct ImplToolSize sal_uInt16 mnLines; }; +class Idle; class VCL_DLLPUBLIC ToolBox : public DockingWindow { friend class FloatingWindow; @@ -76,7 +75,7 @@ private: ImplToolBoxPrivateData* mpData; std::vector maFloatSizes; ImageList maImageList; - Idle maIdle; + Idle *mpIdle; Rectangle maUpperRect; Rectangle maLowerRect; Rectangle maOutDockRect; diff --git a/sfx2/source/inc/objshimp.hxx b/sfx2/source/inc/objshimp.hxx index b7dbb0c8bac2..36f8bdff6618 100644 --- a/sfx2/source/inc/objshimp.hxx +++ b/sfx2/source/inc/objshimp.hxx @@ -30,6 +30,7 @@ #include #include #include "bitset.hxx" +#include #include @@ -45,6 +46,17 @@ struct MarkData_Impl class SfxBasicManagerHolder; +class AutoReloadTimer_Impl : public Timer +{ + OUString aUrl; + SfxObjectShell* pObjSh; + +public: + AutoReloadTimer_Impl( const OUString& rURL, sal_uInt32 nTime, + SfxObjectShell* pSh ); + virtual void Invoke() override; +}; + struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess { ::comphelper::EmbeddedObjectContainer* mpObjectContainer; diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx index dbd8233b0040..4b1056c55fc7 100644 --- a/vcl/source/control/edit.cxx +++ b/vcl/source/control/edit.cxx @@ -2463,6 +2463,12 @@ void Edit::EnableUpdateData( sal_uLong nTimeout ) } } +void Edit::DisableUpdateData() +{ + delete mpUpdateDataTimer; + mpUpdateDataTimer = nullptr; +} + void Edit::SetEchoChar( sal_Unicode c ) { mcEchoChar = c; diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index 6b4db051f61e..4105b586a40e 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -1398,8 +1398,9 @@ void ToolBox::ImplInit( vcl::Window* pParent, WinBits nStyle ) mnKeyModifier = 0; mnActivateCount = 0; - maIdle.SetPriority( SchedulerPriority::RESIZE ); - maIdle.SetIdleHdl( LINK( this, ToolBox, ImplUpdateHdl ) ); + mpIdle = new Idle("toolbox update"); + mpIdle->SetPriority( SchedulerPriority::RESIZE ); + mpIdle->SetIdleHdl( LINK( this, ToolBox, ImplUpdateHdl ) ); // set timeout and handler for dropdown items mpData->maDropdownTimer.SetTimeout( 250 ); @@ -1657,6 +1658,10 @@ void ToolBox::dispose() } } mpFloatWin.clear(); + + delete mpIdle; + mpIdle = nullptr; + DockingWindow::dispose(); } -- cgit v1.2.3