[Libreoffice-commits] core.git: sw/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed Apr 15 15:59:03 UTC 2020


 sw/source/uibase/utlui/navipi.cxx |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit ada385f1cba427416c1e8517cb6a45b61ceff7b0
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Apr 15 15:34:06 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Apr 15 17:58:26 2020 +0200

    navigator pane is grabbing focus away from document when its created
    
    so only grab that focus when its a floating navigator
    
    Change-Id: I52e0840e74c3e8058aee3702df52137dfdd3dc9d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92279
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx
index 2a0d30610c26..62cae46965d7 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -582,10 +582,12 @@ SwNavigationPI::SwNavigationPI(vcl::Window* pParent,
 
     m_aStatusArr[3] = SwResId(STR_ACTIVE_VIEW);
 
+    bool bFloatingNavigator = SfxChildWindowContext::GetFloatingWindow(GetParent()) != nullptr;
+
     m_xContentTree->set_selection_mode(SelectionMode::Single);
     m_xContentTree->ShowTree();
     m_xContent3ToolBox->set_item_active("listbox", true);
-    m_xContent3ToolBox->set_item_sensitive("listbox", SfxChildWindowContext::GetFloatingWindow(GetParent()) != nullptr);
+    m_xContent3ToolBox->set_item_sensitive("listbox", bFloatingNavigator);
 
 //  TreeListBox for global document
     m_xGlobalTree->set_selection_mode(SelectionMode::Multiple);
@@ -622,9 +624,10 @@ SwNavigationPI::SwNavigationPI(vcl::Window* pParent,
                     pActView->GetWrtShellPtr()->IsGlblDocSaveLinks());
         if (m_pConfig->IsGlobalActive())
             ToggleTree();
-        m_xGlobalTree->grab_focus();
+        if (bFloatingNavigator)
+            m_xGlobalTree->grab_focus();
     }
-    else
+    else if (bFloatingNavigator)
         m_xContentTree->grab_focus();
     UsePage();
     m_aPageChgIdle.SetInvokeHandler(LINK(this, SwNavigationPI, ChangePageHdl));


More information about the Libreoffice-commits mailing list