]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/caret.cpp
Removed floor() references
[wxWidgets.git] / src / msw / caret.cpp
index 29ec0e3f03f1a35130187d14b4388efca8d65d6d..08bc7e5389bf713e2676f383cd21ef430d82656d 100644 (file)
@@ -30,6 +30,7 @@
 
 #ifndef WX_PRECOMP
     #include "wx/window.h"
+    #include "wx/log.h"
 #endif // WX_PRECOMP
 
 #include "wx/caret.h"
@@ -140,11 +141,12 @@ void wxCaret::DoShow()
 
 void wxCaret::DoHide()
 {
-    wxASSERT_MSG( m_hasCaret, "cannot hide non existent caret" );
-
-    if ( !::HideCaret(GetWinHwnd(GetWindow())) )
+    if ( m_hasCaret )
     {
-        wxLogLastError("HideCaret");
+        if ( !::HideCaret(GetWinHwnd(GetWindow())) )
+        {
+            wxLogLastError("HideCaret");
+        }
     }
 }
 
@@ -154,10 +156,12 @@ void wxCaret::DoHide()
 
 void wxCaret::DoMove()
 {
-    wxASSERT_MSG( m_hasCaret, "cannot move non existent caret" );
-
-    if ( !::SetCaretPos(m_x, m_y) )
+    if ( m_hasCaret )
     {
-        wxLogLastError("SetCaretPos");
+        if ( !::SetCaretPos(m_x, m_y) )
+        {
+            wxLogLastError("SetCaretPos");
+        }
     }
+    //else: we don't have caret right now, nothing to do (this does happen)
 }