From 0c80a474fa9853c173cdff57a200aec78eea5d73 Mon Sep 17 00:00:00 2001 From: Ashod Nakashian Date: Tue, 12 Mar 2019 11:09:29 -0400 Subject: Move the Help URL to a different config path This partially reverts e5a0bafa330c58d6c9352d3acbe4e97fafa1ad56 and simplifies the Help URL configuration. Change-Id: Icc7c31b8955f3df978b57dbd8aa8816a9e1f98ad Reviewed-on: https://gerrit.libreoffice.org/69106 Reviewed-by: Andras Timar Tested-by: Andras Timar --- include/vcl/settings.hxx | 2 -- .../registry/schema/org/openoffice/Office/Common.xcs | 13 +++++++------ sfx2/source/appl/sfxhelp.cxx | 3 ++- svtools/source/config/accessibilityoptions.cxx | 20 -------------------- vcl/source/app/settings.cxx | 20 +------------------- vcl/source/control/button.cxx | 3 ++- 6 files changed, 12 insertions(+), 49 deletions(-) diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx index 3f03059c7fc3..494e2bb8f24f 100644 --- a/include/vcl/settings.hxx +++ b/include/vcl/settings.hxx @@ -650,8 +650,6 @@ public: void SetTipTimeout( sal_uLong nTipTimeout ); sal_uLong GetTipTimeout() const; sal_uLong GetBalloonDelay() const; - OUString GetHelpURL() const; - void SetHelpURL(const OUString& rsHelpURL); bool operator ==( const HelpSettings& rSet ) const; bool operator !=( const HelpSettings& rSet ) const; diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index 8cecbaedc258..05dc0012b1ab 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -3534,6 +3534,13 @@ Default + + + Specifies the root URL to the Office help pages. Blank disables + Help buttons on dialogs in LibreOffice Online. + + https://help.collaboraoffice.com/help.html? + Contains settings for the start center. @@ -6043,12 +6050,6 @@ true - - - Specifies the URL to the Office help page. Blank disables help buttons. - - https://help.collaboraoffice.com/help.html? - Enables or disables the automatic time out of help tips. You diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index 5ee590123929..dd91e4873df0 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -59,6 +59,7 @@ #include #include #include +#include #include "newhelp.hxx" #include @@ -539,7 +540,7 @@ static bool impl_showOnlineHelp( const OUString& rURL ) if ( rURL.getLength() <= aInternal.getLength() || !rURL.startsWith(aInternal) ) return false; - OUString aHelpLink = Application::GetSettings().GetHelpSettings().GetHelpURL(); + 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/svtools/source/config/accessibilityoptions.cxx b/svtools/source/config/accessibilityoptions.cxx index 23c06d4a0d3a..98f5eb96a452 100644 --- a/svtools/source/config/accessibilityoptions.cxx +++ b/svtools/source/config/accessibilityoptions.cxx @@ -65,7 +65,6 @@ public: sal_Int16 GetListBoxMaximumLineCount() const; sal_Int16 GetColorValueSetColumnCount() const; bool GetPreviewUsesCheckeredBackground() const; - OUString GetHelpURL() const; }; // initialization of static members -------------------------------------- @@ -135,24 +134,6 @@ bool SvtAccessibilityOptions_Impl::GetIsHelpTipsDisappear() const return bRet; } -OUString SvtAccessibilityOptions_Impl::GetHelpURL() const -{ - css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY); - OUString sRet; - - try - { - if(xNode.is()) - xNode->getPropertyValue("HelpURL") >>= sRet; - } - catch(const css::uno::Exception& ex) - { - SAL_WARN("svtools.config", "Caught unexpected: " << ex); - } - - return sRet; -} - bool SvtAccessibilityOptions_Impl::GetIsAllowAnimatedGraphics() const { css::uno::Reference< css::beans::XPropertySet > xNode(m_xCfg, css::uno::UNO_QUERY); @@ -323,7 +304,6 @@ void SvtAccessibilityOptions_Impl::SetVCLSettings() bool StyleSettingsChanged(false); aHelpSettings.SetTipTimeout( GetIsHelpTipsDisappear() ? GetHelpTipSeconds() * 1000 : HELP_TIP_TIMEOUT); - aHelpSettings.SetHelpURL(GetHelpURL()); aAllSettings.SetHelpSettings(aHelpSettings); const sal_Int16 nEdgeBlendingCountA(GetEdgeBlending()); diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index 0490654461ae..e2841b8b4ed2 100644 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -228,7 +228,6 @@ struct ImplHelpData sal_uLong mnTipDelay; sal_uLong mnTipTimeout; sal_uLong mnBalloonDelay; - OUString msHelpURL; }; struct ImplAllSettingsData @@ -2591,7 +2590,6 @@ ImplHelpData::ImplHelpData( const ImplHelpData& rData ) mnTipDelay = rData.mnTipDelay; mnTipTimeout = rData.mnTipTimeout; mnBalloonDelay = rData.mnBalloonDelay; - msHelpURL = rData.msHelpURL; } HelpSettings::HelpSettings() @@ -2610,8 +2608,7 @@ bool HelpSettings::operator ==( const HelpSettings& rSet ) const return (mxData->mnTipDelay == rSet.mxData->mnTipDelay ) && (mxData->mnTipTimeout == rSet.mxData->mnTipTimeout ) && - (mxData->mnBalloonDelay == rSet.mxData->mnBalloonDelay ) && - (mxData->msHelpURL == rSet.mxData->msHelpURL); + (mxData->mnBalloonDelay == rSet.mxData->mnBalloonDelay ); } sal_uLong @@ -2642,21 +2639,6 @@ HelpSettings::GetBalloonDelay() const return mxData->mnBalloonDelay; } -OUString -HelpSettings::GetHelpURL() const -{ - return mxData->msHelpURL; -} - -void HelpSettings::SetHelpURL(const OUString& rsHelpURL) -{ - // copy if other references exist - if ( ! mxData.unique() ) { - mxData = std::make_shared(*mxData); - } - mxData->msHelpURL = rsHelpURL; -} - bool HelpSettings::operator !=( const HelpSettings& rSet ) const { diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 6e44e13bc67b..ecffa1cf5722 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -46,6 +46,7 @@ #include #include +#include using namespace css; @@ -1816,7 +1817,7 @@ void HelpButton::StateChanged( StateChangedType nStateChange ) { // Hide when we have no help URL. if (comphelper::LibreOfficeKit::isActive() && - Application::GetSettings().GetHelpSettings().GetHelpURL().isEmpty()) + officecfg::Office::Common::Help::HelpRootURL::get().isEmpty()) Hide(); else PushButton::StateChanged(nStateChange); -- cgit v1.2.3