sd/source/ui/dlg/navigatr.cxx |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

New commits:
commit f41ef630f7fc706d18cce76c3abe76a53f03b2d5
Author:     Jim Raykowski <rayk...@gmail.com>
AuthorDate: Mon Apr 1 23:18:50 2024 -0800
Commit:     Jim Raykowski <rayk...@gmail.com>
CommitDate: Sat Apr 6 03:16:52 2024 +0200

    SdNavigator: Make the objects tree update after rename
    
    Change-Id: Ibec7df5dcf5cf817b1c3574e3f3acd8206c72e20
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165668
    Tested-by: Jenkins
    Reviewed-by: Jim Raykowski <rayk...@gmail.com>

diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx
index 7423a8425eeb..af0e37e36d3a 100644
--- a/sd/source/ui/dlg/navigatr.cxx
+++ b/sd/source/ui/dlg/navigatr.cxx
@@ -303,12 +303,18 @@ IMPL_LINK(SdNavigatorWin, CommandHdl, const 
CommandEvent&, rCEvt, bool)
 
 void SdNavigatorWin::ExecuteContextMenuAction(std::u16string_view 
rSelectedPopupEntry)
 {
-    if (rSelectedPopupEntry == u"rename" && mpBindings)
+    if (rSelectedPopupEntry == u"rename")
     {
         weld::TreeView& rTreeView = GetObjects().get_treeview();
         std::unique_ptr<weld::TreeIter> xIter(rTreeView.make_iterator());
         if (rTreeView.get_selected(xIter.get()))
         {
+            // grab the shell focus so the navigator will update
+            if (SfxViewShell* pCurSh = SfxViewShell::Current())
+            {
+                if (vcl::Window* pShellWnd = pCurSh->GetWindow())
+                    pShellWnd->GrabFocus();
+            }
             if (rTreeView.get_iter_depth(*xIter) > 0)
                 mpBindings->Execute(SID_NAME_GROUP);
             else

Reply via email to