diff options
-rw-r--r-- | vcl/inc/vcl/cursor.hxx | 10 | ||||
-rw-r--r-- | vcl/source/window/cursor.cxx | 41 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 4 |
3 files changed, 37 insertions, 18 deletions
diff --git a/vcl/inc/vcl/cursor.hxx b/vcl/inc/vcl/cursor.hxx index c9820b3229a6..7fd95454945e 100644 --- a/vcl/inc/vcl/cursor.hxx +++ b/vcl/inc/vcl/cursor.hxx @@ -69,8 +69,10 @@ public: SAL_DLLPRIVATE void ImplDraw(); SAL_DLLPRIVATE void ImplRestore(); DECL_DLLPRIVATE_LINK( ImplTimerHdl, AutoTimer* ); - SAL_DLLPRIVATE void ImplShow( bool bDrawDirect = true, bool bRestore = false ); - SAL_DLLPRIVATE bool ImplHide(); + SAL_DLLPRIVATE void ImplShow( bool bDrawDirect = true ); + SAL_DLLPRIVATE void ImplHide(); + SAL_DLLPRIVATE void ImplResume( bool bRestore = false ); + SAL_DLLPRIVATE bool ImplSuspend(); SAL_DLLPRIVATE void ImplNew(); public: @@ -113,6 +115,10 @@ public: bool operator==( const Cursor& rCursor ) const; bool operator!=( const Cursor& rCursor ) const { return !(Cursor::operator==( rCursor )); } + +private: + void ImplDoShow( bool bDrawDirect, bool bRestore ); + bool ImplDoHide( bool bStop ); }; #endif // _SV_CURSOR_HXX diff --git a/vcl/source/window/cursor.cxx b/vcl/source/window/cursor.cxx index 544351400ccb..eb05373a3b2f 100644 --- a/vcl/source/window/cursor.cxx +++ b/vcl/source/window/cursor.cxx @@ -170,9 +170,7 @@ void Cursor::ImplRestore() } } -// ----------------------------------------------------------------------- - -void Cursor::ImplShow( bool bDrawDirect, bool bRestore ) +void Cursor::ImplDoShow( bool bDrawDirect, bool bRestore ) { if ( mbVisible ) { @@ -215,9 +213,7 @@ void Cursor::ImplShow( bool bDrawDirect, bool bRestore ) } } -// ----------------------------------------------------------------------- - -bool Cursor::ImplHide() +bool Cursor::ImplDoHide( bool bSuspend ) { bool bWasCurVisible = false; if ( mpData && mpData->mpWindow ) @@ -225,12 +221,35 @@ bool Cursor::ImplHide() bWasCurVisible = mpData->mbCurVisible; if ( mpData->mbCurVisible ) ImplRestore(); - mpData->maTimer.Stop(); + + if ( !bSuspend ) + { + mpData->maTimer.Stop(); + mpData->mpWindow = NULL; + } } return bWasCurVisible; } -// ----------------------------------------------------------------------- +void Cursor::ImplShow( bool bDrawDirect ) +{ + ImplDoShow( bDrawDirect, false ); +} + +void Cursor::ImplHide() +{ + ImplDoHide( false ); +} + +void Cursor::ImplResume( bool bRestore ) +{ + ImplDoShow( false, bRestore ); +} + +bool Cursor::ImplSuspend() +{ + ImplDoHide( true ); +} void Cursor::ImplNew() { @@ -331,12 +350,6 @@ void Cursor::Hide() { mbVisible = false; ImplHide(); - - if( mpData ) - { - mpData->maTimer.Stop(); - mpData->mpWindow = NULL; - } } } diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index fdb86cb07303..e7fd025f2aae 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -2404,7 +2404,7 @@ void Window::ImplCallPaint( const Region* pRegion, sal_uInt16 nPaintFlags ) { bool bRestoreCursor = false; if ( mpWindowImpl->mpCursor ) - bRestoreCursor = mpWindowImpl->mpCursor->ImplHide(); + bRestoreCursor = mpWindowImpl->mpCursor->ImplSuspend(); mbInitClipRegion = sal_True; mpWindowImpl->mbInPaint = sal_True; @@ -2451,7 +2451,7 @@ void Window::ImplCallPaint( const Region* pRegion, sal_uInt16 nPaintFlags ) mbInitClipRegion = sal_True; mpWindowImpl->mpPaintRegion = NULL; if ( mpWindowImpl->mpCursor ) - mpWindowImpl->mpCursor->ImplShow( false, bRestoreCursor ); + mpWindowImpl->mpCursor->ImplResume( bRestoreCursor ); } } else |