summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2022-06-30 06:09:23 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2022-07-28 07:37:31 +0200
commit30e08c83e502562966351f4236e9dd9230ffa435 (patch)
treec30f96ce2290e404f10e186f0229334b287544a7 /sfx2
parent2fc16dc84d0b1b1bd7978a30e1b79ff3100fefdf (diff)
lok: Enable sidebar in Math
Change-Id: I1554a924eef0bfcaffa893057a37ef45321a0cf7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137246 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/sidebar/SidebarController.cxx5
-rw-r--r--sfx2/source/view/lokstarmathhelper.cxx9
2 files changed, 12 insertions, 2 deletions
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index 0bd71db0240d..6909f5c19d62 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -1609,9 +1609,10 @@ void SidebarController::saveDeckState()
}
}
-bool SidebarController::hasChartContextCurrently() const
+bool SidebarController::hasChartOrMathContextCurrently() const
{
- return GetCurrentContext().msApplication == "com.sun.star.chart2.ChartDocument";
+ return GetCurrentContext().msApplication == "com.sun.star.chart2.ChartDocument"
+ || GetCurrentContext().msApplication == "com.sun.star.formula.FormulaProperties";
}
sfx2::sidebar::SidebarController* SidebarController::GetSidebarControllerForView(const SfxViewShell* pViewShell)
diff --git a/sfx2/source/view/lokstarmathhelper.cxx b/sfx2/source/view/lokstarmathhelper.cxx
index 9df48759528d..9a704683aaec 100644
--- a/sfx2/source/view/lokstarmathhelper.cxx
+++ b/sfx2/source/view/lokstarmathhelper.cxx
@@ -13,6 +13,7 @@
#include <sfx2/lokcomponenthelpers.hxx>
#include <sfx2/lokhelper.hxx>
+#include <comphelper/dispatchcommand.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <tools/fract.hxx>
#include <vcl/layout.hxx>
@@ -43,6 +44,14 @@ css::uno::Reference<css::frame::XController>& LokStarMathHelper::GetXController(
return mxController;
}
+void LokStarMathHelper::Dispatch(const OUString& cmd,
+ const css::uno::Sequence<css::beans::PropertyValue>& rArguments)
+{
+ if (const css::uno::Reference<css::frame::XController>& xController = GetXController())
+ if (const css::uno::Reference<css::frame::XFrame> xFrame = xController->getFrame())
+ comphelper::dispatchCommand(cmd, xFrame, rArguments);
+}
+
namespace
{
// Find a child SmGraphicWindow*