[Libreoffice-commits] .: vcl/inc vcl/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Sep 14 00:03:47 PDT 2012


 vcl/inc/vcl/ctrl.hxx        |    6 +++++-
 vcl/inc/vcl/window.hxx      |    1 +
 vcl/source/control/ctrl.cxx |   10 ++++++----
 3 files changed, 12 insertions(+), 5 deletions(-)

New commits:
commit 9684b9b6e5cb1354522af51e7ea75a49c44e638f
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Mon Aug 20 21:15:27 2012 -0500

    gridfixes: #i117265# implement less-predicate for Date/Time structs
    
    Change-Id: Idf0e5bed399fbf288534779665198e214631c0a0
    Reviewed-on: https://gerrit.libreoffice.org/536
    Reviewed-by: Miklos Vajna <vmiklos at suse.cz>
    Tested-by: Miklos Vajna <vmiklos at suse.cz>

diff --git a/vcl/inc/vcl/ctrl.hxx b/vcl/inc/vcl/ctrl.hxx
index 43f168d..98dd33b 100644
--- a/vcl/inc/vcl/ctrl.hxx
+++ b/vcl/inc/vcl/ctrl.hxx
@@ -48,7 +48,7 @@ protected:
     ::vcl::ImplControlData* mpControlData;
 
 private:
-    sal_Bool                mbHasFocus;
+    bool                    mbHasControlFocus;
     Link                    maGetFocusHdl;
     Link                    maLoseFocusHdl;
 
@@ -176,6 +176,10 @@ public:
     void            SetLoseFocusHdl( const Link& rLink ) { maLoseFocusHdl = rLink; }
     const Link&     GetLoseFocusHdl() const { return maLoseFocusHdl; }
 
+    /** determines whether the control currently has the focus
+    */
+    bool            HasControlFocus() const { return mbHasControlFocus; }
+
     void            SetLayoutDataParent( const Control* pParent ) const;
 
     virtual Size    GetOptimalSize(WindowSizeType eType) const;
diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx
index 63b5025..67349ee 100644
--- a/vcl/inc/vcl/window.hxx
+++ b/vcl/inc/vcl/window.hxx
@@ -262,6 +262,7 @@ typedef sal_uInt16 StateChangedType;
 #define STATE_CHANGE_READONLY           ((StateChangedType)16)
 #define STATE_CHANGE_EXTENDEDSTYLE      ((StateChangedType)17)
 #define STATE_CHANGE_MIRRORING          ((StateChangedType)18)
+#define STATE_CHANGE_CONTROL_FOCUS      ((StateChangedType)20)
 #define STATE_CHANGE_USER               ((StateChangedType)10000)
 
 // GetFocusFlags
diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx
index 5039c2b..b0e796d 100644
--- a/vcl/source/control/ctrl.cxx
+++ b/vcl/source/control/ctrl.cxx
@@ -47,7 +47,7 @@ using namespace vcl;
 
 void Control::ImplInitControlData()
 {
-    mbHasFocus      = sal_False;
+    mbHasControlFocus       = sal_False;
     mpControlData   = new ImplControlData;
 }
 
@@ -295,9 +295,10 @@ long Control::Notify( NotifyEvent& rNEvt )
 {
     if ( rNEvt.GetType() == EVENT_GETFOCUS )
     {
-        if ( !mbHasFocus )
+        if ( !mbHasControlFocus )
         {
-            mbHasFocus = sal_True;
+            mbHasControlFocus = sal_True;
+            StateChanged( STATE_CHANGE_CONTROL_FOCUS );
             if ( ImplCallEventListenersAndHandler( VCLEVENT_CONTROL_GETFOCUS, maGetFocusHdl, this ) )
                 // been destroyed within the handler
                 return sal_True;
@@ -310,7 +311,8 @@ long Control::Notify( NotifyEvent& rNEvt )
             Window* pFocusWin = Application::GetFocusWindow();
             if ( !pFocusWin || !ImplIsWindowOrChild( pFocusWin ) )
             {
-                mbHasFocus = sal_False;
+                mbHasControlFocus = sal_False;
+                StateChanged( STATE_CHANGE_CONTROL_FOCUS );
                 if ( ImplCallEventListenersAndHandler( VCLEVENT_CONTROL_LOSEFOCUS, maLoseFocusHdl, this ) )
                     // been destroyed within the handler
                     return sal_True;


More information about the Libreoffice-commits mailing list