summaryrefslogtreecommitdiff
path: root/sw/source/uibase/utlui/glbltree.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/uibase/utlui/glbltree.cxx')
-rw-r--r--sw/source/uibase/utlui/glbltree.cxx32
1 files changed, 19 insertions, 13 deletions
diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx
index 448f2655727a..7d7d0104fc7b 100644
--- a/sw/source/uibase/utlui/glbltree.cxx
+++ b/sw/source/uibase/utlui/glbltree.cxx
@@ -1164,21 +1164,27 @@ IMPL_LINK( SwGlobalTree, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg, vo
void SwGlobalTree::Notify(SfxBroadcaster& rBC, SfxHint const& rHint)
{
- SfxViewEventHint const*const pVEHint(dynamic_cast<SfxViewEventHint const*>(&rHint));
- SwXTextView* pDyingShell = nullptr;
- if (m_pActiveShell && pVEHint && pVEHint->GetEventName() == "OnViewClosed")
- pDyingShell = dynamic_cast<SwXTextView*>(pVEHint->GetController().get());
- if (pDyingShell && pDyingShell->GetView() == &m_pActiveShell->GetView())
+ if (rHint.GetId() == SfxHintId::ThisIsAnSfxEventHint)
{
- EndListening(*m_pActiveShell->GetView().GetDocShell());
- m_pActiveShell = nullptr;
- }
- else
- {
- SfxListener::Notify(rBC, rHint);
- if (rHint.GetId() == SfxHintId::SwNavigatorUpdateTracking)
- UpdateTracking();
+ const SfxEventHint* pEventHint = static_cast<const SfxEventHint*>(&rHint);
+ if (pEventHint->GetEventId() == SfxEventHintId::CloseView)
+ {
+ SfxViewEventHint const*const pVEHint(static_cast<SfxViewEventHint const*>(&rHint));
+ if (m_pActiveShell)
+ {
+ SwXTextView* pDyingShell = dynamic_cast<SwXTextView*>(pVEHint->GetController().get());
+ if (pDyingShell && pDyingShell->GetView() == &m_pActiveShell->GetView())
+ {
+ EndListening(*m_pActiveShell->GetView().GetDocShell());
+ m_pActiveShell = nullptr;
+ }
+ }
+ return;
+ }
}
+ SfxListener::Notify(rBC, rHint);
+ if (rHint.GetId() == SfxHintId::SwNavigatorUpdateTracking)
+ UpdateTracking();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */