diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-06-06 20:17:47 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-06-06 22:34:57 +0200 |
commit | 33111d134b0703f682687d144a38acdb48717f3b (patch) | |
tree | daf03c66e90a02ed19f43d7bd7d4cd8649adab80 /sfx2/source | |
parent | dc346060164e800c7fed7859b17c19ddd2e027c9 (diff) |
the remaining Help::GetHelpText calls don't want their parent as fallback
so we can drop the hierarchical search
these probably do nothing in the absence of the classic help. fpicker
case might benefit from moving some a11y translations out of help into
core.
Change-Id: I01b8d0c7cc1a1b3697d3332e330c6b4654e76af1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168507
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/appl/sfxhelp.cxx | 67 | ||||
-rw-r--r-- | sfx2/source/dialog/filedlghelper.cxx | 2 |
2 files changed, 2 insertions, 67 deletions
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index a0babdee399a..f7612c6da0cd 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -580,83 +580,18 @@ static SfxHelpWindow_Impl* impl_createHelp(Reference< XFrame2 >& rHelpTask , return pHelpWindow; } -OUString SfxHelp::GetHelpText( const OUString& aCommandURL, const vcl::Window* pWindow ) +OUString SfxHelp::GetHelpText(const OUString& aCommandURL) { OUString sModuleName = GetHelpModuleName_Impl(aCommandURL); auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(aCommandURL, getCurrentModuleIdentifier_Impl()); OUString sRealCommand = vcl::CommandInfoProvider::GetRealCommandForCommand(aProperties); OUString sHelpText = SfxHelp_Impl::GetHelpText( sRealCommand.isEmpty() ? aCommandURL : sRealCommand, sModuleName ); - OUString aNewHelpId; - - if (pWindow && sHelpText.isEmpty()) - { - // no help text found -> try with parent help id. - vcl::Window* pParent = pWindow->GetParent(); - while ( pParent ) - { - aNewHelpId = pParent->GetHelpId(); - sHelpText = SfxHelp_Impl::GetHelpText( aNewHelpId, sModuleName ); - if (!sHelpText.isEmpty()) - pParent = nullptr; - else - pParent = pParent->GetParent(); - } - - if (bIsDebug && sHelpText.isEmpty()) - aNewHelpId.clear(); - } - - // add some debug information? - if ( bIsDebug ) - { - sHelpText += "\n-------------\n" + - sModuleName + ": " + aCommandURL; - if ( !aNewHelpId.isEmpty() ) - { - sHelpText += " - " + aNewHelpId; - } - } - - return sHelpText; -} - -OUString SfxHelp::GetHelpText(const OUString& aCommandURL, const weld::Widget* pWidget) -{ - OUString sModuleName = GetHelpModuleName_Impl(aCommandURL); - auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(aCommandURL, getCurrentModuleIdentifier_Impl()); - OUString sRealCommand = vcl::CommandInfoProvider::GetRealCommandForCommand(aProperties); - OUString sHelpText = SfxHelp_Impl::GetHelpText( sRealCommand.isEmpty() ? aCommandURL : sRealCommand, sModuleName ); - - OUString aNewHelpId; - - if (pWidget && sHelpText.isEmpty()) - { - // no help text found -> try with parent help id. - std::unique_ptr<weld::Widget> xParent(pWidget->weld_parent()); - while (xParent) - { - aNewHelpId = xParent->get_help_id(); - sHelpText = SfxHelp_Impl::GetHelpText( aNewHelpId, sModuleName ); - if (!sHelpText.isEmpty()) - xParent.reset(); - else - xParent = xParent->weld_parent(); - } - - if (bIsDebug && sHelpText.isEmpty()) - aNewHelpId.clear(); - } - // add some debug information? if ( bIsDebug ) { sHelpText += "\n-------------\n" + sModuleName + ": " + aCommandURL; - if ( !aNewHelpId.isEmpty() ) - { - sHelpText += " - " + aNewHelpId; - } } return sHelpText; diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 3fa8768b637c..8afdd2f17727 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -274,7 +274,7 @@ OUString FileDialogHelper_Impl::handleHelpRequested( const FilePickerEvent& aEve OUString aHelpText; Help* pHelp = Application::GetHelp(); if ( pHelp ) - aHelpText = pHelp->GetHelpText(sHelpId, static_cast<weld::Widget*>(nullptr)); + aHelpText = pHelp->GetHelpText(sHelpId); return aHelpText; } |