summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHubert Figuière <hub@collabora.com>2024-08-09 11:34:45 -0400
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-08-14 09:19:04 +0200
commit47680e0058bf580a850c3d789ab99250b7ffb301 (patch)
tree224517fa28e92466e33429245af2623cd5e304f7
parentd7349b9ac4d56adfaf9bbd7c8dac84152bd230fe (diff)
cool#9699 - Don't show Help button when there is no helpcp-24.04.6-2
The SfxSingleTabDialogController was explictely showing the Help button even if it was previously hidden by the VclBuilder due to lack of Help URL in Collabora Online This was the case in the spelling option dialog. See https://github.com/CollaboraOnline/online/issues/9699 Signed-off-by: Hubert Figuière <hub@collabora.com> Change-Id: I4454f3d1f0c097faeebf912c3282335fed67ec84 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171697 Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
-rw-r--r--include/sfx2/basedlgs.hxx1
-rw-r--r--sfx2/source/dialog/basedlgs.cxx6
2 files changed, 6 insertions, 1 deletions
diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx
index e182b9aa7789..dc76ff5357a0 100644
--- a/include/sfx2/basedlgs.hxx
+++ b/include/sfx2/basedlgs.hxx
@@ -102,6 +102,7 @@ class SFX2_DLLPUBLIC SfxSingleTabDialogController : public SfxOkDialogController
private:
std::unique_ptr<SfxItemSet> m_xOutputSet;
const SfxItemSet* m_pInputSet;
+ bool m_bHideHelpBtn;
public:
SfxSingleTabDialogController(weld::Widget* pParent, const SfxItemSet* pOptionsSet,
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx
index 29f0cf6532cb..738c19f85c7c 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -29,6 +29,7 @@
#include <sfx2/childwin.hxx>
#include <sfx2/viewsh.hxx>
#include <workwin.hxx>
+#include <officecfg/Office/Common.hxx>
#include <comphelper/lok.hxx>
using namespace ::com::sun::star::uno;
@@ -226,6 +227,7 @@ SfxSingleTabDialogController::SfxSingleTabDialogController(weld::Widget *pParent
const OUString& rUIXMLDescription, const OUString& rID)
: SfxOkDialogController(pParent, rUIXMLDescription, rID)
, m_pInputSet(pSet)
+ , m_bHideHelpBtn(comphelper::LibreOfficeKit::isActive() && officecfg::Office::Common::Help::HelpRootURL::get().isEmpty())
, m_xContainer(m_xDialog->weld_content_area())
, m_xOKBtn(m_xBuilder->weld_button("ok"))
, m_xHelpBtn(m_xBuilder->weld_button("help"))
@@ -237,6 +239,7 @@ SfxSingleTabDialogController::SfxSingleTabDialogController(weld::Widget *pParent
const OUString& rContainerId, const OUString& rUIXMLDescription, const OUString& rID)
: SfxOkDialogController(pParent, rUIXMLDescription, rID)
, m_pInputSet(pSet)
+ , m_bHideHelpBtn(comphelper::LibreOfficeKit::isActive() && officecfg::Office::Common::Help::HelpRootURL::get().isEmpty())
, m_xContainer(m_xBuilder->weld_container(rContainerId))
, m_xOKBtn(m_xBuilder->weld_button("ok"))
, m_xHelpBtn(m_xBuilder->weld_button("help"))
@@ -269,7 +272,8 @@ void SfxSingleTabDialogController::SetTabPage(std::unique_ptr<SfxTabPage> xTabPa
m_xSfxPage->SetUserData(sUserData);
m_xSfxPage->Reset(GetInputItemSet());
- m_xHelpBtn->set_visible(Help::IsContextHelpEnabled());
+ if (!m_bHideHelpBtn)
+ m_xHelpBtn->set_visible(Help::IsContextHelpEnabled());
// Set TabPage text in the Dialog if there is any
OUString sTitle(m_xSfxPage->GetPageTitle());