From f41ef630f7fc706d18cce76c3abe76a53f03b2d5 Mon Sep 17 00:00:00 2001 From: Jim Raykowski Date: Mon, 1 Apr 2024 23:18:50 -0800 Subject: 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 --- sd/source/ui/dlg/navigatr.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 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 -- cgit