diff options
-rw-r--r-- | starmath/inc/helpids.h | 1 | ||||
-rw-r--r-- | starmath/inc/view.hxx | 3 | ||||
-rw-r--r-- | starmath/source/edit.cxx | 6 | ||||
-rw-r--r-- | starmath/source/view.cxx | 14 |
4 files changed, 24 insertions, 0 deletions
diff --git a/starmath/inc/helpids.h b/starmath/inc/helpids.h index 195ccfb570a9..19325ebd2a16 100644 --- a/starmath/inc/helpids.h +++ b/starmath/inc/helpids.h @@ -21,6 +21,7 @@ #include <rtl/ustring.hxx> +inline constexpr OUStringLiteral HID_SMA_MAIN_HELP = u"STARMATH_HID_SMA_MAIN_HELP"; inline constexpr OUStringLiteral HID_SMA_WIN_DOCUMENT = u"STARMATH_HID_SMA_WIN_DOCUMENT"; inline constexpr OUStringLiteral HID_SMA_COMMAND_WIN_EDIT = u"STARMATH_HID_SMA_COMMAND_WIN_EDIT"; diff --git a/starmath/inc/view.hxx b/starmath/inc/view.hxx index bef51e8560e0..dc42dde2fdc9 100644 --- a/starmath/inc/view.hxx +++ b/starmath/inc/view.hxx @@ -348,6 +348,9 @@ public: } static bool IsInlineEditEnabled(); + // Opens the main help page for the Math module + void StartMainHelp(); + private: void ZoomByItemSet(const SfxItemSet *pSet); }; diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx index 1eee64ad04c7..4cb4f6532f64 100644 --- a/starmath/source/edit.cxx +++ b/starmath/source/edit.cxx @@ -288,6 +288,12 @@ bool SmEditTextWindow::Command(const CommandEvent& rCEvt) bool SmEditTextWindow::KeyInput(const KeyEvent& rKEvt) { + if (rKEvt.GetKeyCode().GetCode() == KEY_F1) + { + mrEditWindow.GetView()->StartMainHelp(); + return true; + } + if (rKEvt.GetKeyCode().GetCode() == KEY_ESCAPE) { bool bCallBase = true; diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index a67745184e34..449dc0e586e7 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -66,6 +66,7 @@ #include <sfx2/zoomitem.hxx> #include <vcl/commandevent.hxx> #include <vcl/event.hxx> +#include <vcl/help.hxx> #include <vcl/settings.hxx> #include <vcl/virdev.hxx> #include <sal/log.hxx> @@ -700,6 +701,12 @@ bool CharInput(sal_uInt32 c, SmCursor& rCursor, OutputDevice& rDevice) bool SmGraphicWidget::KeyInput(const KeyEvent& rKEvt) { + if (rKEvt.GetKeyCode().GetCode() == KEY_F1) + { + GetView().StartMainHelp(); + return true; + } + if (!SmViewShell::IsInlineEditEnabled()) return GetView().KeyInput(rKEvt); @@ -2329,6 +2336,13 @@ bool SmViewShell::IsInlineEditEnabled() || officecfg::Office::Common::Misc::ExperimentalMode::get(); } +void SmViewShell::StartMainHelp() +{ + Help* pHelp = Application::GetHelp(); + if (pHelp) + pHelp->Start(HID_SMA_MAIN_HELP, GetViewFrame().GetFrameWeld()); +} + void SmViewShell::ZoomByItemSet(const SfxItemSet *pSet) { assert(pSet); |