diff options
-rw-r--r-- | include/vcl/IDialogRenderable.hxx | 2 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 22 |
2 files changed, 23 insertions, 1 deletions
diff --git a/include/vcl/IDialogRenderable.hxx b/include/vcl/IDialogRenderable.hxx index e5596c5fe88f..86ea333d1100 100644 --- a/include/vcl/IDialogRenderable.hxx +++ b/include/vcl/IDialogRenderable.hxx @@ -27,7 +27,7 @@ typedef sal_uInt32 LOKWindowId; class VCL_DLLPUBLIC ILibreOfficeKitNotifier { public: - virtual ~ILibreOfficeKitNotifier() {} + virtual ~ILibreOfficeKitNotifier(); /// Callbacks virtual void notifyWindow(vcl::LOKWindowId nLOKWindowId, diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index d20dccb60481..02e10941d61d 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -3217,6 +3217,28 @@ void Window::ReleaseLOKNotifier() mpWindowImpl->mnLOKWindowId = 0; } +ILibreOfficeKitNotifier::~ILibreOfficeKitNotifier() +{ + if (!comphelper::LibreOfficeKit::isActive()) + { + return; + } + + for (auto it = GetLOKWindowsMap().begin(); it != GetLOKWindowsMap().end();) + { + WindowImpl* pWindowImpl = it->second->ImplGetWindowImpl(); + if (pWindowImpl->mpLOKNotifier == this) + { + pWindowImpl->mpLOKNotifier = nullptr; + pWindowImpl->mnLOKWindowId = 0; + it = GetLOKWindowsMap().erase(it); + continue; + } + + ++it; + } +} + const vcl::ILibreOfficeKitNotifier* Window::GetLOKNotifier() const { return mpWindowImpl->mpLOKNotifier; |