summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2015-11-26 11:15:11 +0000
committerMichael Meeks <michael.meeks@collabora.com>2015-11-26 22:17:36 +0000
commited4d8c89ee954b3c9340583c95e8622a6cb47b3b (patch)
tree8c2cb37e2e2475bfa5eebca50b4985911b16de5c
parent2c854ebae5879149261d6314061f43a379e32568 (diff)
vcl: reduce pointless timer / scheduler / idle includes.
Change-Id: I8bf7f8d6ba1a54f2969e055956fadc52ff6c8673
-rw-r--r--include/formula/funcutl.hxx1
-rw-r--r--include/sfx2/objsh.hxx12
-rw-r--r--include/vcl/dialog.hxx1
-rw-r--r--include/vcl/edit.hxx6
-rw-r--r--include/vcl/toolbox.hxx7
-rw-r--r--sfx2/source/inc/objshimp.hxx12
-rw-r--r--svtools/source/control/tabbar.cxx1
-rw-r--r--vcl/source/control/edit.cxx6
-rw-r--r--vcl/source/window/toolbox.cxx9
-rw-r--r--vcl/source/window/toolbox2.cxx5
10 files changed, 36 insertions, 24 deletions
diff --git a/include/formula/funcutl.hxx b/include/formula/funcutl.hxx
index f0ea363d3d15..e6d03bed59b3 100644
--- a/include/formula/funcutl.hxx
+++ b/include/formula/funcutl.hxx
@@ -23,6 +23,7 @@
#include <vcl/fixed.hxx>
#include <vcl/button.hxx>
#include <vcl/edit.hxx>
+#include <vcl/idle.hxx>
#include <formula/formuladllapi.h>
namespace formula {
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 <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/document/CmisVersion.hpp>
-#include <vcl/timer.hxx>
#include <vcl/vclptr.hxx>
#include <svl/poolitem.hxx>
#include <vcl/bitmap.hxx>
@@ -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 <tools/solar.h>
#include <vcl/dllapi.h>
#include <vcl/syswin.hxx>
-#include <vcl/timer.hxx>
#include <vcl/vclptr.hxx>
// - 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 <tools/solar.h>
#include <vcl/dllapi.h>
-#include <vcl/timer.hxx>
-#include <vcl/idle.hxx>
#include <vcl/menu.hxx>
#include <vcl/dndhelp.hxx>
#include <vcl/vclptr.hxx>
@@ -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 <vcl/dllapi.h>
#include <vcl/dockwin.hxx>
#include <vcl/image.hxx>
-#include <vcl/timer.hxx>
-#include <vcl/idle.hxx>
#include <vector>
+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<ImplToolSize> 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 a6310037d760..737dd1f18b8b 100644
--- a/sfx2/source/inc/objshimp.hxx
+++ b/sfx2/source/inc/objshimp.hxx
@@ -30,6 +30,7 @@
#include <sfx2/objsh.hxx>
#include <sfx2/docmacromode.hxx>
#include "bitset.hxx"
+#include <vcl/timer.hxx>
#include <appbaslib.hxx>
@@ -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/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index eb2f5aacb0a5..a71036bd04d8 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -35,6 +35,7 @@
#include <svtools/svtools.hrc>
#include <limits>
#include <utility>
+#include <vcl/idle.hxx>
namespace
{
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();
}
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index 72a3b58bef55..dddb65fba628 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -25,6 +25,7 @@
#include <tools/rc.h>
#include <vcl/svapp.hxx>
+#include <vcl/idle.hxx>
#include <vcl/help.hxx>
#include <vcl/bitmap.hxx>
#include <vcl/toolbox.hxx>
@@ -357,7 +358,7 @@ void ToolBox::ImplInvalidate( bool bNewCalc, bool bFullPaint )
{
Invalidate( Rectangle( mnLeftBorder, mnTopBorder,
mnDX-mnRightBorder-1, mnDY-mnBottomBorder-1 ) );
- maIdle.Stop();
+ mpIdle->Stop();
}
}
else
@@ -368,7 +369,7 @@ void ToolBox::ImplInvalidate( bool bNewCalc, bool bFullPaint )
// do we need to redraw?
if ( IsReallyVisible() && IsUpdateMode() )
- maIdle.Start();
+ mpIdle->Start();
}
}