diff options
Diffstat (limited to 'sw/source/core/inc/layact.hxx')
-rw-r--r-- | sw/source/core/inc/layact.hxx | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/sw/source/core/inc/layact.hxx b/sw/source/core/inc/layact.hxx index 50335077694c..1707383b62d7 100644 --- a/sw/source/core/inc/layact.hxx +++ b/sw/source/core/inc/layact.hxx @@ -22,6 +22,7 @@ #include <sal/config.h> #include <vcl/inputtypes.hxx> +#include <vcl/TaskStopwatch.hxx> #include <tools/color.hxx> #include <ctime> @@ -56,6 +57,7 @@ class SwLayAction { SwRootFrame *m_pRoot; SwViewShellImp *m_pImp; // here the action logs in and off + TaskStopwatch* m_pWatch; // For the sake of optimization, so that the tables stick a bit better to // the Cursor when hitting return/backspace in front of one. @@ -74,7 +76,6 @@ class SwLayAction std::clock_t m_nStartTicks; // The Action's starting time; if too much time passes the // WaitCursor can be enabled via CheckWaitCursor() - VclInputFlags m_nInputType; // Which input should terminate processing sal_uInt16 m_nEndPage; // StatBar control sal_uInt16 m_nCheckPageNum; // CheckPageDesc() was delayed if != USHRT_MAX // check from this page onwards @@ -84,9 +85,8 @@ class SwLayAction bool m_bCalcLayout; // Complete reformatting? bool m_bAgain; // For the automatically repeated Action if Pages are deleted bool m_bNextCycle; // Reset on the first invalid Page - bool m_bInput; // For terminating processing on input - bool m_bIdle; // True if the LayAction was triggered by the Idler bool m_bReschedule; // Call Reschedule depending on Progress? + bool m_bInterrupt; // For termination the layouting bool m_bCheckPages; // Run CheckPageDescs() or delay it bool m_bUpdateExpFields; // Is set if, after Formatting, we need to do another round for ExpField bool m_bBrowseActionStop; // Terminate Action early (as per bInput) and leave the rest to the Idler @@ -119,33 +119,26 @@ class SwLayAction bool RemoveEmptyBrowserPages(); - inline void CheckIdleEnd(); - public: - SwLayAction( SwRootFrame *pRt, SwViewShellImp *pImp ); + SwLayAction(SwRootFrame *pRt, SwViewShellImp *pImp, TaskStopwatch* pWatch = nullptr); ~SwLayAction(); - void SetIdle ( bool bNew ) { m_bIdle = bNew; } void SetCheckPages ( bool bNew ) { m_bCheckPages = bNew; } void SetBrowseActionStop( bool bNew ) { m_bBrowseActionStop = bNew; } void SetNextCycle ( bool bNew ) { m_bNextCycle = bNew; } bool IsWaitAllowed() const { return m_bWaitAllowed; } bool IsNextCycle() const { return m_bNextCycle; } - bool IsInput() const { return m_bInput; } bool IsPaint() const { return m_bPaint; } - bool IsIdle() const { return m_bIdle; } bool IsReschedule() const { return m_bReschedule; } - bool IsPaintExtraData() const { return m_bPaintExtraData;} - bool IsInterrupt() const { return IsInput(); } - - VclInputFlags GetInputType() const { return m_nInputType; } + bool IsIdle() const { return m_pWatch != nullptr; } + bool IsPaintExtraData() const { return m_bPaintExtraData; } + bool IsInterrupt(); // adjusting Action to the wanted behaviour void SetPaint ( bool bNew ) { m_bPaint = bNew; } void SetComplete ( bool bNew ) { m_bComplete = bNew; } void SetStatBar ( bool bNew ); - void SetInputType ( VclInputFlags nNew ) { m_nInputType = nNew; } void SetCalcLayout ( bool bNew ) { m_bCalcLayout = bNew; } void SetReschedule ( bool bNew ) { m_bReschedule = bNew; } void SetWaitAllowed ( bool bNew ) { m_bWaitAllowed = bNew; } @@ -182,21 +175,19 @@ public: class SwLayIdle { - + TaskStopwatch m_aWatch; SwRootFrame *pRoot; SwViewShellImp *pImp; // The Idler registers and deregisters here SwContentNode *pContentNode; // The current cursor position is saved here sal_Int32 nTextPos; bool bPageValid; // Were we able to evaluate everything on the whole page? - #ifdef DBG_UTIL bool m_bIndicator; -#endif -#ifdef DBG_UTIL void ShowIdle( Color eName ); #endif + bool IsInterrupt(); enum IdleJobType{ ONLINE_SPELLING, AUTOCOMPLETE_WORDS, WORD_COUNT, SMART_TAGS }; bool DoIdleJob_( const SwContentFrame*, IdleJobType ); bool DoIdleJob( IdleJobType, bool bVisAreaOnly ); |