include/sfx2/basedlgs.hxx       |    1 +
 sfx2/source/dialog/basedlgs.cxx |    6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 47680e0058bf580a850c3d789ab99250b7ffb301
Author:     Hubert Figuière <h...@collabora.com>
AuthorDate: Fri Aug 9 11:34:45 2024 -0400
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Wed Aug 14 09:19:04 2024 +0200

    cool#9699 - Don't show Help button when there is no help
    
    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 <h...@collabora.com>
    Change-Id: I4454f3d1f0c097faeebf912c3282335fed67ec84
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171697
    Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

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());

Reply via email to