desktop/source/app/app.cxx | 4 ++-- framework/source/jobs/helponstartup.cxx | 2 +- include/sfx2/sfxhelp.hxx | 7 ++++--- include/vcl/help.hxx | 7 ++++--- sfx2/source/appl/sfxhelp.cxx | 2 +- vcl/source/window/menuwindow.cxx | 4 ++-- 6 files changed, 14 insertions(+), 12 deletions(-)
New commits: commit ce83d1f448ae28f30c98a607a83ff3e012538d36 Author: Caolán McNamara <[email protected]> AuthorDate: Thu Mar 11 12:54:33 2021 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Fri Mar 12 10:06:05 2021 +0100 use preferred variant when window arg is null Change-Id: I8fad194b6f147b40ecee6fff9fbbe947e7faa014 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112345 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index b6bc634757e9..90a98d0506b0 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1936,7 +1936,7 @@ void Desktop::OpenClients() #elif defined _WIN32 aHelpURL += "&System=WIN"; #endif - Application::GetHelp()->Start(aHelpURL, static_cast<const vcl::Window*>(nullptr)); + Application::GetHelp()->Start(aHelpURL); return; } } @@ -2292,7 +2292,7 @@ void Desktop::HandleAppEvent( const ApplicationEvent& rAppEvent ) break; case ApplicationEvent::Type::OpenHelpUrl: // start help for a specific URL - Application::GetHelp()->Start(rAppEvent.GetStringData(), static_cast<vcl::Window*>(nullptr)); + Application::GetHelp()->Start(rAppEvent.GetStringData()); break; case ApplicationEvent::Type::Print: { diff --git a/framework/source/jobs/helponstartup.cxx b/framework/source/jobs/helponstartup.cxx index f022cbb73e05..41c6c3dc3e1e 100644 --- a/framework/source/jobs/helponstartup.cxx +++ b/framework/source/jobs/helponstartup.cxx @@ -124,7 +124,7 @@ css::uno::Any SAL_CALL HelpOnStartup::execute(const css::uno::Sequence< css::bea // Note: The help window brings itself to front ... Help* pHelp = Application::GetHelp(); if (pHelp) - pHelp->Start(sModuleDependentHelpURL, static_cast<vcl::Window*>(nullptr)); + pHelp->Start(sModuleDependentHelpURL); } } diff --git a/include/sfx2/sfxhelp.hxx b/include/sfx2/sfxhelp.hxx index 7f4d687b102d..f07c2017287f 100644 --- a/include/sfx2/sfxhelp.hxx +++ b/include/sfx2/sfxhelp.hxx @@ -30,14 +30,15 @@ class SFX2_DLLPUBLIC SfxHelp final : public Help bool bIsDebug; private: - SAL_DLLPRIVATE static bool Start_Impl( const OUString& rURL, const vcl::Window* pWindow, const OUString& rKeyword ); SAL_DLLPRIVATE static bool Start_Impl(const OUString& rURL, weld::Widget* pWidget, const OUString& rKeyword); SAL_DLLPRIVATE virtual void SearchKeyword( const OUString& rKeyWord ) override; - SAL_DLLPRIVATE virtual bool Start( const OUString& rURL, const vcl::Window* pWindow ) override; - SAL_DLLPRIVATE virtual bool Start(const OUString& rURL, weld::Widget* pWidget) override; + SAL_DLLPRIVATE virtual bool Start(const OUString& rURL, weld::Widget* pWidget = nullptr) override; SAL_DLLPRIVATE static OUString GetHelpModuleName_Impl(const OUString &rHelpId); SAL_DLLPRIVATE static OUString CreateHelpURL_Impl( const OUString& aCommandURL, const OUString& rModuleName ); + SAL_DLLPRIVATE static bool Start_Impl( const OUString& rURL, const vcl::Window* pWindow, const OUString& rKeyword ); + SAL_DLLPRIVATE virtual bool Start( const OUString& rURL, const vcl::Window* pWindow ) override; + public: SfxHelp(); virtual ~SfxHelp() override; diff --git a/include/vcl/help.hxx b/include/vcl/help.hxx index 83b2bdbe569f..7dc848a42e0c 100644 --- a/include/vcl/help.hxx +++ b/include/vcl/help.hxx @@ -63,12 +63,13 @@ public: Help(); virtual ~Help(); - virtual bool Start(const OUString& rHelpId, const vcl::Window* pWindow); - virtual bool Start(const OUString& rHelpId, weld::Widget* pWidget); + virtual bool Start(const OUString& rHelpId, weld::Widget* pWidget = nullptr); virtual void SearchKeyword( const OUString& rKeyWord ); - virtual OUString GetHelpText(const OUString& aHelpURL, const vcl::Window* pWindow); virtual OUString GetHelpText(const OUString& aHelpURL, const weld::Widget* pWidget); + virtual bool Start(const OUString& rHelpId, const vcl::Window* pWindow); + virtual OUString GetHelpText(const OUString& aHelpURL, const vcl::Window* pWindow); + static void EnableContextHelp(); static void DisableContextHelp(); static bool IsContextHelpEnabled(); diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index 2e3e80680feb..6732fb5b0e63 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -686,7 +686,7 @@ OUString SfxHelp::GetURLHelpText(std::u16string_view aURL) void SfxHelp::SearchKeyword( const OUString& rKeyword ) { - Start_Impl(OUString(), static_cast<vcl::Window*>(nullptr), rKeyword); + Start_Impl(OUString(), static_cast<weld::Widget*>(nullptr), rKeyword); } bool SfxHelp::Start( const OUString& rURL, const vcl::Window* pWindow ) diff --git a/vcl/source/window/menuwindow.cxx b/vcl/source/window/menuwindow.cxx index 2387d485fb13..fae4746a689e 100644 --- a/vcl/source/window/menuwindow.cxx +++ b/vcl/source/window/menuwindow.cxx @@ -99,9 +99,9 @@ bool MenuWindow::ImplHandleHelpEvent(vcl::Window* pMenuWindow, Menu const * pMen aHelpId = OOO_HELP_INDEX; if ( !aCommand.isEmpty() ) - pHelp->Start(aCommand, static_cast<vcl::Window*>(nullptr)); + pHelp->Start(aCommand); else - pHelp->Start(OStringToOUString(aHelpId, RTL_TEXTENCODING_UTF8), static_cast<vcl::Window*>(nullptr)); + pHelp->Start(OStringToOUString(aHelpId, RTL_TEXTENCODING_UTF8)); } bDone = true; } _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
