diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2021-01-21 12:12:53 +0100 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2021-01-22 15:45:02 +0100 |
commit | f5097bfa60451f39b761c7d7b415937d560d52fa (patch) | |
tree | 98f46c33cdf6d4ff0ab7ff6bee63c16225b7c6dd /include | |
parent | bfe856e7cb191888b723e6bb115242dc6d73d334 (diff) |
tdf#139830: keep the right sidebar context for chart after view switch (calc).
There is a general behavior to switch to the default sidebar context
by view deactivation and switch back to the right context by view
activation. See SfxShell::Activate() and SfxShell::Deactivate().
By activation, we use the selection to find out the right sidebar
context. See GetContextForSelection_SC() method for example. However,
for charts, this does not work, because the chart window is a separate
environment and the shell does not know what is selected inside the
chart window. So let's avoid context switches when we have a chart
window active. Let the chart controller handle sidebar context changes.
Change-Id: I272ee5c35ac30221eed2930201c4710a9a5877c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109790
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/sfx2/sidebar/SidebarController.hxx | 2 | ||||
-rw-r--r-- | include/sfx2/sidebar/Tools.hxx | 5 |
2 files changed, 7 insertions, 0 deletions
diff --git a/include/sfx2/sidebar/SidebarController.hxx b/include/sfx2/sidebar/SidebarController.hxx index 440ff55b7bfc..4de49fcbaea7 100644 --- a/include/sfx2/sidebar/SidebarController.hxx +++ b/include/sfx2/sidebar/SidebarController.hxx @@ -172,6 +172,8 @@ public: void SyncUpdate(); + bool hasChartContextCurrently() const; + private: SidebarController(SidebarDockingWindow* pParentWindow, const SfxViewFrame* pViewFrame); diff --git a/include/sfx2/sidebar/Tools.hxx b/include/sfx2/sidebar/Tools.hxx index 97b26c368dd9..25f3706b6471 100644 --- a/include/sfx2/sidebar/Tools.hxx +++ b/include/sfx2/sidebar/Tools.hxx @@ -31,9 +31,12 @@ namespace com::sun::star::frame { class XController; } namespace com::sun::star::frame { class XDispatch; } namespace com::sun::star::frame { class XFrame; } +class SfxViewShell; namespace sfx2 { namespace sidebar { +class SidebarController; + class SFX2_DLLPUBLIC Tools { public: @@ -56,6 +59,8 @@ public: static OUString GetModuleName ( const css::uno::Reference<css::frame::XController>& rxFrame); + + static sfx2::sidebar::SidebarController* GetSidebarController(SfxViewShell* pViewShell); }; |