diff options
author | Jim Raykowski <raykowj@gmail.com> | 2024-04-01 23:18:50 -0800 |
---|---|---|
committer | Jim Raykowski <raykowj@gmail.com> | 2024-04-06 03:16:52 +0200 |
commit | f41ef630f7fc706d18cce76c3abe76a53f03b2d5 (patch) | |
tree | 099b15a103a822d4de8133a1480d1134d79978e6 /sd | |
parent | 2c724d88fef38a390744bbe1a4add031c6c62843 (diff) |
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 <raykowj@gmail.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/dlg/navigatr.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
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 |