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

Jim Raykowski (via logerrit) logerrit at kemper.freedesktop.org
Sun May 19 17:23:04 UTC 2019


 include/sfx2/charmapcontrol.hxx        |    1 +
 sfx2/source/control/charmapcontrol.cxx |    5 ++---
 2 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit e8a1db012fbd185f52f38806bcac8bb9917c51c3
Author:     Jim Raykowski <raykowj at gmail.com>
AuthorDate: Mon May 13 18:14:04 2019 -0800
Commit:     Jim Raykowski <raykowj at gmail.com>
CommitDate: Sun May 19 19:22:23 2019 +0200

    tdf#123793 Follow up fix for kb nav of special chars popup
    
    Static variable use to determine if initializing can focus properties of
    recent and favorite controls is needed only allows init to ever happen
    once. This patch changes use to a member variable. This corrects the
    problem of kb navigation only works the the first time the popup is shown
    and tab is used to navigate.
    
    Change-Id: I2bbb66071b582c9a4282c79d801b4a36c375ed2d
    Reviewed-on: https://gerrit.libreoffice.org/72264
    Tested-by: Jenkins
    Reviewed-by: Jim Raykowski <raykowj at gmail.com>

diff --git a/include/sfx2/charmapcontrol.hxx b/include/sfx2/charmapcontrol.hxx
index 1c15ae77b60d..3562a5c94d87 100644
--- a/include/sfx2/charmapcontrol.hxx
+++ b/include/sfx2/charmapcontrol.hxx
@@ -49,6 +49,7 @@ private:
     std::deque<OUString>   maFavCharList;
     std::deque<OUString>   maFavCharFontList;
     VclPtr<Button>         maDlgBtn;
+    bool                   mbNeedsInit = true;
 
     DECL_LINK(CharClickHdl, SvxCharViewControl*, void);
     DECL_STATIC_LINK(SfxCharmapCtrl, FocusHdl, Control&, void);
diff --git a/sfx2/source/control/charmapcontrol.cxx b/sfx2/source/control/charmapcontrol.cxx
index 7f757a7eb4df..6534a9b1efc6 100644
--- a/sfx2/source/control/charmapcontrol.cxx
+++ b/sfx2/source/control/charmapcontrol.cxx
@@ -184,7 +184,6 @@ void SfxCharmapCtrl::updateRecentCharControl()
 
 bool SfxCharmapCtrl::EventNotify( NotifyEvent& rNEvt )
 {
-    static bool bNeedsInit = true;
     if ( maDlgBtn->HasFocus() && rNEvt.GetType() == MouseNotifyEvent::KEYINPUT )
     {
         const vcl::KeyCode& rKey = rNEvt.GetKeyEvent()->GetKeyCode();
@@ -193,14 +192,14 @@ bool SfxCharmapCtrl::EventNotify( NotifyEvent& rNEvt )
         {
             return true;
         }
-        if ( bNeedsInit && nCode == KEY_TAB )
+        if ( mbNeedsInit && nCode == KEY_TAB )
         {
             for(int i = 0; i < 16; i++)
             {
                 m_pRecentCharView[i]->set_property( "can-focus", "true" );
                 m_pFavCharView[i]->set_property( "can-focus", "true" );
             }
-            bNeedsInit = false;
+            mbNeedsInit = false;
         }
     }
     return SfxPopupWindow::EventNotify( rNEvt );


More information about the Libreoffice-commits mailing list