[Libreoffice-commits] core.git: include/vcl vcl/source

Tor Lillqvist tml at collabora.com
Mon Jul 6 01:11:12 PDT 2015


 include/vcl/cursor.hxx       |    2 +-
 vcl/source/window/cursor.cxx |    9 ++++-----
 2 files changed, 5 insertions(+), 6 deletions(-)

New commits:
commit 166ee1186c46bdedae14c87bd122d56301f30d48
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Jul 6 11:03:04 2015 +0300

    ImplRestore() can be private
    
    It is only called from other member functions.
    
    Also, all the calls are inside conditionals that check mpData &&
    mpData->mbCurVisible already, so no need to check anew in the function. Use an
    assert() instead.
    
    Change-Id: Ibcde0aa43877b64b9b0ae5117cbda1fb44ee023d

diff --git a/include/vcl/cursor.hxx b/include/vcl/cursor.hxx
index 3a1127e..baf04d2 100644
--- a/include/vcl/cursor.hxx
+++ b/include/vcl/cursor.hxx
@@ -55,7 +55,6 @@ private:
 
 public:
     SAL_DLLPRIVATE void         ImplDraw();
-    SAL_DLLPRIVATE void         ImplRestore();
     DECL_DLLPRIVATE_LINK_TYPED( ImplTimerHdl, Timer*, void );
     SAL_DLLPRIVATE void         ImplShow( bool bDrawDirect = true );
     SAL_DLLPRIVATE void         ImplHide( bool bStopTimer );
@@ -101,6 +100,7 @@ public:
                         { return !(Cursor::operator==( rCursor )); }
 
 private:
+    void ImplRestore();
     void ImplDoShow( bool bDrawDirect, bool bRestore );
     bool ImplDoHide( bool bStop );
 };
diff --git a/vcl/source/window/cursor.cxx b/vcl/source/window/cursor.cxx
index b665be7..0d893ca 100644
--- a/vcl/source/window/cursor.cxx
+++ b/vcl/source/window/cursor.cxx
@@ -141,11 +141,10 @@ void vcl::Cursor::ImplDraw()
 
 void vcl::Cursor::ImplRestore()
 {
-    if ( mpData && mpData->mbCurVisible )
-    {
-        ImplCursorInvert( mpData );
-        mpData->mbCurVisible = false;
-    }
+    assert( mpData && mpData->mbCurVisible );
+
+    ImplCursorInvert( mpData );
+    mpData->mbCurVisible = false;
 }
 
 void vcl::Cursor::ImplDoShow( bool bDrawDirect, bool bRestore )


More information about the Libreoffice-commits mailing list