From b21159a74f287acd07c94422eb5cb3375f06c6bc Mon Sep 17 00:00:00 2001 From: Rafael Lima Date: Wed, 19 Jul 2023 15:07:20 +0200 Subject: tdf#156378 Open function help page on F1 in the Functions sidebar With this patch, when the user opens the Functions sidebar, select an entry and presses F1, the help page about the selected function will be shown. Change-Id: I37eecc4e325cee7f25ddb1cd81098ca318ce6518 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154617 Tested-by: Jenkins Tested-by: Heiko Tietze Reviewed-by: Heiko Tietze --- sc/source/ui/formdlg/dwfunctr.cxx | 8 ++++++++ sc/source/ui/inc/dwfunctr.hxx | 1 + 2 files changed, 9 insertions(+) diff --git a/sc/source/ui/formdlg/dwfunctr.cxx b/sc/source/ui/formdlg/dwfunctr.cxx index 438f8fb70e24..8fde50549be1 100644 --- a/sc/source/ui/formdlg/dwfunctr.cxx +++ b/sc/source/ui/formdlg/dwfunctr.cxx @@ -57,6 +57,7 @@ ScFunctionWin::ScFunctionWin(weld::Widget* pParent) InitLRUList(); nArgs=0; + m_aHelpId = xFuncList->get_help_id(); // Description box has a height of 8 lines of text xFiFuncDesc->set_size_request(-1, 8 * xFiFuncDesc->get_text_height()); @@ -176,6 +177,13 @@ void ScFunctionWin::SetDescription() *pDesc->mxFuncDesc; xFiFuncDesc->set_text(aBuf); + + // Update help ID for the selected entry + const OUString sHelpId = pDesc->getHelpId(); + if (!sHelpId.isEmpty()) + xFuncList->set_help_id(pDesc->getHelpId()); + else + xFuncList->set_help_id(m_aHelpId); } } diff --git a/sc/source/ui/inc/dwfunctr.hxx b/sc/source/ui/inc/dwfunctr.hxx index 9b984b918e11..b6d0d032a857 100644 --- a/sc/source/ui/inc/dwfunctr.hxx +++ b/sc/source/ui/inc/dwfunctr.hxx @@ -52,6 +52,7 @@ private: std::unique_ptr xConfigChange; const ScFuncDesc* pFuncDesc; sal_uInt16 nArgs; + OUString m_aHelpId; ::std::vector< const formula::IFunctionDescription*> aLRUList; -- cgit