summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2019-03-11 22:40:32 -0400
committerAndras Timar <andras.timar@collabora.com>2019-09-22 18:13:52 +0200
commit02d940168095fd733aef608afdc71509ca68eabf (patch)
tree54bc73f2d19c4dc2345f48ed55c3ee8ec46a876e
parentf4146c70daf41420f7ac75dfe2b57195f3594282 (diff)
Make the Help URL configurable
When the Help URL is blank, the Help buttons are hidden LOK (but not desktop). Change-Id: Ibd76452108d1e3a92fb43f2c0af0586b0cbed073 Reviewed-on: https://gerrit.libreoffice.org/69071 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/69142 Tested-by: Jenkins (cherry picked from commit ed901c336ff0b99291ffe53be6bd762abcccf55c) Reviewed-on: https://gerrit.libreoffice.org/79268
-rw-r--r--include/vcl/button.hxx2
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Common.xcs7
-rw-r--r--sfx2/source/appl/sfxhelp.cxx6
-rw-r--r--vcl/source/control/button.cxx12
4 files changed, 24 insertions, 3 deletions
diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx
index dd5d95018410..7673ad301405 100644
--- a/include/vcl/button.hxx
+++ b/include/vcl/button.hxx
@@ -267,6 +267,8 @@ private:
HelpButton( const HelpButton & ) = delete;
HelpButton & operator= ( const HelpButton & ) = delete;
+ virtual void StateChanged( StateChangedType nStateChange ) override;
+
public:
explicit HelpButton( vcl::Window* pParent, WinBits nStyle = 0 );
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 0de779dba282..c9202282b482 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -3592,6 +3592,13 @@
</info>
<value>Default</value>
</prop>
+ <prop oor:name="HelpRootURL" oor:type="xs:string" oor:nillable="false">
+ <info>
+ <desc>Specifies the root URL to the Office help pages. Blank disables
+ Help buttons on dialogs in LibreOffice Online.</desc>
+ </info>
+ <value>https://help.libreoffice.com/help.html?</value>
+ </prop>
<group oor:name="StartCenter">
<info>
<desc>Contains settings for the start center.</desc>
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index 2d36e9ac5198..8ff9a5bc24ed 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -75,6 +75,7 @@
#include <comphelper/lok.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <sfx2/viewsh.hxx>
+#include <officecfg/Office/Common.hxx>
#include "newhelp.hxx"
#include <sfx2/objsh.hxx>
@@ -707,12 +708,11 @@ bool SfxHelp::Start(const OUString& rURL, weld::Widget* pWidget)
/// Redirect the vnd.sun.star.help:// urls to http://help.libreoffice.org
static bool impl_showOnlineHelp( const OUString& rURL )
{
- OUString aInternal( "vnd.sun.star.help://" );
+ static const OUString aInternal("vnd.sun.star.help://");
if ( rURL.getLength() <= aInternal.getLength() || !rURL.startsWith(aInternal) )
return false;
- OUString aHelpLink( "https://help.libreoffice.org/help.html?" );
-
+ OUString aHelpLink = officecfg::Office::Common::Help::HelpRootURL::get();
OUString aTarget = "Target=" + rURL.copy(aInternal.getLength());
aTarget = aTarget.replaceAll("%2F", "/").replaceAll("?", "&");
aHelpLink += aTarget;
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 03089aca6742..4fcd195ae535 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -47,6 +47,8 @@
#include <osl/diagnose.h>
#include <comphelper/dispatchcommand.hxx>
+#include <comphelper/lok.hxx>
+#include <officecfg/Office/Common.hxx>
using namespace css;
@@ -1838,6 +1840,16 @@ void HelpButton::Click()
PushButton::Click();
}
+void HelpButton::StateChanged( StateChangedType nStateChange )
+{
+ // Hide when we have no help URL.
+ if (comphelper::LibreOfficeKit::isActive() &&
+ officecfg::Office::Common::Help::HelpRootURL::get().isEmpty())
+ Hide();
+ else
+ PushButton::StateChanged(nStateChange);
+}
+
void RadioButton::ImplInitRadioButtonData()
{
mbChecked = false;