diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2022-07-19 17:20:17 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2022-07-28 07:37:43 +0200 |
commit | 7ba40c7d62c7c15f9c0e9cbc21b48f105454b885 (patch) | |
tree | 5afb6c32a28f807d3181d183a5a6fe17737dc44d /starmath | |
parent | 30e08c83e502562966351f4236e9dd9230ffa435 (diff) |
lok: Properly update sidebar context in Math
Change-Id: I830c0d9bdeaa6340283eafc3e91251d02602d7aa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137247
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/source/view.cxx | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index 56896a030572..71dd3bc53946 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -2099,29 +2099,6 @@ void SmViewShell::GetState(SfxItemSet &rSet) namespace { -css::uno::Reference<css::ui::XSidebar> -getSidebarFromModel(const css::uno::Reference<css::frame::XModel>& xModel) -{ - css::uno::Reference<css::container::XChild> xChild(xModel, css::uno::UNO_QUERY); - if (!xChild.is()) - return nullptr; - - css::uno::Reference<css::frame::XModel> xParent(xChild->getParent(), css::uno::UNO_QUERY); - if (!xParent.is()) - return nullptr; - - css::uno::Reference<css::frame::XController2> xController(xParent->getCurrentController(), - css::uno::UNO_QUERY); - if (!xController.is()) - return nullptr; - - css::uno::Reference<css::ui::XSidebarProvider> xSidebarProvider = xController->getSidebar(); - if (!xSidebarProvider.is()) - return nullptr; - - return xSidebarProvider->getSidebar(); -} - class SmController : public SfxBaseController { public: @@ -2141,14 +2118,7 @@ public: SfxBaseController::attachFrame(xFrame); // No need to call mpSelectionChangeHandler->Connect() unless SmController implements XSelectionSupplier - if (auto xSidebar = getSidebarFromModel(getModel())) - { - auto pSidebar = dynamic_cast<sfx2::sidebar::SidebarController*>(xSidebar.get()); - assert(pSidebar); - sfx2::sidebar::SidebarController::registerSidebarForFrame(pSidebar, this); - pSidebar->updateModel(getModel()); - mpSelectionChangeHandler->selectionChanged({}); // Installs the correct context - } + mpSelectionChangeHandler->selectionChanged({}); // Installs the correct context } private: |