diff options
author | Ashod Nakashian <ashod.nakashian@collabora.co.uk> | 2019-11-22 21:07:21 -0500 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2020-05-27 21:53:39 +0100 |
commit | 5343d4c314295e39ec5c4a7683f0c09bf3ce64d2 (patch) | |
tree | f77927d86f69b8f2104d16a85954b437c31327ff /include | |
parent | c6f93e65148f8eaf437ddfe97cffce4568911ead (diff) |
sidebar: reset the LOKNotifier when the ViewShell changes
The ViewShell (which implements the LOKNotifier interface)
changes during the lifetime of the SidebarDockingWindow.
This is extremely problematic, because we assign the
LOKNotifier to a window, and use it to emit notifications
to the LOKit clients. When the ViewShell changes, a window
(the SidebarDockingWindow in this case) may end up using
an old ViewShell instance, which may have just been destroyed.
Now we properly reset the LOKNotifier to make sure we are
using the current ViewShell at all times. This is still
not ideal, since we may use the wrong ViewShell to send
out notifications, but we can't control that as we are at
the mercy of the mechanism that changes the current ViewShell.
This also removes obsolete flags to control which
document-types supported sidebar, as well as other misc
cleanups.
Change-Id: Ic208f64596a39feb7354958cf4d5e1e033d87b5b
Reviewed-on: https://gerrit.libreoffice.org/83627
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/sfx2/sidebar/SidebarChildWindow.hxx | 5 | ||||
-rw-r--r-- | include/sfx2/sidebar/SidebarDockingWindow.hxx | 8 |
2 files changed, 3 insertions, 10 deletions
diff --git a/include/sfx2/sidebar/SidebarChildWindow.hxx b/include/sfx2/sidebar/SidebarChildWindow.hxx index 0351c3859d9b..7902fddbfad0 100644 --- a/include/sfx2/sidebar/SidebarChildWindow.hxx +++ b/include/sfx2/sidebar/SidebarChildWindow.hxx @@ -39,11 +39,6 @@ public: SFX_DECL_CHILDWINDOW_WITHID(SidebarChildWindow); static sal_Int32 GetDefaultWidth(vcl::Window const * pWindow); - - bool IsSidebarVisibleInLOK() const { return mbSidebarVisibleInLOK; } - -private: - const bool mbSidebarVisibleInLOK; }; diff --git a/include/sfx2/sidebar/SidebarDockingWindow.hxx b/include/sfx2/sidebar/SidebarDockingWindow.hxx index c3fa3498d1fc..37f6532c7dd7 100644 --- a/include/sfx2/sidebar/SidebarDockingWindow.hxx +++ b/include/sfx2/sidebar/SidebarDockingWindow.hxx @@ -62,15 +62,13 @@ private: SfxChildAlignment eCurrentAlignment, SfxChildAlignment eRequestedAlignment) override; + /// Notify LOKit that we closed and release the LOKNotifier. + void LOKClose(); + ::rtl::Reference<sfx2::sidebar::SidebarController> mpSidebarController; bool mbIsReadyToDrag; std::unique_ptr<svt::AcceleratorExecute> mpAccel; - void DoDispose(); - - const bool mbSidebarVisibleInLOK; - - const SfxViewShell* mpOldViewShell; std::unique_ptr<SidebarNotifyIdle> mpIdleNotify; }; |