summaryrefslogtreecommitdiff
path: root/include/vcl/notebookbar
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2022-06-07 10:11:48 +0300
committerMaxim Monastirsky <momonasmon@gmail.com>2022-06-12 10:38:27 +0200
commit881774e9e35055cbaed36324542bae006eedb4fb (patch)
tree43fabaeb51de72e5eaca85d61e6c7d7f850bff82 /include/vcl/notebookbar
parent932257c50c1dc9302b14862424e24e975f88bcc2 (diff)
Related: tdf#125040 NB: rework print preview context
Current implementation broadcasts the context change before the new controller was set on the frame (via XFrame::setComponent). This isn't going to work for anything LayoutManager based, as it responds to frame events by recreating all toolbars, so the newly created toolbar won't see the context sent for the old controller. Solve that by delaying the context change to SfxShell::Activate, like anywhere else in the codebase. And make NB listen to frame events, so it could also switch listening to the new controller. Also fixed a crash when switching to print preview in Writer with the navigator in the sidebar being active. Ideally we shouldn't even try to create sidebar panels in print preview, as the sidebar as a whole is disabled. But left that for a future investigation. Change-Id: I07759c676d2a2eb6f752fe778b559b15d2d759ec Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135492 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Diffstat (limited to 'include/vcl/notebookbar')
-rw-r--r--include/vcl/notebookbar/notebookbar.hxx8
1 files changed, 3 insertions, 5 deletions
diff --git a/include/vcl/notebookbar/notebookbar.hxx b/include/vcl/notebookbar/notebookbar.hxx
index 635bea058f2a..b93e3707fb7c 100644
--- a/include/vcl/notebookbar/notebookbar.hxx
+++ b/include/vcl/notebookbar/notebookbar.hxx
@@ -18,6 +18,7 @@
namespace com::sun::star::ui { class XContextChangeEventListener; }
+class NotebookBarContextChangeEventListener;
class NotebookbarContextControl;
class SystemWindow;
class SfxViewShell;
@@ -44,8 +45,7 @@ public:
void DataChanged(const DataChangedEvent& rDCEvt) override;
- void ControlListenerForCurrentController(bool bListen);
- void StopListeningAllControllers();
+ void SetupListener(bool bListen);
bool IsWelded() const { return m_bIsWelded; }
VclPtr<vcl::Window>& GetMainContainer() { return m_xVclContentArea; }
@@ -54,10 +54,8 @@ public:
private:
VclPtr<SystemWindow> m_pSystemWindow;
- css::uno::Reference<css::ui::XContextChangeEventListener> m_pEventListener;
- std::set<css::uno::Reference<css::frame::XController>> m_alisteningControllers;
+ rtl::Reference<NotebookBarContextChangeEventListener> m_pEventListener;
std::vector<NotebookbarContextControl*> m_pContextContainers;
- css::uno::Reference<css::frame::XFrame> mxFrame;
const SfxViewShell* m_pViewShell;
VclPtr<vcl::Window> m_xVclContentArea;