[Libreoffice-commits] .: Branch 'libreoffice-3-4' - vcl/inc vcl/source

David Tardon dtardon at kemper.freedesktop.org
Wed Apr 27 04:31:02 PDT 2011


 vcl/inc/vcl/cursor.hxx       |   10 ++++++++--
 vcl/source/window/cursor.cxx |   41 +++++++++++++++++++++++++++--------------
 vcl/source/window/window.cxx |    4 ++--
 3 files changed, 37 insertions(+), 18 deletions(-)

New commits:
commit 9eb0bf14ee5ef0904ec43262faed9a94f0edfc62
Author: David Tardon <dtardon at redhat.com>
Date:   Wed Apr 27 13:29:21 2011 +0200

    fdo#36404 real fix this time

diff --git a/vcl/inc/vcl/cursor.hxx b/vcl/inc/vcl/cursor.hxx
index c7ebe9f..647e507 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:
     sal_Bool			operator==( const Cursor& rCursor ) const;
     sal_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 9aaccff..04ccde6 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 = sal_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 c34ab78..010ec01 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


More information about the Libreoffice-commits mailing list