summaryrefslogtreecommitdiff
path: root/sfx2/source/view
diff options
context:
space:
mode:
authorJustin Luth <jluth@mail.com>2023-06-30 21:44:01 -0400
committerJustin Luth <jluth@mail.com>2023-07-01 12:36:35 +0200
commit0211c88f884065aa179725bd2eb846edd4c5bb6b (patch)
treebc3df1a904983fa14e2bb6b4b00c640bf1f6ef8c /sfx2/source/view
parentf0c8ccaef39dc7cb876e00679f70c36ca60883d9 (diff)
tdf#126006 sc SID_RELOAD: restart notebookbar
Change-Id: Icca41461d203615be58f9cf1214b82d70ee55ccb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153818 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
Diffstat (limited to 'sfx2/source/view')
-rw-r--r--sfx2/source/view/viewfrm.cxx18
1 files changed, 16 insertions, 2 deletions
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 196a18d3d335..0766eec86088 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -838,8 +838,18 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
UpdateDocument_Impl();
- if (vcl::CommandInfoProvider::GetModuleIdentifier(GetFrame().GetFrameInterface()) == "com.sun.star.text.TextDocument")
- sfx2::SfxNotebookBar::ReloadNotebookBar(u"modules/swriter/ui/");
+ auto sModule = vcl::CommandInfoProvider::GetModuleIdentifier(GetFrame().GetFrameInterface());
+ OUString sReloadNotebookBar;
+ if (sModule == "com.sun.star.text.TextDocument")
+ sReloadNotebookBar = u"modules/swriter/ui/";
+ else if (sModule == "com.sun.star.sheet.SpreadsheetDocument")
+ sReloadNotebookBar = u"modules/scalc/ui/";
+ else if (sfx2::SfxNotebookBar::IsActive()
+ && sModule != "presentation.PresentationDocument"
+ && sModule != "com.sun.star.drawing.DrawingDocument")
+ {
+ assert(false && "SID_RELOAD Notebookbar active, but not refreshed here");
+ }
try
{
@@ -878,6 +888,10 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
// Propagate document closure.
SfxGetpApp()->NotifyEvent( SfxEventHint( SfxEventHintId::CloseDoc, GlobalEventConfig::GetEventName( GlobalEventId::CLOSEDOC ), xOldObj ) );
+
+ // tdf#126006 Calc needs to reload the notebookbar after closing the document
+ if (!sReloadNotebookBar.isEmpty())
+ sfx2::SfxNotebookBar::ReloadNotebookBar(sReloadNotebookBar);
}
// Record as done